/* ================================================================
   TOKENS
================================================================ */
:root{
  --accent-h: 195;
  --accent: oklch(0.66 0.14 var(--accent-h));
  --accent-soft: oklch(0.66 0.14 var(--accent-h) / 0.12);
  --accent-border: oklch(0.66 0.14 var(--accent-h) / 0.35);
  --accent-fg: oklch(0.98 0.02 var(--accent-h));
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  --shadow:    0 2px 6px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.10), 0 24px 48px rgba(0,0,0,.16);
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- DARK (default) ---------- */
html[data-theme="dark"]{
  --bg:           oklch(0.16 0.006 80);
  --bg-elev:      oklch(0.195 0.007 80);
  --bg-raised:    oklch(0.22 0.008 80);
  --bg-hover:     oklch(0.24 0.008 80);
  --panel:        oklch(0.185 0.006 80);
  --panel-border: oklch(0.28 0.008 80);
  --line:         oklch(0.27 0.008 80);
  --line-strong:  oklch(0.34 0.008 80);
  --fg:           oklch(0.97 0.005 80);
  --fg-muted:     oklch(0.74 0.01 80);
  --fg-dim:       oklch(0.56 0.01 80);
  --fg-faint:     oklch(0.42 0.01 80);
  --user-bubble:  oklch(0.24 0.008 80);
  --code-bg:      oklch(0.14 0.005 80);
  --shadow:    0 2px 6px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.35), 0 24px 48px rgba(0,0,0,.55);
  --scrim:     rgba(0,0,0,.55);
}

/* ---------- LIGHT ---------- */
html[data-theme="light"]{
  --bg:           oklch(0.985 0.003 80);
  --bg-elev:      oklch(1 0 0);
  --bg-raised:    oklch(0.97 0.004 80);
  --bg-hover:     oklch(0.95 0.005 80);
  --panel:        oklch(0.99 0.003 80);
  --panel-border: oklch(0.90 0.005 80);
  --line:         oklch(0.92 0.005 80);
  --line-strong:  oklch(0.85 0.006 80);
  --fg:           oklch(0.22 0.01 80);
  --fg-muted:     oklch(0.42 0.01 80);
  --fg-dim:       oklch(0.58 0.008 80);
  --fg-faint:     oklch(0.72 0.006 80);
  --user-bubble:  oklch(0.96 0.005 80);
  --code-bg:      oklch(0.96 0.005 80);
  --scrim:        rgba(20,20,15,.35);
}

html[data-density="compact"]{
  --pad-pane: 20px;
  --gap: 10px;
  --msg-gap: 16px;
  --row-h: 30px;
}
html[data-density="comfortable"]{
  --pad-pane: 28px;
  --gap: 14px;
  --msg-gap: 24px;
  --row-h: 36px;
}

