/* Reference Layout Specification - Modern Dark UI Overhaul */

:root {
  --ref-bg-sidebar: #121214;
  --ref-bg-chat: #16161a;
  --ref-bg-card: #18181c;
  --ref-border: #222226;
  --ref-border-subtle: #27272a;
  --ref-border-composer: #2c2c32;
  --ref-text-primary: #f4f4f5;
  --ref-text-secondary: #a1a1aa;
  --ref-text-muted: #71717a;
  --ref-blue-bg: #172554;
  --ref-blue-border: #1e40af;
  --ref-blue-text: #60a5fa;
  --ref-purple-avatar: #7c3aed;
  --ref-red-alert: #ef4444;
}

/* Master Layout Grid */
#app {
  display: flex !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
  background-color: var(--ref-bg-chat) !important;
}

/* Sidebar Overhaul */
#sidebar {
  width: 270px !important;
  min-width: 270px !important;
  max-width: 270px !important;
  height: 100% !important;
  background-color: var(--ref-bg-sidebar) !important;
  border-right: 1px solid var(--ref-border) !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  overflow: hidden !important;
  transform: none !important;
  z-index: 40 !important;
}

.icon-rail {
  display: none !important;
}

.navigation-panel {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
  padding: 0 !important;
  background-color: transparent !important;
}

/* Sidebar Top Navigation */
.sidebar-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid transparent;
}

.sidebar-nav-top-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--ref-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-icon-btn:hover {
  background: #1f1f23;
  color: var(--ref-text-primary);
}

.nav-icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Sidebar Action Buttons (+ New & ... More) */
.sidebar-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 12px;
}

.btn-sidebar-new {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: #222226;
  border: 1px solid var(--ref-border-composer);
  border-radius: 8px;
  color: var(--ref-text-primary);
  font-size: 13px;
  font-weight: 500;
  height: 32px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-sidebar-new:hover {
  background-color: #2a2a30;
  border-color: #3f3f46;
}

.btn-sidebar-more {
  display: none !important;
}

.btn-sidebar-more:hover {
  background-color: #1f1f23;
  color: var(--ref-text-primary);
}

.navigation-panel {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Scrollable Center Area (Teammates + Sessions) */
.sidebar-scrollable-roster {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-bottom: 24px !important;
  margin-bottom: 0 !important;
}

.sidebar-scrollable-roster::-webkit-scrollbar {
  width: 4px;
}
.sidebar-scrollable-roster::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 2px;
}

.sidebar-section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ref-text-muted);
  padding: 10px 16px 4px;
}

/* Teammates List */
.teammate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 2px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.teammate-row:hover {
  background-color: #1a1a1e;
}

.teammate-row.is-active {
  background-color: #242429;
}

.teammate-avatar-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.teammate-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teammate-avatar-placeholder {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
}

.teammate-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.teammate-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.teammate-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ref-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teammate-time {
  font-size: 11px;
  color: var(--ref-text-muted);
  flex-shrink: 0;
}

