/* ============================================
   Site Editor - Dark Theme Stylesheet
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-app:       #0d0d0d;
  --bg-sidebar:   #1a1a1a;
  --bg-chat:      #111111;
  --bg-panel:     #1e1e1e;
  --bg-input:     #252525;
  --bg-hover:     #252525;
  --bg-active:    #2a2a2a;
  --bg-user-msg:  #1e3a5f;
  --bg-asst-msg:  #1a1a1a;
  --bg-tool-pill: #2a2a2a;
  --text-primary: #e5e5e5;
  --text-muted:   #888888;
  --text-dim:     #555555;
  --border:       #6b7280;
  --border-dim:   #2a2a2a;
  --accent:       #3b82f6;
  --accent-hover: #2563eb;
  --accent-green: #22c55e;
  --accent-green-hover: #16a34a;
  --accent-red:   #ef4444;
  --radius:       8px;
  --radius-sm:    4px;
  --radius-lg:    12px;
  --shadow:       0 2px 8px rgba(0,0,0,0.4);
  --font:         system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
  --sidebar-w:    220px;
  --preview-w:    360px;
  --transition:   0.15s ease;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ============================================
   AUTH OVERLAY
   ============================================ */

#auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.auth-box {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 380px;
  text-align: center;
  box-shadow: var(--shadow);
}

.auth-box h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.auth-box p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 13px;
}

.auth-box label {
  display: block;
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-box input[type="text"],
.auth-box input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color var(--transition);
  font-family: var(--font-mono);
}

.auth-box input:focus {
  border-color: var(--accent);
}

.auth-error {
  color: var(--accent-red);
  font-size: 12px;
  margin-bottom: 12px;
  display: none;
}

.auth-box input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color var(--transition);
}

.auth-box input[type="email"]:focus {
  border-color: var(--accent);
}

.auth-sent-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.auth-sent-text {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-toggle {
  margin-top: 20px;
  text-align: center;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color var(--transition);
}

.btn-link:hover {
  color: var(--accent);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* Site picker */
#site-picker {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23888' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

#site-picker:focus {
  border-color: var(--accent);
}

#site-picker option {
  background: var(--bg-sidebar);
}

/* New conversation button */
.btn-new-conv {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 10px 16px 0;
  background: transparent;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  width: calc(100% - 32px);
}

.btn-new-conv:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-new-conv .plus-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

/* Conversation list */
.conv-list-label {
  padding: 14px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

#conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

#conversations-list::-webkit-scrollbar {
  width: 4px;
}

#conversations-list::-webkit-scrollbar-thumb {
  background: var(--border-dim);
  border-radius: 4px;
}

.conv-item {
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 2px;
}

.conv-item:hover {
  background: var(--bg-hover);
}

.conv-item.active {
  background: var(--bg-active);
}

.conv-item-title {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.conv-item-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.conv-item .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active   { background: var(--accent-green); }
.status-dot.merged   { background: var(--accent); }
.status-dot.closed   { background: var(--text-dim); }

.conv-list-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.btn-signout {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--transition);
}

.btn-signout:hover {
  color: var(--accent-red);
}

/* ============================================
   CENTER CHAT AREA
   ============================================ */

#chat-area {
  flex: 1;
  min-width: 0;
  background: var(--bg-chat);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat header */
#chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
}

.chat-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

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

/* No-site placeholder */
#no-site-msg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
  padding: 40px;
}

.no-site-inner h3 {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.no-site-inner p {
  font-size: 13px;
  color: var(--text-dim);
}

/* Messages area */
#messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#messages-area::-webkit-scrollbar {
  width: 6px;
}

#messages-area::-webkit-scrollbar-thumb {
  background: var(--border-dim);
  border-radius: 4px;
}

/* Empty conversation */
.messages-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 40px;
}

.messages-empty-inner h3 {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Message bubbles */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message.assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.message.user .message-bubble {
  background: var(--bg-user-msg);
  color: #c8dcf5;
  border-bottom-right-radius: var(--radius-sm);
}

.message.assistant .message-bubble {
  background: var(--bg-asst-msg);
  color: var(--text-primary);
  border: 1px solid var(--border-dim);
  border-bottom-left-radius: var(--radius-sm);
}

.message-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  padding: 0 4px;
}

/* Inline markdown rendering */
.message-bubble code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0,0,0,0.3);
  padding: 1px 5px;
  border-radius: 3px;
  color: #a5f3fc;
}

.message-bubble pre {
  background: #0a0a0a;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 8px 0;
}

.message-bubble pre code {
  background: none;
  padding: 0;
  font-size: 12px;
  color: #d1fae5;
}

.message-bubble strong, .message-bubble b {
  color: #f0f0f0;
  font-weight: 600;
}

.message-bubble em, .message-bubble i {
  color: #c0c0c0;
}

.message-bubble a {
  color: var(--accent);
  text-decoration: none;
}

.message-bubble a:hover {
  text-decoration: underline;
}

.message-bubble ul, .message-bubble ol {
  padding-left: 18px;
  margin: 4px 0;
}

.message-bubble li {
  margin-bottom: 2px;
}

.message-bubble h1, .message-bubble h2, .message-bubble h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 8px 0 4px;
}

/* Tool use indicators */
.tool-use-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-start;
  max-width: 80%;
}

.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-tool-pill);
  border: 1px solid var(--border-dim);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tool-pill .tool-spinner {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--text-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.tool-pill .tool-done {
  color: var(--accent-green);
  font-size: 10px;
}

.tool-pill .tool-error {
  color: var(--accent-red);
  font-size: 10px;
}

.tool-use-group.collapsing {
  overflow: hidden;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-asst-msg);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  align-self: flex-start;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Error message */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: #fca5a5;
  font-size: 13px;
  align-self: flex-start;
  max-width: 80%;
}