/* ================================================================
   BASE
================================================================ */
*,*::before,*::after{ box-sizing: border-box; }
html,body{ height:100%; margin:0; }
body{
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button{ font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input,textarea,select{ font-family: inherit; color: inherit; }
textarea{ resize: vertical; }
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background: var(--line-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover{ background: var(--fg-faint); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track{ background: transparent; }

/* ================================================================
   ZOOM WRAPPER (app.js feature)
================================================================ */
.zoom-frame{ width:100%; height:100%; overflow:hidden; position:relative; }
.zoom-root{ transform-origin: top left; width:100%; height:100%; }

/* ================================================================
   APP SHELL
================================================================ */
.app{
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns .28s var(--ease);
}
.app[data-sidebar="collapsed"]{ grid-template-columns: 60px 1fr; }

/* ================================================================
   SIDEBAR
================================================================ */
.sidebar{
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.sidebar-top{
  padding: 14px 14px 10px;
  display: flex; align-items: center; gap: 10px;
  min-height: 54px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}
.brand{
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
.logo{
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), oklch(0.52 0.14 calc(var(--accent-h) - 10)));
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.15);
  flex-shrink: 0;
}
.brand-name{
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}
.brand-sub{
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  margin-top: 1px;
  text-transform: uppercase;
}
.brand-col{ display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }

.icon-btn{
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  color: var(--fg-muted);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.icon-btn:hover{ background: var(--bg-hover); color: var(--fg); }
.icon-btn svg{ width:16px; height:16px; }

.sidebar-scroll{
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
}

.new-chat-btn{
  width: 100%;
  height: 34px;
  min-height: 34px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.new-chat-btn svg{ width: 14px; height: 14px; flex-shrink: 0; }
.new-chat-btn > span{ flex-shrink: 0; }
.new-chat-btn:hover{ background: var(--bg-hover); border-color: var(--fg-faint); }
.new-chat-btn .kbd{ margin-left: auto; }

.kbd{
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.4;
}

.nav-group{ margin-top: 4px; }
.section-toggle{
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 6px;
  border-radius: 8px;
  color: var(--fg-muted);
  transition: background .12s, color .12s;
}
.section-toggle:hover{ background: var(--bg-hover); color: var(--fg); }
.section-toggle .nav-label{
  padding: 0;
  flex: 1;
  text-align: left;
}
.section-toggle-count{
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.4;
}
.section-toggle-chevron{
  width: 14px; height: 14px; flex-shrink: 0;
  transition: transform .18s ease;
}
.section-panel-body{
  overflow: hidden auto;
  max-height: 280px;
  transition: max-height .22s ease, opacity .18s ease, margin-top .18s ease;
  margin-top: 2px;
}
#conversation-panel[data-collapsed="true"] .section-panel-body{
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
}
#conversation-panel[data-collapsed="true"] .section-toggle-chevron{
  transform: rotate(-90deg);
}
.nav-label{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 10px 10px 4px;
  font-weight: 500;
}
.nav-item{
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px;
  height: 32px;
  min-height: 32px;
  border-radius: 7px;
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-item > span{ overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover{ background: var(--bg-hover); color: var(--fg); }
.nav-item.active{
  background: var(--bg-raised);
  color: var(--fg);
}
.nav-item.active::before{
  content:''; position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 2px; background: var(--accent); border-radius: 2px;
}
.nav-item svg{ width: 15px; height: 15px; flex-shrink: 0; }
.nav-item .count{
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}

.conv-list{
  display: flex; flex-direction: column; gap: 1px;
  margin-top: 2px;
}
.conv-item{
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--fg-muted);
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .12s;
  position: relative;
}
.conv-item:hover{ background: var(--bg-hover); color: var(--fg); }
.conv-item.active{ background: var(--accent-soft); color: var(--fg); }
.conv-item .conv-time{ color: var(--fg-dim); font-family: var(--font-mono); font-size: 10.5px; margin-right: 7px; }

/* App.js conversation list items */
.conversation-item{
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--fg-muted);
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .12s;
}
.conversation-item:hover{ background: var(--bg-hover); color: var(--fg); }
.conversation-item.active{ background: var(--accent-soft); color: var(--fg); }

/* Sidebar footer: user */
.sidebar-user{
  border-top: 1px solid var(--panel-border);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  min-height: 54px;
  flex-shrink: 0;
}
.avatar{
  width: 30px; height: 30px; border-radius: 50%;
  background: oklch(0.55 0.1 45);
  color: white; font-weight: 600; font-size: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.user-info{ min-width: 0; flex: 1; line-height: 1.2; }
.user-name{ font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role{ font-size: 11px; color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); }

/* Sidebar — collapsed */
.app[data-sidebar="collapsed"] .sidebar-scroll{ padding: 12px 6px; align-items: center; }
.app[data-sidebar="collapsed"] .nav-item{ justify-content: center; padding: 0; width: 36px; height: 36px; gap: 0; }
.app[data-sidebar="collapsed"] .nav-item span{ display: none; }
.app[data-sidebar="collapsed"] .nav-item .count{ display: none; }
.app[data-sidebar="collapsed"] .nav-item.active::before{ left: -6px; }
.app[data-sidebar="collapsed"] .nav-label{ display:none; }
.app[data-sidebar="collapsed"] .new-chat-btn{ width: 36px; padding: 0; justify-content: center; }
.app[data-sidebar="collapsed"] .new-chat-btn span, .app[data-sidebar="collapsed"] .new-chat-btn .kbd{ display: none; }
.app[data-sidebar="collapsed"] .brand-col, .app[data-sidebar="collapsed"] #sidebar-collapse{ display:none; }
.app[data-sidebar="collapsed"] .conv-group{ display: none; }
.app[data-sidebar="collapsed"] .sidebar-user{ justify-content: center; padding: 10px 0; }
.app[data-sidebar="collapsed"] .user-info{ display: none; }
.app[data-sidebar="collapsed"] .sidebar-user .icon-btn{ display: none; }
.app[data-sidebar="collapsed"] .auth-form,
.app[data-sidebar="collapsed"] .auth-eyebrow,
.app[data-sidebar="collapsed"] .auth-hint,
.app[data-sidebar="collapsed"] .sidebar-status-row{ display:none; }

/* ================================================================
   AUTH PANEL
================================================================ */
.auth-eyebrow{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 8px 10px 6px;
}
.auth-form{
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 6px 6px;
}
.auth-hint{
  font-size: 11.5px;
  color: var(--fg-dim);
  padding: 4px 10px 6px;
  margin: 0;
  font-family: var(--font-mono);
  min-height: 20px;
}
.auth-hint.error{ color: oklch(0.65 0.16 25); }

.sidebar-status-row{
  padding: 4px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-status-row span{
  font-size: 11px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}

/* mode-panel stub is hidden — mode cards live in the chat welcome area */
#mode-panel{ display: none !important; }

/* Mode cards grid (inside #workflow-panel in chat area) */
.modes{
  max-width: 760px;
  margin: 0 auto 20px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.modes .mode-button{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all .15s var(--ease);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: -0.005em;
  position: relative;
  overflow: hidden;
  min-height: 60px;
  display: flex; align-items: center;
}
.modes .mode-button:hover{
  border-color: var(--line-strong);
  background: var(--bg-elev);
  color: var(--fg);
  transform: translateY(-1px);
}
.modes .mode-button.active{
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--fg);
}
.modes .mode-button.active::after{
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--accent-border);
  border-radius: inherit;
}

/* integration items */
.integration-item{
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}
.integration-item.connected{ color: var(--fg); }

/* ================================================================
   MAIN
================================================================ */
.main{
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}

.topbar{
  height: 54px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--bg);
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.topbar-title{
  font-size: 13.5px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}
.topbar-crumb{ color: var(--fg-dim); font-weight: 400; }
.topbar-crumb-sep{ color: var(--fg-faint); flex-shrink: 0; }
#conversation-title{
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; white-space: nowrap;
}
.topbar-spacer{ flex: 1; min-width: 8px; }

.pill{
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 11.5px;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.pill .dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(0.65 0.15 155);
}

.topbar-actions{ display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.topbar-actions .icon-btn{ width: 30px; height: 30px; }

.search-btn{
  display: flex; align-items: center; gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg-dim);
  font-size: 12.5px;
  min-width: 160px;
  flex-shrink: 0;
}
.search-btn:hover{ background: var(--bg-hover); color: var(--fg-muted); }
.search-btn svg{ width: 13px; height: 13px; flex-shrink: 0; }
.search-btn .kbd{ margin-left: auto; }

/* Zoom controls — hidden to match design (functionality preserved via app.js) */
.zoom-controls{
  display: none;
  align-items: center; gap: 3px;
  flex-shrink: 0;
}
.zoom-button{
  height: 24px;
  width: 24px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg-muted);
  font-size: 14px;
  display: grid; place-items: center;
  transition: background .12s, color .12s;
}
.zoom-button:hover{ background: var(--bg-hover); color: var(--fg); }
.zoom-slider{ width: 56px; accent-color: var(--accent); cursor: pointer; }
.zoom-reset-button{
  height: 24px;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  transition: background .12s, color .12s;
}
.zoom-reset-button:hover{ background: var(--bg-hover); color: var(--fg); }

/* ================================================================
   CHAT PANE
================================================================ */
.pane{ flex: 1; overflow: hidden; display: flex; }
.chat-wrap{
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

/* chat-log: the main scrollable message container (app.js appends here) */
#chat-log{
  overflow-y: auto;
  padding: 32px 0 40px;
  scroll-behavior: smooth;
  position: relative;
}

/* Welcome block */
.welcome{
  margin: 40px auto 28px;
  text-align: center;
  max-width: 720px;
  padding: 0 32px;
}
.welcome-eyebrow{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.welcome h1{
  font-size: 30px;
  letter-spacing: -0.022em;
  font-weight: 500;
  margin: 0 0 8px;
  line-height: 1.15;
}
.welcome h1 em{
  font-style: normal;
  color: var(--fg-muted);
}
.welcome p{
  color: var(--fg-muted);
  font-size: 14px;
  margin: 0;
}

/* Workflow panel — wraps welcome + mode cards + suggestions */
#workflow-panel{
  padding: 0;
  display: flex;
  flex-direction: column;
}
#workflow-panel.hidden{ display: none !important; }

/* Prompt suggestions section */
.prompt-suggestions{
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.suggest-label{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 8px 4px 8px;
}

/* Prompt chips — styled as suggestion cards (app.js creates these) */
.prompt-chip{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  width: 100%;
  background: transparent;
}
.prompt-chip:hover{
  background: var(--bg-elev);
  border-color: var(--panel-border);
}
.prompt-chip strong{
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  display: block;
  margin-bottom: 2px;
}
.prompt-chip span{
  font-size: 12px;
  color: var(--fg-dim);
  display: block;
}

/* drop overlay */
.drop-overlay{
  position: absolute; inset: 0;
  background: var(--scrim);
  z-index: 20;
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
  border: 2px dashed var(--accent-border);
  border-radius: var(--radius-lg);
  margin: 16px;
  pointer-events: none;
}
.drop-overlay.active{ pointer-events: all; }
.drop-overlay.hidden{ display: none !important; }
.drop-inner{ text-align: center; color: var(--fg-muted); }
.drop-icon{ font-size: 32px; display: block; margin-bottom: 8px; color: var(--accent); }

/* ── App.js message structure ── */
.message{
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  align-items: flex-start;
  max-width: 760px;
  margin: 0 auto var(--msg-gap);
  padding: 0 32px;
  width: 100%;
}
.message-avatar{
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}
.message.assistant .message-avatar{
  background: linear-gradient(140deg, var(--accent), oklch(0.52 0.14 calc(var(--accent-h) - 10)));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.message.user .message-avatar{
  background: oklch(0.55 0.1 45);
}
.message-shell{ min-width: 0; }
.message-label{
  font-weight: 500;
  font-size: 13.5px;
  margin: 0 0 4px;
  display: flex; align-items: baseline; gap: 8px;
  color: var(--fg);
}
.message-label .msg-time{
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  font-weight: 400;
}
.message-body{
  font-size: 14px;
  line-height: 1.62;
  color: var(--fg);
}
.message-body.markdown p{ margin: 0 0 8px; }
.message-body.markdown p:last-child{ margin-bottom: 0; }
.message-body.markdown strong{ font-weight: 600; }
.message-body.markdown ul,
.message-body.markdown ol{ margin: 6px 0 8px; padding-left: 20px; }
.message-body.markdown li{ margin-bottom: 3px; }
.message-body.markdown code{
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.message-body.markdown a{ color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-border); }
.message-body.markdown pre{
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  overflow-x: auto;
  margin: 8px 0;
}
.message-body.markdown pre code{ background: none; border: none; padding: 0; font-size: 12.5px; }
.message-body.markdown h1,.message-body.markdown h2,.message-body.markdown h3{
  font-weight: 600; margin: 12px 0 6px; letter-spacing: -0.01em;
}

/* Response card (artifact shown inside message) */
.response-card{
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.response-card.hidden{ display: none !important; }
.response-card-head{
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev);
}
.response-card-title{ font-size: 13px; font-weight: 500; flex: 1; }
.response-card-body{
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  white-space: pre-wrap;
}

/* streaming cursor */
@keyframes blink{ 0%,100%{opacity:1} 50%{opacity:0} }
.streaming-cursor::after{
  content: '▋';
  animation: blink 0.8s step-start infinite;
  color: var(--accent);
  font-size: 12px;
  margin-left: 2px;
}

/* typing indicator */
.typing{
  display: inline-flex; gap: 4px; align-items: center; padding: 8px 0;
}
.typing span{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-dim);
  animation: bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2){ animation-delay: .15s; }
.typing span:nth-child(3){ animation-delay: .3s; }
@keyframes bounce{ 0%,80%,100%{transform: translateY(0); opacity:.4;} 40%{transform: translateY(-4px); opacity:1;} }

/* chat hint */
#chat-hint{
  text-align: center;
  font-size: 12px;
  color: var(--fg-dim);
  padding: 4px 32px;
  margin: 0;
  font-family: var(--font-mono);
}

/* notes rail */
.notes-rail{
  width: 280px;
  border-left: 1px solid var(--panel-border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 14px;
  gap: 12px;
  flex-shrink: 0;
}
.notes-rail.hidden{ display: none !important; }
.note-form{ display: flex; flex-direction: column; gap: 8px; }
.note-item{
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  font-size: 12.5px;
}
.note-item:hover{ background: var(--bg-hover); }
.note-item.selected{ border-color: var(--accent-border); background: var(--accent-soft); }
.note-item-title{ font-weight: 500; margin-bottom: 3px; color: var(--fg); }
.note-item-body{ color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }

/* ================================================================
   COMPOSER
================================================================ */
.composer-wrap{
  padding: 0 32px 24px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  position: relative;
}
.composer{
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  transition: border-color .15s, box-shadow .15s;
  overflow: hidden;
}
.composer:focus-within{
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* context area (collapsible) */
#context-area{
  padding: 0 12px;
  overflow: hidden;
  max-height: 0;
  transition: max-height .2s var(--ease), padding .2s;
}
#context-area.open{
  max-height: 140px;
  padding-top: 10px;
}
#context-input{
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
  outline: none;
  min-height: 60px;
  max-height: 120px;
  resize: none;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}
#context-input::placeholder{ color: var(--fg-dim); }
#context-input:disabled{ opacity: 0.4; }

#chat-input{
  width: 100%;
  padding: 14px 16px 8px;
  border: none;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg);
  outline: none;
  min-height: 52px;
  max-height: 220px;
  resize: none;
  display: block;
}
#chat-input::placeholder{ color: var(--fg-dim); }
#chat-input:disabled{ opacity: 0.4; cursor: not-allowed; }