.teammate-snippet {
  font-size: 12px;
  color: var(--ref-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sessions Section */
.sessions-toggle-btn {
  width: calc(100% - 16px);
  margin: 12px 8px 4px;
  padding: 6px 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ref-text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sessions-toggle-btn:hover {
  background: #1a1a1e;
  color: var(--ref-text-primary);
}

.sessions-toggle-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.sessions-toggle-btn.is-collapsed svg {
  transform: rotate(-90deg);
}

.sessions-container {
  display: flex;
  flex-direction: column;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin: 2px 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ref-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.session-row:hover {
  background: #1a1a1e;
  color: var(--ref-text-primary);
}

.session-row.is-active {
  background: #242429;
  color: var(--ref-text-primary);
  font-weight: 500;
}

.session-row svg {
  width: 15px;
  height: 15px;
  color: var(--ref-text-muted);
}

/* Fixed Bottom User Profile Card */
.sidebar-profile-card {
  position: relative !important;
  flex-shrink: 0 !important;
  height: 60px !important;
  background-color: var(--ref-bg-sidebar) !important;
  border-top: 1px solid var(--ref-border) !important;
  padding: 0 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  z-index: 10 !important;
}

.profile-user-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ref-purple-avatar);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.profile-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ref-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-app-version {
  font-size: 11px;
  color: var(--ref-text-muted);
}

.profile-action-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--ref-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.profile-action-btn:hover {
  background: #1f1f23;
  color: var(--ref-text-primary);
}

.profile-action-btn svg {
  width: 15px;
  height: 15px;
}

/* Main Chat View Overhaul */
.chat-view {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  background-color: var(--ref-bg-chat) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Header */
.chat-header {
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  background-color: var(--ref-bg-chat) !important;
  border-bottom: 1px solid var(--ref-border) !important;
  padding: 0 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.chat-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ref-text-primary);
  margin: 0;
}

.chat-header-menu-btn {
  background: transparent;
  border: none;
  color: var(--ref-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
}

.chat-header-menu-btn:hover {
  background: #242429;
  color: var(--ref-text-primary);
}

.chat-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-toggle-btn {
  background: transparent;
  border: none;
  color: var(--ref-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.panel-toggle-btn:hover {
  color: var(--ref-text-primary);
  background: #242429;
}

.panel-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.window-controls-mock {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ref-text-muted);
  font-size: 13px;
}

.win-control-btn {
  background: transparent;
  border: none;
  color: var(--ref-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1;
}

.win-control-btn:hover {
  color: var(--ref-text-primary);
}

/* Conversation Body & Canvas */
.conversation-body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  overflow: hidden !important;
}

.messages-container {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 24px 32px 140px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

/* Real-Time Live Telemetry Activity Indicator */
.thinking-live-indicator {
  display: inline-flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 6px 0 12px !important;
  padding: 8px 14px !important;
  background-color: #141418 !important;
  border: 1px solid #27272a !important;
  border-radius: 12px !important;
  color: #a1a1aa !important;
  font-size: 13px !important;
  font-family: inherit !important;
  width: fit-content !important;
  max-width: 100% !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.2s ease !important;
}

.thinking-live-indicator::before {
  display: none !important;
}

.telemetry-status-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.telemetry-pulse-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background-color: #60a5fa !important;
  box-shadow: 0 0 8px #3b82f6 !important;
  animation: telemetryPulse 1.4s infinite ease-in-out !important;
  flex-shrink: 0 !important;
}

.telemetry-stage-icon {
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.telemetry-stage-text {
  color: #f4f4f5 !important;
  font-weight: 500 !important;
}

.telemetry-timer {
  color: #71717a !important;
  font-size: 11.5px !important;
  font-variant-numeric: tabular-nums !important;
  margin-left: 4px !important;
}

.telemetry-details-disclosure {
  border-top: 1px solid #222226 !important;
  padding-top: 6px !important;
  margin-top: 2px !important;
}

.telemetry-details-disclosure summary {
  font-size: 11px !important;
  color: #71717a !important;
  cursor: pointer !important;
  user-select: none !important;
  outline: none !important;
}

.telemetry-details-disclosure summary:hover {
  color: #a1a1aa !important;
}

.telemetry-steps-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin-top: 6px !important;
  font-size: 11.5px !important;
  font-family: monospace !important;
}

.telemetry-step-item {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #71717a !important;
}

.telemetry-step-item.is-done {
  color: #10b981 !important;
}

.telemetry-step-item.is-active {
  color: #60a5fa !important;
  font-weight: 600 !important;
}

@keyframes telemetryPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* User Message Bubble */
.message-row-user {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.message-bubble-user {
  background-color: #27272a;
  color: #ffffff;
  border-radius: 18px;
  padding: 10px 18px;
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 70%;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Agent / Deliberation / Error Card */
.message-row-agent {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.deliberation-card {
  width: 100%;
  max-width: 85%;
  background-color: var(--ref-bg-card);
  border: 1px solid var(--ref-border-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

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

.card-status-icon-error {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--ref-red-alert);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.card-status-icon-agent {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #3b82f6;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.card-status-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ref-text-primary);
}

.card-details-disclosure {
  border-top: 1px solid var(--ref-border);
  padding-top: 8px;
  margin-top: 4px;
}

.card-details-disclosure summary {
  font-size: 12px;
  color: var(--ref-text-secondary);
  cursor: pointer;
  user-select: none;
  outline: none;
}

.card-details-disclosure summary:hover {
  color: var(--ref-text-primary);
}

.card-details-content {
  margin-top: 8px;
  padding: 10px;
  background-color: #121214;
  border: 1px solid var(--ref-border);
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  color: var(--ref-text-muted);
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Floating Prompt Input Box */
.chat-input-wrapper {
  position: absolute !important;
  bottom: 16px !important;
  left: 0 !important;
  right: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  pointer-events: none !important;
  z-index: 30 !important;
  padding: 0 20px !important;
}

.floating-composer-card {
  width: 100%;
  max-width: 820px;
  background-color: var(--ref-bg-card);
  border: 1px solid var(--ref-border-composer);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto !important;
}

.floating-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ref-text-primary);
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  min-height: 38px;
  max-height: 160px;
  font-family: inherit;
}

.floating-textarea::placeholder {
  color: var(--ref-text-muted);
}

.floating-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.controls-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-control-plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #222226;
  border: 1px solid var(--ref-border-composer);
  color: var(--ref-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-control-plus:hover {
  background-color: #2a2a30;
  color: var(--ref-text-primary);
}

.btn-control-plus svg {
  width: 14px;
  height: 14px;
}

/* Segmented Thinking Level Selector (Low / Med / High) */
.thinking-level-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #1a1a1e;
  border: 1px solid #2a2a30;
  border-radius: 20px;
  padding: 3px 6px 3px 10px;
  user-select: none;
}

.thinking-selector-icon {
  font-size: 13px;
  line-height: 1;
}

.thinking-selector-label {
  font-size: 11.5px;
  font-weight: 500;
  color: #a1a1aa;
  letter-spacing: 0.02em;
}

.thinking-pill-group {
  display: inline-flex;
  align-items: center;
  background-color: #121215;
  border: 1px solid #222226;
  border-radius: 14px;
  padding: 2px;
  gap: 2px;
}

.thinking-level-btn {
  background: transparent;
  border: none;
  border-radius: 12px;
  color: #71717a;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.thinking-level-btn:hover {
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.05);
}

.thinking-level-btn.is-active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

.thinking-level-btn[data-level="high"].is-active {
  background: #7c3aed;
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.4);
}

.thinking-level-btn[data-level="low"].is-active {
  background: #059669;
  box-shadow: 0 1px 4px rgba(5, 150, 105, 0.4);
}

.btn-auto-review {
  display: none !important;
}

.persona-selector-pill {
  display: none !important;
}

.btn-control-plus {
  display: none !important;
}

.btn-voice-mic {
  display: none !important;
}

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

.btn-voice-mic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ref-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-voice-mic:hover {
  background-color: #222226;
  color: var(--ref-text-primary);
}

.btn-voice-mic svg {
  width: 16px;
  height: 16px;
}

.btn-send-airplane {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #ffffff;
  color: #09090b;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.15s;
}

.btn-send-airplane:hover:not(:disabled) {
  transform: scale(1.06);
}

.btn-send-airplane:disabled {
  background-color: #27272a;
  color: #71717a;
  cursor: not-allowed;
}

.btn-send-airplane svg {
  width: 15px;
  height: 15px;
}

/* Telemetry Footer Bar */
.telemetry-footer-bar {
  width: 100%;
  max-width: 820px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 0;
  font-size: 11px;
  color: var(--ref-text-muted);
  pointer-events: auto !important;
}

.telemetry-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-left svg {
  width: 13px;
  height: 13px;
}

.telemetry-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telemetry-cost {
  font-weight: 600;
  font-size: 12px;
  color: var(--ref-text-muted);
}

.telemetry-gauge {
  display: flex;
  align-items: center;
  gap: 5px;
}

.telemetry-ring {
  width: 14px;
  height: 14px;
  transform: rotate(-90deg);
}

.gauge-label {
  font-size: 11px;
  font-weight: 500;
}

/* Conference View Overhaul matching Reference Spec */
#conferenceView[hidden], [hidden] {
  display: none !important;
}

#conferenceView:not([hidden]) {
  display: flex !important;
  flex: 1 !important;
  flex-direction: column !important;
  height: 100% !important;
  background-color: var(--ref-bg-chat) !important;
  position: relative !important;
  overflow: hidden !important;
}

.conference-header {
  height: 50px !important;
  min-height: 50px !important;
  background-color: var(--ref-bg-chat) !important;
  border-bottom: 1px solid var(--ref-border) !important;
  padding: 0 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.conference-header h2 {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--ref-text-primary) !important;
  margin: 0 !important;
}

.conference-header p {
  display: none !important;
}

.conference-header-actions .btn-secondary {
  background: #222226 !important;
  border: 1px solid var(--ref-border-subtle) !important;
  color: var(--ref-text-secondary) !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
}

.conference-header-actions .btn-secondary:hover {
  background: #2a2a30 !important;
  color: var(--ref-text-primary) !important;
}

#conferenceRoster {
  padding: 8px 20px !important;
  background-color: var(--ref-bg-sidebar) !important;
  border-bottom: 1px solid var(--ref-border) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

#conferenceRoster span {
  background-color: #1f1f23 !important;
  border: 1px solid var(--ref-border-subtle) !important;
  border-radius: 12px !important;
  padding: 3px 10px !important;
  font-size: 11.5px !important;
  color: var(--ref-text-secondary) !important;
}

#conferenceTranscript {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 24px 32px 140px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  background-color: var(--ref-bg-chat) !important;
}

.conference-entry {
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 auto !important;
}

.conference-entry[data-kind="user"] {
  display: flex !important;
  justify-content: flex-end !important;
}

.conference-entry[data-kind="user"] > .message-content {
  background-color: #27272a !important;
  color: #ffffff !important;
  border-radius: 18px !important;
  padding: 10px 18px !important;
  font-size: 14.5px !important;
  max-width: 70% !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

.conference-entry:not([data-kind="user"]) {
  display: flex !important;
  flex-direction: column !important;
  background-color: var(--ref-bg-card) !important;
  border: 1px solid var(--ref-border-subtle) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
}

.conference-entry:not([data-kind="user"]) > header {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 10px !important;
}

.conference-entry:not([data-kind="user"]) > header strong {
  font-size: 14px !important;
  color: var(--ref-text-primary) !important;
}

.conference-composer {
  position: absolute !important;
  bottom: 16px !important;
  left: 0 !important;
  right: 0 !important;
  width: calc(100% - 40px) !important;
  max-width: 820px !important;
  margin: 0 auto !important;
  background-color: var(--ref-bg-card) !important;
  border: 1px solid var(--ref-border-composer) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
  padding: 12px 14px 10px !important;
  z-index: 30 !important;
}

.conference-composer label, #conferenceMentionHelp {
  display: none !important;
}

.conference-input-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.conference-input-row textarea {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--ref-text-primary) !important;
  font-size: 14.5px !important;
  resize: none !important;
  min-height: 38px !important;
}

#btnConferenceSend {
  background-color: #ffffff !important;
  color: #09090b !important;
  border: none !important;
  border-radius: 20px !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* Dialog and Modal Overhaul (Solid Opaque Surfaces & Clean Backdrops) */
dialog:not([open]) {
  display: none !important;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(4px) !important;
}

dialog#conferenceDialog[open] {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  margin: auto !important;
  background-color: #18181c !important;
  color: #f4f4f5 !important;
  border: 1px solid #2c2c32 !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95) !important;
  padding: 24px !important;
  width: 720px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 32px) !important;
  overflow-y: auto !important;
  z-index: 9999 !important;
}

