/* ── Tokens ── */
:root {
  --pink: #FD0045;
  --pink-bright: #FF1F6A;
  --pink-deep: #C2003A;
  --cyan: #0BC8DE;
  --cyan-bright: #00DFF5;
  --cyan-deep: #0AA8BB;
  --sidebar-bg: #18202e;
  --sidebar-border: #2a3a55;
  --content-bg: #eef1f5;
  --card-bg: #ffffff;
  --dark-text: #c8daea;
  --mid-text: #8aaac8;
  --muted-text: #6a8aaa;
  --body-text: #222222;
  --inner-bg: #1e2a3f;
  --shadow-neon-cyan: 0 0 0 1px var(--cyan), 0 0 20px rgba(11,200,222,0.45);
  --shadow-neon-pink: 0 0 0 1px var(--pink), 0 0 20px rgba(253,0,69,0.45);
  --font-mono: 'JetBrains Mono', ui-monospace, 'Fira Code', monospace;
}

/* ── Glitch animation (design system signature motion) ── */
@keyframes glitch {
  0%   { text-shadow: -2px 0 var(--pink), 2px 0 var(--cyan); }
  20%  { text-shadow:  2px 0 var(--pink), -2px 0 var(--cyan); }
  40%  { text-shadow: -1px 0 var(--cyan), 1px 0 var(--pink); }
  60%  { text-shadow:  1px 0 var(--cyan), -1px 0 var(--pink); }
  80%  { text-shadow: -2px 0 var(--pink), 2px 0 var(--cyan); }
  100% { text-shadow: none; }
}
@keyframes glitch-run {
  0%, 89% { text-shadow: none; }
  90% { text-shadow: -2px 0 var(--pink), 2px 0 var(--cyan); }
  92% { text-shadow:  2px 0 var(--pink), -2px 0 var(--cyan); }
  94% { text-shadow: -1px 0 var(--cyan), 1px 0 var(--pink); }
  96% { text-shadow:  2px 0 var(--pink), -2px 0 var(--cyan); }
  100% { text-shadow: none; }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Sora', sans-serif;
  background: var(--sidebar-bg);
  color: var(--dark-text);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ── App Shell ── */
#app { display: flex; width: 100%; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.sidebar-logo {
  padding: 14px 14px 12px;
  border-bottom: 1px solid #2a3a55;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nj-logo-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  background: #000;
}
.nj-wordmark .top { font-size: 15px; font-weight: 700; line-height: 1.2; letter-spacing: 0.01em; }
.nj-wordmark .top .pink { color: #ffffff; }
.nj-wordmark .top .cyan { color: var(--cyan); }
.nj-wordmark .sub { font-size: 10px; color: var(--muted-text); margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--font-mono); }
.nj-sub-pink { color: var(--pink); font-weight: 700; }
.nj-sub-cyan { color: var(--cyan); font-weight: 700; }

.ws-box {
  margin: 10px 10px 6px;
  background: var(--inner-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
}
.ws-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted-text); margin-bottom: 3px; }
.ws-name { font-size: 13px; font-weight: 600; color: var(--dark-text); display: flex; justify-content: space-between; align-items: center; }
.ws-name span { color: var(--muted-text); font-size: 11px; }