.composer-foot{
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid transparent;
}
.composer-foot .sp{ flex: 1; }

.chip-btn{
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}
.chip-btn:hover{ background: var(--bg-hover); color: var(--fg); }
.chip-btn svg{ width: 13px; height: 13px; }
.chip-btn.mode{ background: var(--accent-soft); border-color: var(--accent-border); color: var(--fg); }
.chip-btn.mode svg{ color: var(--accent); }

/* active-mode-chip — app.js sets textContent on this; keep it minimal */
#active-mode-chip{
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--accent-border);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
#active-mode-chip:hover{ filter: brightness(1.06); }

#selected-notes-indicator{
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
  padding: 0 8px;
}
#selected-notes-indicator.hidden{ display: none !important; }

.send-btn{
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 500;
  font-size: 12.5px;
  transition: filter .15s, transform .05s;
  letter-spacing: -0.005em;
  border: none;
}
.send-btn:hover:not(:disabled){ filter: brightness(1.06); }
.send-btn:active:not(:disabled){ transform: scale(.98); }
.send-btn svg{ width: 13px; height: 13px; }
.send-btn:disabled{ opacity: .4; cursor: not-allowed; }

.composer-hint{
  max-width: 760px;
  margin: 8px auto 0;
  font-size: 11px;
  color: var(--fg-dim);
  text-align: center;
  font-family: var(--font-mono);
}
.composer-hint a{ color: var(--fg-muted); cursor: pointer; text-decoration: none; }
.composer-hint a:hover{ color: var(--fg); }

