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

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: #0c0e13;
  color: #e2e8f0;
  height: 100vh;
  overflow: hidden;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes blink  { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Shared Components ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #2a3040;
  background: #161a24;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn:hover           { background: #1e2435; color: #e2e8f0; }
.btn.primary         { background: #34d399; border-color: #34d399; color: #042f1e; font-weight: 600; }
.btn.primary:hover   { background: #2dd088; }
.btn.danger          { background: #ef4444; border-color: #ef4444; color: #fff; font-weight: 600; }
.btn.danger:hover    { background: #dc2626; }
.btn.icon            { padding: 6px 9px; }
.btn:disabled        { opacity: 0.4; cursor: not-allowed; }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.active { background: #ef4444; animation: pulse 1.5s infinite; }

.spinner {
  width: 13px; height: 13px;
  border: 2px solid #1e2330;
  border-top-color: #34d399;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  user-select: none;
}
.empty-icon  { font-size: 30px; }
.empty-label { font-size: 13px; line-height: 1.6; color: #334155; }

/* ── Top Bar ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #1e2330;
  background: #0c0e13;
  height: 49px;
}
.logo         { font-weight: 600; font-size: 15px; color: #fff; letter-spacing: -0.3px; }
.logo span    { color: #34d399; }
.topbar-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #475569; }
.topbar-error  { font-size: 11px; color: #f87171; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer        { flex: 1; }

/* ── Three-column Layout ─────────────────────────────────────── */
.layout {
  display: flex;
  height: calc(100vh - 49px);
  position: relative;
}
.col {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e2330;
  min-width: 0;
}
.col:last-child { border-right: none; }

.col-header {
  padding: 10px 14px;
  border-bottom: 1px solid #1e2330;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: 40px;
}
.col-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #475569;
}
.col-meta { font-size: 11px; color: #334155; }

.col-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.col-body::-webkit-scrollbar       { width: 4px; }
.col-body::-webkit-scrollbar-track { background: transparent; }
.col-body::-webkit-scrollbar-thumb { background: #1e2330; border-radius: 2px; }

/* ── Transcript ───────────────────────────────────────────────── */
.transcript-chunk {
  background: #111520;
  border: 1px solid #1e2330;
  border-radius: 8px;
  padding: 10px 12px;
}
.chunk-meta { font-size: 10px; color: #334155; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.chunk-text        { font-size: 13px; line-height: 1.65; color: #7c8fa5; }
.chunk-text.latest { color: #cbd5e1; }

/* ── Suggestions ─────────────────────────────────────────────── */
.batch          { display: flex; flex-direction: column; gap: 6px; }
.batch-label {
  font-size: 10px;
  color: #34d399;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.batch-label::after  { content: ''; flex: 1; height: 1px; background: #1e2330; }
.batch-label.old     { color: #334155; }
.generating-row      { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #475569; padding: 2px 0; }

.suggestion-card {
  background: #111520;
  border: 1px solid #1e2330;
  border-radius: 8px;
  padding: 11px 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.suggestion-card:hover  { background: #151c2a; border-color: #2a3550; transform: translateY(-1px); }
.suggestion-card:active { transform: translateY(0); }

.suggestion-type {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.type-ANSWER        { background: rgba(52,211,153,0.12); color: #34d399; }
.type-QUESTION      { background: rgba(96,165,250,0.12); color: #60a5fa; }
.type-TALKING_POINT { background: rgba(192,132,252,0.12); color: #c084fc; }
.type-FACT_CHECK    { background: rgba(251,146,60,0.12);  color: #fb923c; }
.type-CLARIFY       { background: rgba(34,211,238,0.12);  color: #22d3ee; }

.suggestion-title   { font-size: 13px; font-weight: 500; color: #e2e8f0; margin-bottom: 4px; line-height: 1.3; }
.suggestion-preview { font-size: 12px; color: #64748b; line-height: 1.55; }

/* ── Chat ─────────────────────────────────────────────────────── */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-body::-webkit-scrollbar       { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: #1e2330; border-radius: 2px; }

.chat-msg {
  max-width: 90%;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-msg.user      { align-self: flex-end; background: #1a2a4a; color: #93c5fd; border-radius: 10px 10px 3px 10px; }
.chat-msg.assistant { align-self: flex-start; background: #111520; border: 1px solid #1e2330; color: #cbd5e1; border-radius: 10px 10px 10px 3px; }
.chat-msg.streaming { border-color: #2a3550; }

.cursor { display: inline-block; width: 2px; height: 13px; background: #34d399; animation: blink 1s infinite; vertical-align: middle; margin-left: 2px; }

.chat-footer { padding: 10px 12px; border-top: 1px solid #1e2330; display: flex; gap: 8px; flex-shrink: 0; }
.chat-input {
  flex: 1;
  background: #111520;
  border: 1px solid #1e2330;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  color: #e2e8f0;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.chat-input::placeholder { color: #334155; }
.chat-input:focus        { border-color: #2a3550; }

.send-btn {
  padding: 8px 14px;
  background: #34d399;
  border: none;
  border-radius: 8px;
  color: #042f1e;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.send-btn:hover    { background: #2dd088; }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Settings Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: #111520;
  border: 1px solid #2a3040;
  border-radius: 14px;
  padding: 22px;
  width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-title   { font-size: 14px; font-weight: 600; color: #e2e8f0; }
.modal-section { display: flex; flex-direction: column; gap: 6px; }
.modal-label   { font-size: 10px; color: #475569; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.modal-row     { display: flex; gap: 10px; }
.modal-row .modal-section { flex: 1; }
.modal-footer  { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.modal-input, .modal-textarea {
  background: #0c0e13;
  border: 1px solid #1e2330;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #e2e8f0;
  outline: none;
  font-family: 'DM Mono', monospace;
  width: 100%;
  transition: border-color 0.15s;
}
.modal-textarea    { min-height: 100px; resize: vertical; line-height: 1.55; }
.modal-input:focus, .modal-textarea:focus { border-color: #34d399; }

/* ── API Key Screen ───────────────────────────────────────────── */
.api-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.api-card {
  background: #111520;
  border: 1px solid #1e2330;
  border-radius: 14px;
  padding: 32px;
  width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.api-logo    { font-size: 24px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.api-logo span { color: #34d399; }
.api-tagline { font-size: 13px; color: #475569; font-weight: 500; }
.api-desc    { font-size: 13px; color: #4b5a6e; line-height: 1.65; }
.api-hint    { font-size: 11px; color: #2d3748; text-align: center; }
.api-hint a  { color: #34d399; text-decoration: none; }

.api-input {
  background: #0c0e13;
  border: 1px solid #1e2330;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 13px;
  color: #e2e8f0;
  outline: none;
  width: 100%;
  font-family: 'DM Mono', monospace;
  transition: border-color 0.15s;
}
.api-input:focus { border-color: #34d399; }

.api-btn {
  background: #34d399;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #042f1e;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s;
}
.api-btn:hover { background: #2dd088; }