.sidebar-nav { padding: 4px 8px; flex: 1; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-sec {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #4a6080;
  padding: 8px 8px 3px;
}
.nav-item {
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--mid-text);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--inner-bg); color: var(--dark-text); }
.nav-item.active { background: #FD004518; color: var(--pink); }
.nav-item .icon {
  font-size: 14px;
  width: 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-item .icon svg { display: block; }

.new-chat-btn {
  margin: 6px 10px 2px;
  background: var(--pink);
  color: #fff;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: background 140ms, box-shadow 140ms;
}
.new-chat-btn:hover { background: var(--pink-bright); box-shadow: var(--shadow-neon-pink); }
.new-chat-btn:active { background: var(--pink-deep); transform: scale(0.97); box-shadow: none; }

.history-item {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.history-item:hover { background: var(--inner-bg); color: var(--dark-text); }
.history-item.current { color: #a8c4de; }

.sb-footer { padding: 10px; border-top: 1px solid var(--inner-bg); }
.user-pill { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 7px; cursor: pointer; }
.user-pill:hover { background: var(--inner-bg); }
.u-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.u-name { font-size: 12px; font-weight: 600; color: var(--dark-text); }
.u-role { font-size: 10px; color: var(--muted-text); }

/* ── User Menu Popover ── */
.user-menu {
  position: fixed;
  z-index: 200;
  display: none;
  background: var(--inner-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 4px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.user-menu.open { display: block; }
.user-menu-overlay {
  position: fixed; inset: 0;
  z-index: 199;
  display: none;
  background: transparent;
}
.user-menu-overlay.open { display: block; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--dark-text);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: 'Sora', sans-serif;
  text-decoration: none;
}
.user-menu-item:hover { background: #253550; }
.user-menu-item.danger { color: var(--pink); }
.user-menu-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 4px 0;
}

/* ── Workspace Dropdown ── */
.ws-dropdown {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
  display: none;
}
.ws-dropdown.open { display: block; }
.ws-dropdown-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.ws-dropdown-panel {
  position: absolute;
  top: 60px; left: 10px;
  width: 220px;
  background: var(--inner-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  overflow: hidden;
  z-index: 101;
}
.ws-dropdown-item {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--dark-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-dropdown-item:hover { background: #253550; }
.ws-dropdown-item .ws-check { color: var(--pink); font-size: 12px; margin-left: auto; }
.ws-dropdown-add {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--cyan);
  cursor: pointer;
  border-top: 1px solid var(--sidebar-border);
}
.ws-dropdown-add:hover { background: #253550; }

/* ── Main Area ── */
.main { flex: 1; display: flex; flex-direction: column; background: var(--content-bg); overflow: hidden; }

/* ── Topbar ── */
.topbar {
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 0 18px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.tb-left { display: flex; flex-direction: column; }
.tb-title { font-size: 15px; font-weight: 700; color: #fff; }
.tb-sub { font-size: 11px; color: var(--mid-text); }
.cpills { display: flex; gap: 5px; }
.cpill {
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.cpill.on { background: #0BC8DE18; border: 1px solid #0BC8DE44; color: var(--cyan); }
.cpill.off { background: #ffffff08; border: 1px solid var(--sidebar-border); color: var(--muted-text); }
.cpill-empty {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #0BC8DE18;
  border: 1px dashed #0BC8DE66;
  color: var(--cyan);
  text-decoration: none;
  transition: background 0.15s;
}
.cpill-empty:hover { background: #0BC8DE2A; }
.dot { width: 4px; height: 4px; border-radius: 50%; }
.dot.on { background: var(--cyan); }
.dot.off { background: #4a6080; }

/* ── View Container ── */
.view { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.view.active { display: flex; }

/* ── Chat View ── */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 18px 140px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.chat-body > * {
  width: 100%;
  max-width: 1100px;
}
.chat-body.is-empty {
  justify-content: flex-start;
  padding-top: 48px;
  padding-bottom: 200px;
}
.chat-body.is-empty .msg-row {
  max-width: 640px;
}

/* Welcome / starter grid */
.welcome { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 8px 0; }
.welcome-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.welcome-logo img { width: 56px; height: 56px; opacity: 0.95; }
.welcome-title {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #0d1729;
  margin: 4px 0 0;
  letter-spacing: -0.01em;
}
.welcome-sub { font-size: 13px; color: #4a6080; }
.starter-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) {
  .starter-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .starter-grid { grid-template-columns: 1fr; }
}
.starter-card {
  background: #ffffff;
  border: 1px solid #e2e7ee;
  border-radius: 12px;
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(15, 25, 50, 0.04);
}
.starter-card-header { display: flex; align-items: center; gap: 8px; }
.starter-icon { font-size: 18px; }
.starter-title { font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700; color: #0d1729; letter-spacing: 0.01em; }
.starter-prompts { display: flex; flex-direction: column; gap: 6px; }
.starter-prompt {
  text-align: left;
  background: transparent;
  border: none;
  border-top: 1px solid #f0f3f7;
  padding: 9px 4px;
  font: inherit;
  font-size: 13px;
  color: #2a3a5a;
  cursor: pointer;
  transition: color 100ms;
}
.starter-prompt:first-child { border-top: none; padding-top: 4px; }
.starter-prompt:hover { color: var(--cyan); }
.welcome-tip { font-size: 12px; color: #8aaac8; text-align: center; margin-top: 4px; }

/* ── Snapshot stat strip ── */
.snapshot-card {
  width: 100%;
  background: #18202e;
  border: 1px solid #2a3a55;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 1px 2px rgba(15, 25, 50, 0.04);
}
.snapshot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
}
.snapshot-stat {
  padding: 4px 12px;
  border-right: 1px solid #2a3a55;
}
.snapshot-stat:last-child { border-right: none; }
.snapshot-stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.snapshot-stat-label {
  font-size: 11px;
  color: #c8daea;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.snapshot-stat-source {
  font-family: 'JetBrains Mono', 'SFMono-Regular', monospace;
  font-size: 9px;
  color: #6a8aaa;
  margin-top: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.snapshot-loading, .snapshot-empty {
  color: #8aaac8;
  font-size: 13px;
  padding: 4px 8px;
}

/* ── Health report (styled to match starter cards) ── */
.health-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.health-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.health-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}
.health-shell-title {
  font-family: 'JetBrains Mono', 'SFMono-Regular', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0BC8DE;
  font-weight: 700;
}
.health-action {
  background: #0BC8DE;
  color: #0d1729;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity 100ms;
}
.health-action:hover { opacity: 0.85; }
.health-action:disabled { opacity: 0.5; cursor: wait; }
.health-empty-card {
  background: #ffffff;
  border: 1px solid #e2e7ee;
  border-radius: 12px;
  padding: 16px;
  color: #4a6080;
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: 0 1px 2px rgba(15, 25, 50, 0.04);
}
.health-section {
  background: #ffffff;
  border: 1px solid #e2e7ee;
  border-radius: 12px;
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(15, 25, 50, 0.04);
}
.health-section-header { display: flex; align-items: center; gap: 8px; }
.health-section-icon { font-size: 18px; }
.health-section-title {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0d1729;
  letter-spacing: 0.01em;
}
.health-section-items { display: flex; flex-direction: column; gap: 6px; }
.health-section-item {
  text-align: left;
  border-top: 1px solid #f0f3f7;
  padding: 9px 4px;
  font-size: 13px;
  color: #2a3a5a;
  line-height: 1.5;
}
.health-section-item:first-child { border-top: none; padding-top: 4px; }
.health-section-item strong { color: #0d1729; font-weight: 700; }
.health-streaming-card {
  background: #ffffff;
  border: 1px solid #e2e7ee;
  border-radius: 12px;
  padding: 16px;
  font-size: 13.5px;
  color: #2a3a5a;
  line-height: 1.6;
  box-shadow: 0 1px 2px rgba(15, 25, 50, 0.04);
}
.health-streaming-card strong { color: #0d1729; font-weight: 700; }
.health-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #8aaac8;
  padding: 0 2px;
  letter-spacing: 0.04em;
}

/* ── Health report action bar ── */
.health-action-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 2px;
  flex-wrap: wrap;
}
.health-action-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5b88b5;
  background: transparent;
  border: 1px solid #2a3f5a;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.health-action-btn:hover {
  background: #1a2d45;
  color: #a8d0f0;
}
.health-action-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ── Settings integrations ── */
.integration-row {
  background: #0d1729;
  border: 1px solid #1e3352;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.integration-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.integration-row-name {
  font-size: 13px;
  font-weight: 600;
  color: #d0e8ff;
  margin-bottom: 2px;
}
.integration-row-desc {
  font-size: 10px;
  color: #8aaac8;
}
.integration-row-status {
  font-size: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: #8aaac8;
  white-space: nowrap;
}
.integration-row-status.connected {
  color: #4ade80;
}
.integration-row-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.integration-schedule-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #8aaac8;
  cursor: pointer;
}
.integration-schedule-label input[type="checkbox"] {
  accent-color: #4a90d9;
}
.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.btn-link:hover { opacity: 0.75; }

/* ── Beta chip ── */
.beta-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(11, 200, 222, 0.15);
  border: 1px solid rgba(11, 200, 222, 0.45);
  color: #0BC8DE;
  font-family: 'JetBrains Mono', 'SFMono-Regular', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  vertical-align: middle;
}
.msg-row { width: 100%; }
.bubble { max-width: 100%; }
.bubble.ai {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 0 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: #15213a;
}
.bubble.ai p, .bubble.ai li, .bubble.ai td { color: #15213a; }
/* Markdown styling inside AI bubbles */
.bubble.ai h1, .bubble.ai h2, .bubble.ai h3, .bubble.ai h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: #0d1729;
  margin: 18px 0 8px;
  line-height: 1.3;
}
.bubble.ai h1 { font-size: 20px; }
.bubble.ai h2 { font-size: 17px; }
.bubble.ai h3 { font-size: 15px; }
.bubble.ai h4 { font-size: 14px; color: #2a3a5a; }
.bubble.ai p { margin: 8px 0; }
.bubble.ai ul, .bubble.ai ol { margin: 8px 0 8px 22px; padding: 0; }
.bubble.ai li { margin: 4px 0; }
.bubble.ai strong { color: #0d1729; font-weight: 700; }
.bubble.ai em { color: #2a3a5a; }
.bubble.ai blockquote {
  border-left: 3px solid var(--cyan);
  padding: 4px 12px;
  margin: 10px 0;
  color: #4a6080;
  background: rgba(11,200,222,0.05);
  border-radius: 0 6px 6px 0;
}
.bubble.ai code {
  background: #f4f6f9;
  border: 1px solid #e2e7ee;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #c2185b;
}
.bubble.ai pre {
  background: #1a2238;
  color: #e6ecf5;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 12px;
}
.bubble.ai pre code {
  background: none; border: none; color: inherit; padding: 0; font-size: 12px;
}
.bubble.ai table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
  background: #fff;
  border: 1px solid #dde3eb;
  border-radius: 6px;
  overflow: hidden;
}
.bubble.ai th {
  background: #f4f6f9;
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid #dde3eb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #2a3a5a;
}
.bubble.ai td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef1f5;
  color: #15213a;
}
.bubble.ai tr:last-child td { border-bottom: none; }
.bubble.ai hr {
  border: none;
  border-top: 1px solid #e2e7ee;
  margin: 16px 0;
}

/* ── Thinking / researching indicator ── */
.thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 2px;
}
.thinking-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted-text);
}
.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.4;
  animation: thinking-bounce 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.18s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes thinking-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.bubble.ai a { color: var(--cyan); text-decoration: underline; }
.msg-row { display: flex; gap: 9px; align-items: flex-start; }
.msg-row.user { flex-direction: row-reverse; }
.m-av {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.m-av.ai { background: var(--sidebar-bg); border: 1.5px solid var(--cyan); }
.m-av.ai img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.m-av.usr { background: linear-gradient(135deg, var(--pink), var(--cyan)); color: #fff; }
.bubble {
  max-width: 76%;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.65;
  border-radius: 14px;
}
.bubble.usr {
  background: var(--sidebar-bg);
  color: var(--dark-text);
  border-radius: 14px 2px 14px 14px;
}
.tool-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--card-bg);
  border: 1px solid #dde3eb;
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #555;
  max-width: 320px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.tool-pill.done { background: #f5fdff; }
.tool-spinner { display: inline-block; width: 10px; height: 10px; border: 1.5px solid var(--cyan); border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.suggestions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 4px; }
.sug {
  background: var(--card-bg);
  border: 1px solid #dde3eb;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
}
.sug:hover { border-color: var(--cyan); color: var(--cyan); }

.choose-block { margin: 8px 0 4px; }
.choose-prompt { font-size: 13px; color: #555; margin-bottom: 10px; font-weight: 500; }
.choose-chips { display: flex; flex-direction: column; gap: 8px; max-width: 480px; }
.choose-chip {
  display: block;
  text-align: left;
  background: #ffffff;
  border: 1px solid #dde3eb;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: #1a2030;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 60ms;
}
.choose-chip:hover:not(:disabled) { border-color: var(--cyan); background: #f7fbfd; }
.choose-chip:active:not(:disabled) { transform: translateY(1px); }
.choose-chip:disabled { cursor: default; opacity: 0.55; }
.choose-chip--selected { border-color: var(--cyan) !important; background: #effaff !important; opacity: 1 !important; }
.choose-chip-label { font-weight: 600; }
.choose-chip-hint { font-size: 12px; color: #6b7280; margin-top: 2px; font-weight: 400; }

/* ── Floating Input Bar ── */
#view-chat { position: relative; }
.input-hint {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  font-size: 11px;
  color: #8aaac8;
  background: transparent;
  padding: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}
.input-bar {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 1100px;
  background: #ffffff;
  border: 1px solid #dde3eb;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 8px 28px rgba(15, 25, 50, 0.10), 0 2px 6px rgba(15, 25, 50, 0.05);
  z-index: 10;
}
.attachment-chip {
  position: absolute !important;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 880px;
  z-index: 6;
}
.attach-btn {
  background: none;
  border: none;
  color: #8aaac8;
  cursor: pointer;
  padding: 8px;
  border-radius: 7px;
  transition: color 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.attach-btn:hover { color: #0BC8DE; }
.attach-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.attachment-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e2a3d;
  border: 1px solid #0BC8DE44;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  color: #0BC8DE;
  margin: 0 14px 4px;
}
.remove-attach {
  background: none;
  border: none;
  color: #6a8aaa;
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
  line-height: 1;
}
.remove-attach:hover { color: #FD0045; }
#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 14px;
  color: var(--body-text);
  font-family: 'Sora', sans-serif;
  outline: none;
  resize: none;
  max-height: 200px;
  line-height: 1.5;
}
#chat-input::placeholder { color: #8aaac8; }
.attach-btn { color: #6a8aaa; }
.attach-btn:hover { color: #0BC8DE; background: #f4f6f9; }
.send-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--pink);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  color: #fff;
  border: none;
  transition: background 140ms, box-shadow 140ms, transform 100ms;
}
.send-btn:hover { background: var(--pink-bright); box-shadow: var(--shadow-neon-pink); }
.send-btn:active { background: var(--pink-deep); transform: scale(0.97); box-shadow: none; }

/* ── Connectors View ── */
.connectors-body { flex: 1; overflow-y: auto; padding: 20px; }
.section-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-text);
  margin-bottom: 10px;
  margin-top: 20px;
}
.section-title:first-child { margin-top: 0; }
.connector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.connector-card {
  background: var(--card-bg);
  border: 1px solid #dde3eb;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 140ms, border-color 140ms;
}
.connector-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.connector-card.connected { background: #f0fdff; border-color: #0BC8DE44; }
.connector-card.connected:hover { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 4px 14px rgba(11,200,222,0.15); }
.connector-card.coming { opacity: 0.6; }

.tier-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}
.tier-badge.v1 { background: #0BC8DE14; color: var(--cyan); border: 1px solid #0BC8DE33; }
.tier-badge.v2 { background: #FD004514; color: var(--pink); border: 1px solid #FD004533; }
.tier-badge.coming { background: #3a3a4414; color: #6a8aaa; border: 1px solid #3a3a4433; }
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.card-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.card-icon { font-size: 24px; }
.card-name { font-size: 14px; font-weight: 700; color: var(--body-text); }
.card-desc { font-size: 12px; color: #888; line-height: 1.4; }
.card-status { font-size: 11px; display: flex; align-items: center; gap: 4px; color: var(--muted-text); }
.card-status.on { color: var(--cyan); }
.card-btn {
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  border: none;
  margin-top: auto;
}
.card-btn.connect { background: var(--pink); color: #fff; }
.card-btn.manage { background: var(--inner-bg); color: var(--dark-text); border: 1px solid var(--sidebar-border); }
.card-btn.notify { background: #eee; color: #888; }

/* ── Workspaces View ── */
.workspaces-body { flex: 1; overflow-y: auto; padding: 20px; }
.workspaces-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.workspaces-header h2 { font-size: 18px; font-weight: 700; color: var(--body-text); }
.btn-primary {
  padding: 8px 15px;
  background: var(--pink);
  color: #fff;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  border: none;
  cursor: pointer;
  transition: background 140ms, box-shadow 140ms, transform 100ms;
}
.btn-primary:hover { background: var(--pink-bright); }
.btn-primary:active { background: var(--pink-deep); transform: scale(0.97); }
.workspace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.workspace-card {
  background: var(--card-bg);
  border: 1px solid #dde3eb;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.workspace-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.workspace-card.active { border-left: 3px solid var(--pink); }
.ws-initials {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.ws-card-name { font-size: 15px; font-weight: 700; color: var(--body-text); }
.ws-card-meta { font-size: 12px; color: #888; }
.ws-open-btn { font-size: 12px; color: var(--pink); font-weight: 700; text-align: right; margin-top: auto; }

/* ── Settings View ── */
.settings-body { flex: 1; overflow-y: auto; padding: 20px; }
.settings-section { background: var(--card-bg); border: 1px solid #dde3eb; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.settings-section h3 { font-size: 15px; font-weight: 700; color: var(--body-text); margin-bottom: 12px; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #666; margin-bottom: 4px; }
.form-input {
  width: 100%;
  background: #f8f9fb;
  border: 1px solid #dde3eb;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'Sora', sans-serif;
  color: var(--body-text);
  outline: none;
}
.form-input:focus { border-color: var(--cyan); }

/* ── Billing View ── */
.billing-body { flex: 1; overflow-y: auto; padding: 20px; max-width: 780px; }

/* Current plan banner */
.billing-current-plan {
  background: var(--card-bg);
  border: 1px solid #dde3eb;
  border-left: 3px solid var(--pink);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.billing-plan-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-text);
  margin-bottom: 4px;
}
.billing-plan-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--body-text);
  line-height: 1.2;
}
.billing-plan-sub {
  font-size: 12px;
  color: #888;
  margin-top: 3px;
}
.billing-plan-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  border-radius: 20px;
  background: #FD004514;
  color: var(--pink);
  border: 1px solid #FD004533;
}

/* Section title */
.billing-section-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-text);
  margin-bottom: 12px;
}

.billing-promo-hint {
  background: rgba(11, 200, 222, 0.08);
  border: 1px solid rgba(11, 200, 222, 0.35);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: #2a3a5a;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.billing-promo-hint strong { font-family: var(--font-mono); color: #0BC8DE; letter-spacing: 0.03em; }
.billing-promo-tag {
  display: inline-block;
  background: #0BC8DE;
  color: #0d1729;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Plans grid */
.billing-plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .billing-plans-grid { grid-template-columns: 1fr; }
}

/* Plan card base */
.billing-plan-card {
  background: var(--card-bg);
  border: 1px solid #dde3eb;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Current plan card */
.billing-plan-card--current {
  opacity: 0.85;
}

/* Pro plan card */
.billing-plan-card--pro {
  border-color: #0BC8DE66;
  box-shadow: 0 0 0 1px #0BC8DE22, 0 4px 20px rgba(11,200,222,0.1);
}

/* Plan card header */
.billing-plan-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.billing-plan-card-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--body-text);
}
.billing-popular-badge {
  display: inline-block;
  background: rgba(11, 200, 222, 0.12);
  border: 1px solid rgba(11, 200, 222, 0.4);
  color: #0BC8DE;
  font: 600 10px 'Sora', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.billing-price-promo {
  font: 500 12px 'Sora', sans-serif;
  color: #0BC8DE;
  margin-top: 2px;
}
.billing-plan-card-sub {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  line-height: 1.35;
}
.billing-plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 2px;
}
.billing-price-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--body-text);
  line-height: 1;
}
.billing-price-period {
  font-size: 13px;
  color: #888;
}
.billing-plan-current-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f0f0f0;
  color: #888;
  margin-top: 6px;
  width: fit-content;
}
.billing-plan-pro-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 20px;
  background: #0BC8DE14;
  color: var(--cyan-deep);
  border: 1px solid #0BC8DE33;
  margin-top: 6px;
  width: fit-content;
}

/* Feature list */
.billing-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.billing-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--body-text);
}
.billing-feature-item--off {
  color: #bbb;
}
.billing-feature-check {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.billing-feature-check--on { color: #0BC8DE; }
.billing-feature-check--pro { color: var(--cyan-deep); }
.billing-feature-check--off { color: #ccc; }

/* Upgrade button */
.billing-upgrade-btn {
  display: block;
  text-align: center;
  background: var(--pink);
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  text-decoration: none;
  margin-top: auto;
  transition: background 140ms, box-shadow 140ms, transform 100ms;
}
.billing-upgrade-btn:hover {
  background: var(--pink-bright);
  box-shadow: var(--shadow-neon-pink);
}
.billing-upgrade-btn:active {
  background: var(--pink-deep);
  transform: scale(0.97);
  box-shadow: none;
}

/* Billing note */
.billing-note {
  font-size: 12px;
  color: #888;
  text-align: center;
  padding: 8px 0 4px;
}
.billing-note-link {
  color: var(--cyan-deep);
  text-decoration: none;
}
.billing-note-link:hover { text-decoration: underline; }


/* ── Onboarding Modal ── */
.onboarding-overlay {
  position: fixed; inset: 0;
  background: rgba(10,14,24,0.88);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.onboarding-overlay.open { display: flex; }
.onboarding-modal {
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 18px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.onboarding-header { display: flex; flex-direction: column; gap: 6px; }
.onboarding-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark-text);
  line-height: 1.25;
}
.onboarding-title .cyan { color: var(--cyan); }
.onboarding-subtitle { font-size: 13px; color: var(--muted-text); line-height: 1.5; }
.onboarding-steps { display: flex; flex-direction: column; gap: 10px; }
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--inner-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: default;
}
.onboarding-step-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.onboarding-step-body { flex: 1; min-width: 0; }
.onboarding-step-title { font-size: 13px; font-weight: 600; color: var(--dark-text); margin-bottom: 2px; }
.onboarding-step-desc { font-size: 11px; color: var(--muted-text); }
.onboarding-step-btn {
  padding: 7px 14px;
  background: var(--cyan);
  color: #0a0e18;
  border: none;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.onboarding-step-btn:hover { background: var(--cyan-bright); }
.onboarding-footer { display: flex; justify-content: flex-end; }
.onboarding-skip {
  font-size: 11px;
  color: var(--muted-text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  padding: 4px 0;
  text-decoration: underline;
}
.onboarding-skip:hover { color: var(--dark-text); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 24px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal h3 { font-size: 15px; font-weight: 700; color: var(--body-text); }
.modal p { font-size: 11px; color: #888; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-cancel { padding: 7px 14px; background: #eee; color: #666; border: none; border-radius: 7px; font-size: 11px; font-family: 'Sora', sans-serif; cursor: pointer; }
.btn-danger { padding: 7px 14px; background: var(--pink); color: #fff; border: none; border-radius: 7px; font-size: 11px; font-weight: 700; font-family: 'Sora', sans-serif; cursor: pointer; }

/* ── Quota pill (free-tier monthly counter) ── */
.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin-right: 8px;
  background: rgba(11, 200, 222, 0.10);
  border: 1px solid rgba(11, 200, 222, 0.30);
  color: #8fd6e3;
  font: 600 11px 'Sora', sans-serif;
  border-radius: 999px;
  white-space: nowrap;
}
.quota-pill[hidden] { display: none; }
.quota-pill-maxed {
  background: rgba(253, 0, 69, 0.10);
  border-color: rgba(253, 0, 69, 0.40);
  color: var(--pink);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--sidebar-bg);
  color: var(--dark-text);
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 11px;
  z-index: 400;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--pink); color: var(--pink); }

/* ── Conversation List ── */
.conv-list { overflow-y: auto; flex: 1; padding: 8px 0; }
.conv-item {
  padding: 9px 8px 9px 16px;
  font-size: 13px;
  color: #8aaac8;
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.1s;
}
.conv-item .conv-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item:hover { background: #1e2a3d; color: #c8daea; }
.conv-item.active { background: #1e2a3d; color: #ffffff; border-left: 2px solid #FD0045; padding-left: 14px; }
.conv-menu-btn {
  background: transparent;
  border: none;
  color: #8aaac8;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s;
}
.conv-item:hover .conv-menu-btn,
.conv-item.active .conv-menu-btn { opacity: 1; }
.conv-menu-btn:hover { background: #2a3a52; color: #fff; }
.conv-menu {
  position: fixed;
  z-index: 100;
  background: #1e2a3d;
  border: 1px solid #2a3a52;
  border-radius: 6px;
  padding: 4px;
  min-width: 140px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.conv-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #c8daea;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.conv-menu-item:hover { background: #2a3a52; color: #fff; }
.conv-menu-item-danger { color: #ff7090; }
.conv-menu-item-danger:hover { background: #4a1a2a; color: #ff9bb0; }

/* ── Settings Extras ── */
.settings-textarea {
  width: 100%;
  min-height: 120px;
  background: #1e2a3d;
  border: 1px solid #2a3a55;
  border-radius: 7px;
  color: #c8daea;
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
  margin-top: 8px;
}
.settings-char-count { font-size: 11px; color: #6a8aaa; text-align: right; margin-top: 4px; }
.settings-hint { font-size: 12px; color: #6a8aaa; margin-top: 4px; }

/* ── Tool Progress Cards (3C) ── */
.tool-card {
  background: #ffffff;
  border-radius: 10px;
  border-left: 3px solid #0BC8DE;
  padding: 10px 14px;
  margin: 6px 0;
  max-width: 400px;
  transition: opacity 0.3s, max-height 0.4s;
  overflow: hidden;
  max-height: 80px;
}
.tool-card--running {
  animation: tool-pulse 1.5s ease-in-out infinite;
}
@keyframes tool-pulse {
  0%, 100% { border-left-color: #0BC8DE; }
  50% { border-left-color: #0BC8DE55; }
}
.tool-card--done {
  border-left-color: #0BC8DE;
  animation: none;
}
.tool-card--collapsed {
  /* Disabled — cards stay fully visible. */
}
.tool-card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #0BC8DE33;
  border-top-color: #0BC8DE;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.tool-card--done .tool-spinner {
  border: none;
  animation: none;
}
.tool-check { color: #0BC8DE; font-size: 14px; font-weight: 700; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.tool-info { flex: 1; min-width: 0; }
.tool-name { font-size: 13px; font-weight: 600; color: #222; }
.tool-status { font-size: 11px; color: #8aaac8; margin-top: 2px; }
.tool-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #0BC8DE;
  background: rgba(11,200,222,0.10);
  border: 1px solid rgba(11,200,222,0.30);
  border-radius: 10px;
  padding: 2px 8px;
  min-width: 44px;
  text-align: center;
  flex-shrink: 0;
}
.tool-progress {
  height: 3px;
  background: rgba(11,200,222,0.12);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.tool-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0BC8DE, #1FD9E5);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.tool-card--running .tool-progress-fill {
  background: linear-gradient(90deg, #0BC8DE 0%, #0BC8DE 50%, rgba(11,200,222,0.4) 100%);
  background-size: 200% 100%;
  animation: progress-shimmer 1.4s linear infinite;
}
@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.tool-card--done .tool-progress-fill {
  background: #0BC8DE;
  animation: none;
}

/* ── Stat Chips (3C) ── */
.stat-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  margin: 0 2px;
  white-space: nowrap;
}
.stat-up {
  background: #0BC8DE18;
  color: #0BC8DE;
  border: 1px solid #0BC8DE33;
}
.stat-down {
  background: #FD004518;
  color: #FD0045;
  border: 1px solid #FD004533;
}
.stat-currency {
  background: #ffffff;
  color: #222222;
  border: 1px solid #e0e0e0;
  font-family: monospace;
}

/* ── Connector Modal Extras (3C) ── */
.field-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: monospace;
  font-size: 11px;
}
.connector-note {
  font-size: 12px;
  color: #0BC8DE;
  margin-top: 8px;
  padding: 6px 10px;
  background: #0BC8DE11;
  border-radius: 6px;
}

/* ── Mobile Sidebar (3C) ── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #c8daea;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}
.sidebar-toggle:hover { background: #1e2a3d; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

@media (max-width: 768px) {
  .sidebar-toggle { display: flex; align-items: center; }

  .sidebar {
    position: fixed;
    left: -220px;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: left 0.25s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0 !important;
  }
}

/* ── Member list ── */
.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 11px;
  color: var(--body-text);
}
.member-item:last-child { border-bottom: none; }
.member-role {
  font-size: 9px;
  color: #888;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: capitalize;
}
.member-role.admin { background: #FD004512; color: var(--pink); }

/* ── Danger button ── */
.btn-danger {
  padding: 7px 14px;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
}

/* Footer links on the marketing pages (landing.html, compare.html). Replaces
   inline onmouseover/onmouseout color swaps so 'unsafe-inline' can be dropped
   from the CSP script-src (issue #38). The links carry an inline
   `color:#6a8aaa` style; !important guarantees the hover color still wins. */
.footer-link:hover {
  color: #0BC8DE !important;
}