/* file upload button inside composer-foot */
.upload-chip{
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}
.upload-chip:hover{ background: var(--bg-hover); color: var(--fg); }
.upload-chip svg{ width: 13px; height: 13px; }

/* batch limit pill */
#batch-limit-pill{
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
}
#batch-limit-pill.visible{ display: inline-flex; }

/* ================================================================
   FORM ELEMENTS (shared across panes)
================================================================ */
.input{
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--fg);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  display: block;
}
.input:focus{
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled{ opacity: 0.4; cursor: not-allowed; }
.input::placeholder{ color: var(--fg-dim); }

.textarea{
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--fg);
  outline: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  transition: border-color .12s, box-shadow .12s;
  display: block;
}
.textarea:focus{
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea:disabled{ opacity: 0.4; cursor: not-allowed; }
.textarea::placeholder{ color: var(--fg-dim); }

.select{
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--fg);
  outline: none;
  transition: border-color .12s;
}
.select:focus{ border-color: var(--accent-border); }

.btn{
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--fg);
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover{ background: var(--bg-hover); }
.btn.primary{ background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.btn.primary:hover{ filter: brightness(1.06); }
.btn.ghost{ border-color: transparent; background: transparent; color: var(--fg-muted); }
.btn.ghost:hover{ background: var(--bg-hover); color: var(--fg); }
.btn:disabled{ opacity: 0.4; cursor: not-allowed; }
.btn svg{ width: 13px; height: 13px; }

.form-row{ display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row:last-child{ margin-bottom: 0; }
.form-row label{
  font-size: 11.5px;
  color: var(--fg-muted);
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-title{
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.count-tag{
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 400;
}
.helper-text{
  font-size: 12px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  margin: 6px 0 0;
  min-height: 18px;
}
.helper-text.error{ color: oklch(0.65 0.16 25); }
.helper-text.success{ color: oklch(0.65 0.15 155); }

/* ================================================================
   NON-CHAT PANES
================================================================ */
.pane-mock{
  flex: 1;
  overflow: auto;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(circle at top right, oklch(0.78 0.07 var(--accent-h) / .08), transparent 28%),
    linear-gradient(180deg, color-mix(in oklch, var(--bg) 92%, white 8%), var(--bg));
}
.pane-header{
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 0;
  flex-shrink: 0;
  gap: 12px;
}
.pane-title-h{
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.018em;
  margin: 0;
}
.pane-sub{
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 4px;
}
.pane-actions{ display: flex; gap: 8px; flex-shrink: 0; }
.overview-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex-shrink: 0;
}
.overview-card{
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, color-mix(in oklch, var(--panel) 88%, white 12%), var(--panel));
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 92px;
}
.overview-label{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.overview-value{
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--fg);
}
.overview-meta{
  font-size: 11.5px;
  color: var(--fg-muted);
}
.pane-card{
  padding: 18px;
}

/* ── EMAIL STUDIO ── */
.email-grid{
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.email-compose{ display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding-bottom: 20px; }
.email-sidebar-col{ display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding-bottom: 20px; }

.deliv-score{
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--bg-elev);
  border-radius: 10px;
  margin-bottom: 14px;
}
.deliv-ring{
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.deliv-ring-inner{
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--panel);
  display: grid; place-items: center;
  font-weight: 600; font-size: 14px;
}
.deliv-label{ font-weight: 500; font-size: 13px; }
.deliv-sub{ font-size: 11.5px; color: var(--fg-dim); margin-top: 2px; }
.check-list{ display: flex; flex-direction: column; gap: 8px; }
.check-row{
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; padding: 6px 0;
}
.check-row svg{ width: 14px; height: 14px; flex-shrink: 0; }
.check-row.ok svg{ color: oklch(0.65 0.15 155); }
.check-row.warn svg{ color: oklch(0.76 0.14 75); }
.check-label{ flex: 1; color: var(--fg-muted); }
.check-val{ color: var(--fg-dim); font-family: var(--font-mono); font-size: 11.5px; }
.send-chart{ display: flex; align-items: flex-end; gap: 3px; height: 60px; padding: 6px 0; }
.send-chart .bar{ flex:1; background: var(--accent); border-radius:2px; min-height:4px; opacity:.85; }
.send-chart .bar.muted{ background: var(--line-strong); opacity:1; }

.template-card{
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--fg-muted);
  transition: background .12s, border-color .12s;
  margin-bottom: 4px;
}
.template-card:hover{ background: var(--bg-hover); color: var(--fg); }
.template-card.selected{ border-color: var(--accent-border); background: var(--accent-soft); color: var(--fg); }
.template-card-name{ font-weight: 500; }
.template-card-cat{ font-size: 11px; color: var(--fg-dim); font-family: var(--font-mono); margin-top: 1px; }

.tips-list{ display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.tip-item{
  padding: 8px 12px;
  border-radius: 8px;
  background: oklch(0.76 0.14 75 / 0.08);
  border: 1px solid oklch(0.76 0.14 75 / 0.25);
  font-size: 12.5px; color: var(--fg-muted);
}

.suppression-preview{ margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.supp-item{
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--bg-elev);
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--fg-muted);
}

.history-item{
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 6px;
  font-size: 12.5px; color: var(--fg-muted);
}
.history-item-title{ font-weight: 500; color: var(--fg); margin-bottom: 3px; }

.doc-item{
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  margin-bottom: 6px; font-size: 12.5px;
}
.doc-item-name{ font-weight: 500; }
.doc-item-meta{ font-size: 11px; color: var(--fg-dim); font-family: var(--font-mono); margin-top: 2px; }

/* ── PIPELINE ── */
.pipeline-layout,
.pipeline-workspace{
  display: grid;
  grid-template-columns: 260px minmax(0, 1.45fr) 380px;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.pipeline-sidebar{
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.pipeline-sidebar-header{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-shrink: 0;
}
#req-list{ overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.req-item{
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .12s, border-color .12s;
  text-align: left;
}
.req-item:hover{ background: var(--bg-elev); }
.req-item.active{ background: var(--accent-soft); border-color: var(--accent-border); }
.req-title,
.req-item-title{ display:block; font-size: 13px; font-weight: 500; margin-bottom: 2px; color: var(--fg); }
.req-client,
.req-item-client{ display:block; font-size: 11.5px; color: var(--fg-dim); }
.req-item-meta{ display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.req-badge{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 3px 7px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 10.5px; color: var(--fg-muted);
  font-family: var(--font-mono);
}
.req-badge.open{ border-color: oklch(0.70 0.14 150 / .35); color: oklch(0.70 0.14 150); }
.req-badge.filled{ border-color: oklch(0.72 0.15 80 / .35); color: oklch(0.72 0.15 80); }

.pipeline-main{ overflow: hidden; flex: 1; display: flex; flex-direction: column; }
.pipeline-board-wrap{
  display:flex;
  flex-direction:column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}
.pipeline-command-card{ padding: 16px; flex-shrink: 0; }
.pipeline-command-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap: 16px; margin-bottom: 14px;
}
.pipeline-command-title{ font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.pipeline-command-sub{ font-size: 12.5px; color: var(--fg-muted); margin-top: 4px; }
.pipeline-command-actions{ display:flex; flex-wrap:wrap; gap: 8px; justify-content:flex-end; }
.pipeline-requirements{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.kanban-scroll{ overflow-x: auto; overflow-y: auto; flex: 1; padding-bottom: 12px; }
.kanban,
.kanban-board{ display: flex; gap: 14px; height: 100%; min-width: max-content; }
.column,
.kanban-col{
  width: 240px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.col-head,
.kanban-col-header{
  padding: 12px 14px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--panel-border); flex-shrink: 0;
}
.kanban-col-label,
.col-title{ font-size: 12.5px; font-weight: 500; }
.kanban-col-count,
.col-count{ margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fg-dim); }
.col-body,
.kanban-cards{ padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 90px; }
.cand-card,
.kanban-card{
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px;
  transition: border-color .12s;
  text-align: left;
}
.cand-card:hover,
.kanban-card:hover{ border-color: var(--line-strong); }
.kanban-card.selected{ border-color: var(--accent-border); background: var(--accent-soft); }
.cand-name,
.kanban-card-name{ display:block; font-size: 13px; font-weight: 500; margin-bottom: 2px; color: var(--fg); }
.cand-role,
.kanban-card-email{ display:block; font-size: 11.5px; color: var(--fg-dim); margin-bottom: 6px; }
.kanban-card-source{
  display:inline-flex; align-items:center;
  padding: 2px 6px; border-radius: 999px;
  background: var(--bg-raised); border: 1px solid var(--line);
  font-size: 10px; color: var(--fg-muted); font-family: var(--font-mono);
}
.cand-tags{ display: flex; flex-wrap: wrap; gap: 4px; }
.cand-tag{
  font-family: var(--font-mono); font-size: 10px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; color: var(--fg-muted);
}
.cand-foot{
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-dim);
}
.pipeline-empty{
  flex: 1; display: grid; place-items: center;
  color: var(--fg-dim); font-size: 14px;
}
.pipeline-empty-inner{ text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pipeline-side-panel{
  display:flex;
  flex-direction:column;
  gap: 14px;
  overflow-y: auto;
  padding-bottom: 10px;
}
.candidate-workspace,
.pipeline-inline-card,
.pipeline-side-fallback{ padding: 16px; }
.candidate-workspace-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap: 12px; margin-bottom: 12px;
}
.candidate-workspace-title{ font-size: 16px; font-weight: 600; }
.candidate-workspace-sub{ font-size: 12px; color: var(--fg-muted); margin-top: 3px; }
.candidate-badges{
  display:flex; flex-wrap:wrap; gap: 8px;
  margin-bottom: 12px;
}
.candidate-primary-actions{
  display:grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.stack-form{ display:flex; flex-direction:column; gap: 10px; }
.inline-grid{ display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.pipeline-feed{
  display:flex; flex-direction:column; gap: 8px;
  margin-top: 12px;
}
.pipeline-feed.compact{ margin-top: 0; }
.history-split{
  display:grid;
  gap: 12px;
}
.event-item{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.event-item-type{
  display:inline-flex; margin-bottom: 6px;
  font-size: 10.5px; font-family: var(--font-mono); color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: .04em;
}
.event-item-title{ margin: 0 0 4px; font-weight: 500; color: var(--fg); }
.event-item-notes{ margin: 0 0 4px; font-size: 12px; color: var(--fg-muted); }
.event-item-time{ margin: 0; font-size: 11px; color: var(--fg-dim); }
.doc-output{
  margin: 0 0 12px;
  white-space: pre-wrap;
  max-height: 360px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}

/* ── CONTACTS ── */
.contacts-layout{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  flex: 1;
  min-height: 0;
}
.contacts-main-col,
.contacts-side-col{
  display:flex;
  flex-direction:column;
  gap: 14px;
  min-height: 0;
}
.contacts-search-bar{
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
  margin-bottom: 16px;
}
.contacts-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  overflow-y: auto;
}
.person-card,
.contact-card{
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.person-head,
.contact-card-header{ display: flex; align-items: center; gap: 10px; }
.person-avatar,
.contact-avatar{
  width: 36px; height: 36px; border-radius: 50%;
  background: oklch(0.45 0.04 260);
  display: grid; place-items: center;
  font-weight: 600; color: white; font-size: 12px; flex-shrink: 0;
}
.person-name,
.contact-name{ font-size: 13.5px; font-weight: 500; color: var(--fg); }
.person-title,
.contact-title{ font-size: 11.5px; color: var(--fg-dim); }
.person-row{ display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-muted); }
.person-row svg{ width: 12px; height: 12px; color: var(--fg-dim); }
.person-actions,
.contact-actions{
  display: flex; gap: 4px;
  margin-top: 4px; padding-top: 10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.contact-meta{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-muted);
}
.contact-linkedin{ color: var(--accent); text-decoration: none; }
.contact-linkedin:hover{ text-decoration: underline; }
.ev-result,
.enrich-card{
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 12px;
  color: var(--fg-muted);
}
.ev-result--ok{ border-color: oklch(0.70 0.14 150 / .35); }
.ev-result--bad{ border-color: oklch(0.65 0.18 25 / .35); }
.enrich-name{ font-size: 14px; font-weight: 600; color: var(--fg); }
.enrich-desc{ margin-top: 4px; margin-bottom: 8px; font-size: 12px; color: var(--fg-muted); }
.enrich-meta-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}
.enrich-label{
  display:block;
  margin-bottom: 2px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--fg-dim);
  text-transform: uppercase;
}
.enrich-tech{ margin-top: 10px; display:flex; flex-wrap:wrap; gap: 6px; }

.company-result-item,
.reply-item,
.action-item-card,
.guardrail-card{
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  margin-top: 10px;
}
.history-head,
.guardrail-summary-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.guardrail-list,
.guardrail-recs{
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--fg-muted);
  font-size: 12px;
}
.action-item-card strong{ display:block; margin-bottom: 4px; color: var(--fg); }
.action-item-card p{ margin: 0 0 8px; font-size: 12px; color: var(--fg-muted); }
.action-item-card .helper-text{ margin: 0; }
.ops-checklist{
  display:grid;
  gap: 10px;
}
.ops-check{
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.ops-check strong{
  display:block;
  margin-bottom: 3px;
  font-size: 12.5px;
  color: var(--fg);
}
.ops-check span{
  display:block;
  font-size: 12px;
  color: var(--fg-muted);
}

/* ── KNOWLEDGE ── */
.knowledge-layout{
  display:grid;
  grid-template-columns: minmax(0, 1.4fr) 360px;
  gap: 20px;
  flex: 1;
  min-height: 0;
}
.knowledge-main-col,
.knowledge-side-col{
  display:flex;
  flex-direction:column;
  gap: 14px;
  min-height: 0;
}
.knowledge-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.integration-grid{
  display: grid;
  gap: 10px;
}
.integration-surface-item{
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.integration-surface-item.live{
  border-color: var(--accent-border);
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent-soft) 55%, var(--bg-elev) 45%), var(--bg-elev));
}
.integration-surface-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.integration-surface-item strong{
  font-size: 12.5px;
  color: var(--fg);
}
.integration-surface-item p{
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--fg-muted);
}
.integration-surface-item small{
  display:block;
  font-size: 11px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}