#conferenceForm {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

dialog#conferenceDialog fieldset {
  background-color: #121214 !important;
  border: 1px solid #27272a !important;
  border-radius: 10px !important;
  padding: 16px !important;
}

dialog#conferenceDialog legend {
  color: #a1a1aa !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

dialog#conferenceDialog input[type="text"],
dialog#conferenceDialog input[list],
dialog#conferenceDialog select {
  background-color: #222226 !important;
  border: 1px solid #2f2f35 !important;
  border-radius: 8px !important;
  color: #f4f4f5 !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
}

dialog#conferenceDialog input[type="text"]:focus,
dialog#conferenceDialog input[list]:focus,
dialog#conferenceDialog select:focus {
  border-color: #60a5fa !important;
  outline: none !important;
}

.conference-dialog-actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  padding-top: 16px !important;
  border-top: 1px solid #27272a !important;
}

.conference-dialog-actions .btn-primary {
  background-color: #ffffff !important;
  color: #09090b !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.conference-dialog-actions .btn-secondary {
  background-color: #222226 !important;
  color: #f4f4f5 !important;
  border: 1px solid #2f2f35 !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  cursor: pointer !important;
}

/* Hide old redundant inputs and containers */
.input-box, .starter-prompts {
  display: none !important;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 550px) {
  #sidebar {
    display: none !important;
  }
  #sidebar.mobile-open {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 56px !important;
    width: 280px !important;
    z-index: 100 !important;
  }
  .chat-view {
    padding-bottom: 56px !important;
  }
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--ref-bg-sidebar);
    border-top: 1px solid var(--ref-border);
    justify-content: space-around;
    align-items: center;
    z-index: 90;
  }
  .nav-tab {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--ref-text-muted);
    font-size: 10.5px;
    cursor: pointer;
    transition: color 0.15s;
  }
  .nav-tab.active {
    color: var(--ref-blue-text);
  }
  .nav-tab svg {
    width: 18px;
    height: 18px;
  }
  .chat-input-wrapper, .conference-composer {
    bottom: 66px !important;
  }
  .window-controls-mock {
    display: none;
  }
}
