/* LeadSift — Layout (4-panel) */

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}

/* Main area */
.main-area {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Conversation list */
.conv-list {
  width: 360px;
  min-width: 360px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.conv-list-header {
  padding: 16px 16px 6px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.conv-items {
  flex: 1;
  overflow-y: auto;
}

/* Thread panel */
.conv-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
}
.thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Detail panel */
.detail-panel {
  width: 300px;
  min-width: 300px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Detail sections */
.detail-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.detail-section:last-child { border-bottom: none; }
.detail-spacer { flex: 1; min-height: 0; }
/* ===== Responsive ===== */

/* Compact: shrink panels to fit narrower screens */
@media (max-width: 1200px) {
  .sidebar { width: 180px; min-width: 180px; padding: 16px 8px; }
  .conv-list { width: 300px; min-width: 280px; }
  .detail-panel { width: 260px; min-width: 260px; }
}

/* Tablet: hide sidebar */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .detail-panel { width: 240px; min-width: 240px; }
}

/* Small tablet: hide detail panel */
@media (max-width: 700px) {
  .detail-panel { display: none; }
  .conv-list { width: 280px; min-width: 260px; }
}

/* Mobile: stack vertically */
@media (max-width: 500px) {
  #app { flex-direction: column; }
  .main-area { flex-direction: column; flex: 1; min-height: 0; }
  .conv-list {
    width: 100%; min-width: 0;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .conv-thread { flex: 1; min-height: 0; }
  .thread-messages { padding: 12px 16px; }
  .reply-compose-box { padding: 8px 12px 12px; }
  .ai-suggestion-banner { padding: 6px 12px; }
}