/* ================================================================
   COMMAND PALETTE
================================================================ */
.cmd-overlay{
  position: fixed; inset: 0;
  background: var(--scrim);
  display: grid;
  place-items: start center;
  padding-top: 14vh;
  backdrop-filter: blur(8px);
  z-index: 80;
  animation: fadeIn .15s ease;
}
.cmd-overlay.hidden{ display: none !important; }
@keyframes fadeIn{ from{opacity:0}to{opacity:1} }
.cmd-box{
  width: min(580px, 92vw);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp .25s var(--ease);
}
@keyframes slideUp{ from{transform: translateY(8px); opacity: 0} to{transform: translateY(0); opacity:1} }
.cmd-input-row{
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--panel-border);
}
.cmd-input-row svg{ color: var(--fg-dim); width: 15px; height: 15px; flex-shrink: 0; }
.cmd-input{
  flex: 1; background: transparent; border: none;
  font-size: 14.5px; color: var(--fg); outline: none;
  font-family: var(--font-sans);
}
.cmd-input::placeholder{ color: var(--fg-dim); }
.cmd-list{ max-height: 440px; overflow-y: auto; padding: 6px; }
.cmd-section{
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-dim); padding: 10px 10px 4px;
}
.cmd-item{
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px;
}
.cmd-item:hover, .cmd-item.selected{ background: var(--bg-hover); }
.cmd-item-ic{
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--bg-elev);
  display: grid; place-items: center;
  color: var(--fg-muted); flex-shrink: 0;
}
.cmd-item-ic svg{ width: 13px; height: 13px; }
.cmd-item-label{ flex: 1; }
.cmd-item-kbd{ font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-dim); }