/* PR notification in chat */
.pr-card {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  align-self: flex-start;
  max-width: 80%;
}

.pr-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.pr-card a {
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}

.pr-card a:hover {
  text-decoration: underline;
}

/* Chat input */
#chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#message-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  resize: none;
  outline: none;
  min-height: 42px;
  max-height: 180px;
  line-height: 1.5;
  transition: border-color var(--transition);
  overflow-y: auto;
}

#message-input:focus {
  border-color: var(--accent);
}

#message-input::placeholder {
  color: var(--text-dim);
}

#message-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-send {
  padding: 10px 18px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-send:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

/* ============================================
   RIGHT PREVIEW PANEL
   ============================================ */

/* Resize handle between chat and preview */
.resize-handle {
  width: 6px;
  cursor: col-resize;
  background: var(--border-dim);
  transition: background 0.15s;
  flex-shrink: 0;
}

.resize-handle:hover,
.resize-handle.dragging {
  background: var(--accent);
}

#preview-panel {
  width: var(--preview-w);
  min-width: 200px;
  max-width: 80vw;
  background: var(--bg-panel);
  border-left: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
}

.preview-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* PR status badge */
.pr-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.pr-badge.none {
  background: rgba(107,114,128,0.15);
  color: var(--text-dim);
}

.pr-badge.open {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.pr-badge.merged {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
}

.pr-badge .pr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Preview iframe container */
.preview-iframe-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

#preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.preview-placeholder-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.preview-placeholder p {
  max-width: 200px;
  line-height: 1.5;
}

/* Preview footer */
.preview-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.preview-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  display: none;
}

.preview-url-link {
  flex: 1;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-url-link:hover {
  text-decoration: underline;
}

.btn-open-new {
  background: none;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 7px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
}

.btn-open-new:hover {
  border-color: var(--border);
  color: var(--text-primary);
}

/* Create PR button */
.btn-create-pr {
  width: 100%;
  padding: 10px;
  background: var(--accent-green);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  display: none;
  margin-bottom: 6px;
}

.btn-create-pr:hover:not(:disabled) {
  background: var(--accent-green-hover);
}

.btn-create-pr:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--text-dim);
}

.btn-create-pr.creating {
  background: var(--text-dim);
  cursor: wait;
}

.btn-update-preview {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  display: none;
}

.btn-update-preview:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-update-preview:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-update-preview.redeploying {
  background: var(--text-dim);
}

.merge-status {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  min-height: 18px;
}

.merge-status.success {
  color: var(--accent-green);
}

.merge-status.error {
  color: var(--accent-red);
}

/* ============================================
   BUTTONS (shared)
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  color: white;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  max-width: 300px;
}

.toast.success { background: #166534; border: 1px solid #16a34a; }
.toast.error   { background: #7f1d1d; border: 1px solid #ef4444; }
.toast.info    { background: #1e3a8a; border: 1px solid #3b82f6; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1000px) {
  #preview-panel {
    display: none;
  }
}

@media (max-width: 640px) {
  #sidebar {
    width: 180px;
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  #sidebar {
    display: none;
  }
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* Disabled/dimmed state for chat when no conversation */
.chat-disabled #message-input,
.chat-disabled #btn-send {
  opacity: 0.4;
  pointer-events: none;
}

/* Site info below picker */
.site-info {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 0;
}
.site-info a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-info a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Mini PR badge in conversation list */
.conv-item-pr {
  margin-top: 3px;
}
.pr-badge-mini {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.pr-badge-mini.open {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.pr-badge-mini.merged {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* Production URL link in merge status */
.merge-status a {
  color: var(--accent-green);
  text-decoration: underline;
  word-break: break-all;
}
.merge-status a:hover {
  color: var(--accent);
}

/* ============================================
   CONVERSATION FILTER TABS
   ============================================ */

.conv-filter-tabs {
  display: flex;
  padding: 10px 16px 0;
  gap: 2px;
  flex-shrink: 0;
}

.conv-filter-tab {
  flex: 1;
  padding: 6px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.conv-filter-tab:hover {
  color: var(--text-muted);
}

.conv-filter-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* ============================================
   CONVERSATION CONTEXT MENU
   ============================================ */

.conv-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.conv-item-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.conv-item-menu {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.conv-item:hover .conv-item-menu {
  opacity: 1;
}

.conv-item-menu:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.conv-context-menu {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 140px;
  padding: 4px 0;
  z-index: 300;
}

.conv-context-item {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition);
}

.conv-context-item:hover {
  background: var(--bg-hover);
}

.conv-context-item.danger {
  color: var(--accent-red);
}

.conv-context-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   CONFIRM MODAL
   ============================================ */

.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
}

.confirm-modal-box {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 360px;
  box-shadow: var(--shadow);
}

.confirm-modal-box h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-modal-box p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.confirm-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* ============================================
   PR BADGE LINK
   ============================================ */

.pr-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--transition);
}

.pr-badge-link:hover {
  opacity: 0.8;
  text-decoration: none;
}

.pr-badge-link.open {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.pr-badge-link.merged {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.pr-badge-link.closed {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-dim);
}

.pr-badge-link .pr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* New status badges */
.status-dot.archived { background: #f59e0b; }
.pr-badge-mini.closed {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-dim);
}
.pr-badge-mini.archived {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