/* ================================================================
   TWEAKS PANEL
================================================================ */
.tweaks-panel{
  position: fixed; right: 20px; bottom: 20px;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 60; overflow: hidden;
  transform: translateY(0); opacity: 1;
  transition: transform .25s var(--ease), opacity .15s;
}
.tweaks-panel.hidden{ transform: translateY(10px); opacity: 0; pointer-events: none; }
.tweaks-head{
  padding: 12px 14px;
  border-bottom: 1px solid var(--panel-border);
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev);
}
.tweaks-head .title{ font-size: 12.5px; font-weight: 500; flex: 1; letter-spacing: -0.005em; }
.tweaks-body{ padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tweak-row label{
  display: block; font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg-dim); margin-bottom: 6px;
}
.seg{
  display: flex; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 2px; gap: 2px;
}
.seg button{
  flex: 1; height: 26px; font-size: 11.5px; border-radius: 5px;
  color: var(--fg-muted); font-weight: 500; transition: all .15s;
}
.seg button.on{ background: var(--bg-raised); color: var(--fg); box-shadow: var(--shadow-sm); }
.hue-slider{
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px;
  background: linear-gradient(90deg, oklch(0.66 0.14 0), oklch(0.66 0.14 60), oklch(0.66 0.14 120), oklch(0.66 0.14 180), oklch(0.66 0.14 240), oklch(0.66 0.14 300), oklch(0.66 0.14 360));
  border-radius: 999px; outline: none;
}
.hue-slider::-webkit-slider-thumb{
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-elev);
  box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: pointer;
}
.hue-slider::-moz-range-thumb{
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-elev); cursor: pointer;
}
.hue-val{ font-family: var(--font-mono); font-size: 11px; color: var(--fg-dim); float: right; }

/* ================================================================
   UTILITY
================================================================ */
.hidden{ display: none !important; }
.pane.hidden{ display: none !important; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 900px){
  .app{ grid-template-columns: 0 1fr; }
  .sidebar{ position: fixed; left: -280px; top: 0; bottom: 0; width: 280px; z-index: 50; transition: left .25s var(--ease); }
  .app[data-sidebar="expanded"] .sidebar{ left: 0; box-shadow: var(--shadow-lg); }
  .email-grid{ grid-template-columns: 1fr; }
  .pipeline-layout,
  .pipeline-workspace,
  .contacts-layout,
  .knowledge-layout,
  .overview-grid{ grid-template-columns: 1fr; }
  .pipeline-command-head,
  .pipeline-command-actions{ align-items: stretch; }
  .pipeline-command-head,
  .contacts-search-bar,
  .inline-grid{ grid-template-columns: 1fr; display: grid; }
  .candidate-primary-actions,
  .pipeline-requirements{ grid-template-columns: 1fr; }
  .search-btn{ min-width: 0; }
  .search-btn span{ display: none; }
  .zoom-controls{ display: none; }
  .pane-mock{ padding: 18px 20px; }
  .composer-wrap{ padding: 0 16px 16px; }
  .message{ padding: 0 16px; }
  #workflow-panel{ padding: 0 16px; }
}
