/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #393d53;
  --bg-dark: #2d3141;
  --bg-card: #494d65;
  --bg-bubble-bot: #313649;
  --bg-input: #f5f6fa;
  --blue-primary: #2aa7ee;
  --blue-gradient: linear-gradient(94deg, #00f0ff 0%, #1da5f1 100%);
  --text-white: #fcfcfc;
  --text-muted: #8390b7;
  --text-dimmed: #b0b9d0;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 20px;
  --font: 'Montserrat', sans-serif;

  /* Category colors */
  --cat-accounts: #9E9CF5;
  --cat-revenue: #7FD282;
  --cat-costs: #FD5B6E;
  --cat-debts: #8390B7;
  --cat-mixed: #2196F3;
  --cat-cashflow: #C4ACA7;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-white);
  overflow: hidden;
}

.hidden { display: none !important; }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 320px;
  z-index: 100;
  opacity: 0;
  transition: none;
}

.header.visible {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  height: 28px;
  width: auto;
}

.logo-text {
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.405px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 70px;
  padding: 0 12px;
}

.header-tab-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-white);
  white-space: nowrap;
}

.user-avatar-small {
  width: 28px;
  height: 28px;
  background: #4e5b76;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.user-avatar-small img {
  display: block;
}

.workspace-avatar-small {
  width: 28px;
  height: 28px;
  background: #4e5b76;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.workspace-avatar-symbol {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1;
}

@keyframes tabSlideIn {
  0% {
    opacity: 0;
    transform: translateX(20px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

/* ===== MAIN ===== */
.main {
  margin-top: 70px;
  height: calc(100vh - 70px);
  overflow: hidden;
  position: relative;
}

/* Gradient overlay — fades content under the header */
.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(to bottom, #393d53 30%, transparent);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.gradient-overlay.visible {
  opacity: 1;
}

/* Single scroll container for welcome + chat */
.main-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.main-scroll::-webkit-scrollbar {
  width: 6px;
}

.main-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.main-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* ===== WELCOME SCREEN ===== */

.welcome-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.legal-links.welcome-legal {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  opacity: 1;
  filter: none;
  transform: none;
}

/* Divider between welcome and chat */
.chat-divider {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.08);
  border: none;
  margin: 0;
}

.welcome-content {
  text-align: center;
  width: 874px;
  max-width: 100%;
  padding: 44px;
  border-radius: var(--radius-m);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
}

.welcome-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

/* --- Welcome intro elements: hidden by default, animated by JS --- */
.welcome-title,
.welcome-subtitle,
.welcome-tagline,
.welcome-promise {
  opacity: 0;
  filter: blur(16px);
  transform: scale(0.96);
}

.welcome-divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--text-muted), transparent);
  opacity: 0;
}

.welcome-divider.animate-in {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-plan-info,
.plan-stats,
.welcome-choice,
.btn-start,
.trial-disclosure,
.legal-links,
.welcome-lock {
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.95);
}

.welcome-title.animate-in {
  animation: blurIn 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-subtitle.animate-in {
  animation: blurIn 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-tagline.animate-in {
  animation: blurIn 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-promise.animate-in {
  animation: blurIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-choice.animate-in {
  animation: fadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-plan-info.animate-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.plan-stats.animate-in {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.trial-disclosure.animate-in,
.legal-links.animate-in {
  animation: fadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-start.animate-in {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-title {
  font-size: 177px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-white);
}

.welcome-dot {
  letter-spacing: -1.12px;
}

.welcome-subtitle {
  font-size: 28px;
  font-weight: 500;
  color: var(--text-white);
}

.welcome-tagline {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-white);
  max-width: 560px;
}

.welcome-promise {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-dimmed);
  max-width: 560px;
  margin-top: 4px;
}

/* Choice buttons — Automatic / Manual */
@property --grad-angle {
  syntax: '<angle>';
  initial-value: 94deg;
  inherits: false;
}

@keyframes spin-main-gradient {
  from { --grad-angle: 94deg; }
  to   { --grad-angle: 454deg; }
}

.welcome-choice {
  display: flex;
  gap: 16px;
  align-items: stretch;
  justify-content: center;
}

.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--text-white);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: var(--font);
  min-width: 175px;
  text-align: left;
}

.choice-btn:hover {
  transform: scale(1.02);
}

.choice-btn.is-active {
  border-color: transparent;
  background:
    linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
    linear-gradient(var(--grad-angle), #00f0ff 0%, #1da5f1 100%) border-box;
}

.choice-btn.is-active:hover {
  animation: spin-main-gradient 3s linear infinite;
}

.choice-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  line-height: normal;
}

.choice-desc {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dimmed);
  line-height: normal;
}

/* Trial info — takes full viewport height and centers its content vertically,
   so the block reads as a standalone screen (no split attention with welcome above). */
.trial-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 48px 24px;
  min-height: 100vh;
  min-height: 100dvh; /* better handling of mobile browser chrome */
  box-sizing: border-box;
}

/* Unlock lock — symbolic "Ultimate plan unlocked". Rendered as a Lottie animation
   (see assets/lock-animation.json, init in app.js). The container is a plain div;
   lottie-web injects its own <svg> inside. */
.welcome-lock {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto -8px;
  filter: drop-shadow(0 6px 20px rgba(0, 240, 255, 0.25));
}

.welcome-lock svg {
  display: block;
  width: 100%;
  height: 100%;
}

.welcome-lock.animate-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-plan-info {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-white);
  text-align: center;
  max-width: 520px;
}

.highlight-blue {
  color: var(--blue-primary);
  font-weight: 600;
}

.plan-stats {
  display: inline-flex;
  gap: 40px;
  justify-content: center;
  background: var(--bg-dark);
  border-radius: var(--radius-s);
  padding: 24px;
  width: fit-content;
}

/* Trial / Legal disclosure lines under trial-info */
.trial-disclosure {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-dimmed);
  text-align: center;
  max-width: 560px;
  margin-top: 8px;
}

.legal-links {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

.legal-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(131, 144, 183, 0.5);
  transition: color 0.2s;
}

.legal-link:hover {
  color: var(--text-dimmed);
  text-decoration-color: var(--text-dimmed);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Pre-animation hidden state — each .stat fades in individually with a stagger */
  opacity: 0;
  transform: translateY(8px);
}

@keyframes statRiseIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.98); }
  60%  { opacity: 1; transform: translateY(0)   scale(1.03); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}

.stat.animate-in {
  animation: statRiseIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-white);
}

.btn-start {
  background: none;
  border: 1px solid var(--bg-input);
  color: var(--bg-input);
  height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-s);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.btn-start:hover {
  background: rgba(255,255,255,0.08);
  transform: scale(1.04);
}

/* ===== CHAT MESSAGES ===== */
.chat-messages {
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 20px 120px;
}

.chat-messages.wide {
  max-width: 1320px;
}

/* ===== MESSAGES ===== */
.message {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  animation: messageIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.message.user {
  flex-direction: row-reverse;
  animation: userMessageIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Undo button on user messages — sits left of bubble in flex flow */
.message.user .undo-btn {
  width: 17px;
  min-width: 17px;
  height: 14px;
  flex-shrink: 0;
  align-self: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message.user .undo-btn svg {
  display: block;
}

.message.user:hover .undo-btn {
  opacity: 1;
}

.message.user .undo-btn:hover svg path {
  fill: var(--text-dimmed);
}

.bot-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  overflow: hidden;
  margin-top: 2px;
}

.bot-avatar img {
  width: 100%;
  height: 100%;
  display: block;
}

.user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: #4e5b76;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.bubble {
  background: var(--bg-bubble-bot);
  border-radius: 0 16px 16px 16px;
  padding: 24px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.message.bot .bubble {
  width: 700px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message.user .bubble {
  background: #3f435b;
  border-radius: 16px 0 16px 16px;
  font-weight: 400;
  text-align: right;
}

/* ===== CLICKABLE EXAMPLES ===== */
.example-link {
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}

.example-link:hover {
  color: var(--blue-primary);
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingDot 1.4s infinite;
}

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

/* ===== ACTION BUTTONS ===== */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.action-btn {
  background: rgba(42, 167, 238, 0.1);
  border: 1px solid var(--blue-primary);
  color: var(--blue-primary);
  padding: 10px 20px;
  border-radius: var(--radius-s);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--blue-primary);
  color: white;
  transform: translateY(-1px);
}

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

.action-btn.primary:hover {
  background: #1b96dd;
}

.action-btn.secondary {
  background: rgba(255,255,255,0.05);
  border-color: var(--text-muted);
  color: var(--text-dimmed);
}

.action-btn.secondary:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* ===== CHAT BUTTONS (Figma style) ===== */
.chat-buttons {
  display: flex;
  gap: 10px;
  padding-top: 16px;
}

.chat-btn {
  background: #494d65;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: #f5f6fa;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-btn:hover {
  background: #565b78;
}

/* ===== AVATAR CHOOSER ===== */
.upload-link {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 10px;
}

.upload-icon {
  display: inline-block;
  vertical-align: middle;
}

.link-blue {
  color: var(--blue-primary);
  font-weight: 600;
  cursor: pointer;
}

.link-blue:hover {
  text-decoration: underline;
}

.avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  margin-top: 4px;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: #4e5b76;
}

.avatar-circle:hover {
  transform: scale(1.15);
}

.avatar-circle.selected {
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform: scale(1.15);
}

.skip-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 2px;
}

.skip-link {
  color: var(--blue-primary);
  cursor: pointer;
}

.skip-link:hover {
  text-decoration: underline;
}

.selected-avatar {
  width: 32px;
  height: 32px;
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  background: #4e5b76;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 1px dashed var(--text-dimmed);
  border-radius: 9px;
  padding: 30px;
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.2s;
  cursor: pointer;
  text-align: center;
}

.drop-zone:not(.uploading):not(.uploaded):not(.drag-hover):not(.file-error):hover {
  border-color: var(--blue-primary);
  background: rgba(42, 167, 238, 0.05);
}

/* ===== CONNECT SECTION ===== */
.connect-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.connect-apps {
  display: flex;
  gap: 24px;
}

.chat-btn.app-connect {
  padding: 13px 15px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
}

.chat-btn.connected {
  background: #494d65;
  color: #f5f6fa;
}

/* ===== FILE CHIPS ===== */
.file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-dark);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
}

.file-chip .file-icon {
  font-size: 14px;
}

.file-chip .file-status {
  color: #34d399;
}

/* ===== PROCESSING LIST ===== */
.processing-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.process-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-dark);
  border-radius: var(--radius-s);
  font-size: 13px;
}

.process-item .status-icon {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.process-item .process-name {
  flex: 1;
  font-weight: 500;
}

.process-item .process-detail {
  font-size: 11px;
  color: var(--text-muted);
}

.process-item.done .status-icon { color: #34d399; }
.process-item.loading .status-icon { animation: spin 1s linear infinite; }
.process-item.pending .status-icon { color: var(--text-muted); }

/* Stats Dashboard */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.stat-card {
  text-align: center;
}

.stat-card .stat-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-primary);
}

.stat-card .stat-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== SOURCE SUGGESTIONS ===== */
.ss-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.ss-text {
  font-size: 14px;
  font-weight: 400;
  color: white;
  line-height: 1.4;
}

.ss-text strong {
  font-weight: 700;
}

.ss-source-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ss-source-row {
  background: #2e3243;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ss-source-header {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.ss-source-name {
  font-size: 14px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.ss-source-badge {
  background: #3b3f50;
  border-radius: 4px;
  padding: 4px;
  font-size: 10px;
  font-weight: 500;
  color: #b0b9d0;
  line-height: 1.5;
  white-space: nowrap;
}

.ss-source-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ss-action-btn {
  background: #494d65;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  height: 28px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: #f5f6fa;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.2s;
}

.ss-action-btn:hover {
  background: #565b78;
}

.ss-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.ss-action-icon svg {
  width: 100%;
  height: 100%;
}

.ss-divider {
  height: 1px;
  background: rgba(131, 144, 183, 0.2);
}

.ss-hint {
  font-size: 12px;
  font-weight: 400;
  color: #8390b7;
  line-height: 1.5;
}

.ss-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
}

.ss-skip {
  font-size: 13px;
  font-weight: 400;
  color: #8390b7;
  cursor: pointer;
  line-height: 1.4;
}

.ss-skip:hover {
  color: var(--text-white);
}

.ss-upload-btn {
  background: #2aa7ee;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  min-height: 40px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.ss-upload-btn:hover {
  background: #1b96dd;
}

/* ===== CURRENCY SETUP ===== */
.currency-setup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.currency-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.currency-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.4;
}

/* Primary currency — chip style */
.currency-primary-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #42485d;
  padding: 5px 8px;
  width: fit-content;
}

.currency-chip-code {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.4;
  white-space: nowrap;
}

.currency-chip-fullname {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: nowrap;
}

.currency-change {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-primary);
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
}

/* Other currencies — small chips */
.currency-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.currency-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #42485d;
  border-radius: 4px;
  padding: 5px 8px;
}

.currency-chip-remove {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.currency-chip-remove:hover {
  opacity: 1;
}

.currency-add {
  display: flex;
  gap: 4px;
  align-items: center;
  cursor: pointer;
}

.currency-add span {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-primary);
  line-height: 1.4;
  white-space: nowrap;
}

.currency-footer {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-white);
  line-height: 1.5;
}

.currency-explain {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-white);
  line-height: 1.5;
}

.currency-disclaimer {
  font-size: 12px;
  font-weight: 400;
  color: #8390b7;
  line-height: 1.5;
}

.currency-actions {
  padding-top: 8px;
}

/* ===== CATEGORIES ===== */
.cat-setup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.cat-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-white);
  line-height: 1.5;
}

/* --- Icons --- */
.cat-icon-big {
  width: 17px;
  height: 13px;
  flex-shrink: 0;
}

.cat-icon-sm {
  width: 13px;
  height: 10px;
  flex-shrink: 0;
}

/* --- Grid --- */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px 24px;
}

.cat-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-white);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cat-title-name {
  line-height: 1.2;
}

/* ⓘ icon + tooltip (UI Kit: Dark, 12/150%, #393D53 bg, radius 5, padding 8/12) */
.cat-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  cursor: help;
  outline: none;
  user-select: none;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}
.cat-info:hover,
.cat-info:focus-visible {
  opacity: 1;
}

.cat-info::before,
.cat-info::after {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

/* tooltip body — appears below the icon */
.cat-info::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #393D53;
  color: #FCFCFC;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 5px;
  width: max-content;
  max-width: 240px;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* tooltip arrow — points up to the icon */
.cat-info::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #393D53;
}

.cat-info:hover::before,
.cat-info:hover::after,
.cat-info:focus-visible::before,
.cat-info:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-account-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-account-name {
  font-size: 13px;
  font-weight: 600;
  color: #b0b9d0;
  line-height: 1;
}

/* --- Divider --- */
.cat-divider {
  width: 100%;
  height: 1px;
  background: #8390b7;
}

/* --- Uncategorized text --- */
.cat-uncategorized-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-white);
}

/* --- Done cards --- */
#cat-done-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-done-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2d3141;
  border-radius: 12px;
  padding: 14px 24px;
  opacity: 0.7;
}

.cat-done-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-done-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
}

.cat-done-card-num {
  font-size: 12px;
  font-weight: 400;
  color: #4e5b76;
}

.cat-done-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cat-done-label {
  font-size: 12px;
  font-weight: 500;
  color: #8390b7;
}

/* --- Active card --- */
.cat-active-card {
  background: #2d3141;
  border-radius: 16px;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cat-active-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  margin-bottom: 12px;
}

.cat-active-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-active-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
}

.cat-active-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-active-cardnum {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
}

/* --- Transactions --- */
.cat-active-txns {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 24px;
}

.cat-txn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.cat-txn-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-txn-date {
  font-size: 11px;
  font-weight: 400;
  color: #b0b9d0;
  width: 70px;
  flex-shrink: 0;
}

.cat-txn-badge {
  font-size: 10px;
  font-weight: 500;
  color: #b0b9d0;
  background: rgba(89, 97, 115, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.cat-txn-merchant {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
}

.cat-txn-card {
  font-size: 10px;
  font-weight: 400;
  color: #4e5b76;
  white-space: nowrap;
}

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

.cat-txn-foreign {
  font-size: 10px;
  font-weight: 400;
  color: #4e5b76;
  white-space: nowrap;
}

.cat-txn-amount {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
}

/* --- Question --- */
.cat-active-question {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dimmed);
  padding: 12px 24px 0;
}

/* --- Category buttons --- */
.cat-active-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  padding: 8px 24px 0;
  justify-content: space-between;
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #373b4d;
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.cat-btn span {
  font-size: 11px;
  font-weight: 600;
  color: #f5f6fa;
  font-family: Montserrat, sans-serif;
  white-space: nowrap;
}

.cat-btn.selected {
  background: var(--blue-primary);
  outline: 2px solid rgba(42, 167, 238, 0.4);
}

/* --- Inline name edit --- */
.cat-active-name {
  cursor: pointer;
  border-bottom: 1px dashed rgba(255,255,255,0.3);
}

.cat-active-name.cat-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.cat-name-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--blue-primary);
  color: var(--text-white);
  font-family: Montserrat, sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 0 0 2px;
  outline: none;
  width: 140px;
}

.cat-edit-icon {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.cat-active-header-left:hover .cat-edit-icon {
  opacity: 1;
}

/* Done card entry animation */
@keyframes fadeSlideIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.97); }
  100% { opacity: 0.7; transform: translateY(0) scale(1); }
}

/* --- Actions --- */
.cat-active-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px 0;
}

.cat-skip {
  font-size: 13px;
  font-weight: 400;
  color: #8390b7;
  cursor: pointer;
}

.cat-confirm-btn {
  background: #2196f3;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
  font-family: Montserrat, sans-serif;
  cursor: pointer;
}

.cat-confirm-btn:hover {
  background: #1e88e5;
}

/* --- Progress --- */
.cat-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #2d3141;
  border-radius: 12px;
  padding: 14px 24px;
}

.cat-progress-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
}

.cat-progress-label {
  font-size: 13px;
  font-weight: 400;
  color: #8390b7;
}

/* Done state — keeps the neutral pill, only the check stays green */
.cat-progress-done {
  gap: 8px;
}

.cat-progress-done-icon {
  flex: 0 0 auto;
}

.cat-progress-done-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: 0.1px;
}

/* ===== WORKSPACE READY (full-width dashboard) ===== */

/* Dashboard container — sits outside bubble, full width */
.ws-dashboard {
  width: 1280px;
  max-width: calc(100vw - 40px);
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin: 0 auto 20px;
  /* Break out of the 800px chat-messages column and center relative to viewport */
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  scroll-margin-top: 20px;
  animation: dashboardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dashboardIn {
  0% { opacity: 0; filter: blur(3px); }
  100% { opacity: 1; filter: blur(0); }
}

/* Reveal block — hidden until user clicks Confirm, then fades in */
.ws-reveal {
  display: none;
  flex-direction: column;
  gap: 36px;
}

.ws-reveal.is-visible {
  display: flex;
  animation: dashboardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 1. Heading */
.ws-heading {
  text-align: left;
}

.ws-title {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.ws-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: #b0b9d0;
}

/* Shared card style */
.ws-card {
  background: #3d4157;
  border-radius: 8px;
  padding: 24px;
}

.ws-card-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
}

/* 2. Two cards side by side */
.ws-two-cards {
  display: flex;
  gap: 36px;
}

.ws-two-cards > .ws-card {
  flex: 1;
  min-width: 0;
}

/* Overview card */
.ws-workspace-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.ws-workspace-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: #4e5b76;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.ws-workspace-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ws-workspace-label {
  font-size: 13px;
  color: #b0b9d0;
}

.ws-workspace-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-badge {
  background: #2aa7ee;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ws-overview-rows {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ws-overview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ws-overview-label {
  font-size: 13px;
  font-weight: 500;
  color: #b0b9d0;
}

.ws-overview-value {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

.ws-overview-value.ws-bold {
  font-weight: 700;
}

.ws-overview-total {
  border-top: 1px dashed #b0b9d0;
  padding-top: 24px;
}

/* Currency card */
.ws-currency-desc {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 16px;
}

.ws-currency-group {
  margin-bottom: 12px;
}

.ws-currency-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: block;
  margin-bottom: 6px;
}

.ws-currency-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-currency-tag {
  background: #42485d;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ws-tag-x {
  color: #8390b7;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.ws-currency-skip {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 16px 0;
}

.ws-link {
  color: #2aa7ee;
  cursor: pointer;
}

.ws-btn-secondary {
  background: #42485d;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #f5f6fa;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}

.ws-btn-secondary:hover {
  background: #4e5570;
}

/* 3. Created Accounts */
.ws-accounts-subtitle {
  font-size: 13px;
  color: #b0b9d0;
  margin-bottom: 20px;
  margin-top: -8px;
  line-height: 1.4;
}

.ws-accounts-summary {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ws-accounts-row {
  display: flex;
  gap: 32px;
}

.ws-accounts-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-accounts-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-accounts-cat-header span {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.ws-cat-icon {
  flex-shrink: 0;
}

.ws-acct-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-acct-name {
  font-family: 'Inter', var(--font);
  font-size: 13px;
  font-weight: 600;
  color: #b0b9d0;
  line-height: 20px;
  white-space: nowrap;
}

.ws-acct-amount {
  font-family: 'Inter', var(--font);
  font-size: 12px;
  font-weight: 500;
  color: #8390b7;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}
.ws-acct-amount:hover {
  border-color: rgba(131, 144, 183, 0.4);
}
.ws-amount-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid #2aa7ee;
  color: #8390b7;
  font-family: 'Inter', 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 0 0 1px;
  outline: none;
  width: 100px;
}

.ws-accounts-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.ws-accounts-note {
  font-size: 12px;
  color: #8390b7;
  white-space: nowrap;
}

/* 4. Bar Chart */
.ws-chart {
  background: transparent;
  border-radius: 14px;
  padding: 30px 0;
}

.ws-chart-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  margin-bottom: 24px;
}

.ws-chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.ws-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #b0b9d0;
}

.ws-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ws-chart-dropdown {
  font-size: 13px;
  font-weight: 600;
  color: #8390b7;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.ws-chart-area {
  position: relative;
  height: 230px;
  padding: 0;
}

.ws-chart-svg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 210px;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.ws-chart-dots {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 210px;
  z-index: 4;
  pointer-events: none;
}

.ws-dot-hit {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-dot-point {
  width: 0;
  height: 0;
  border-radius: 50%;
  background: #FF76F1;
  box-shadow: 0 0 6px rgba(255, 118, 241, 0.6);
  transition: all 0.2s ease;
}

.ws-dot-hit:hover .ws-dot-point {
  width: 8px;
  height: 8px;
}

.ws-dot-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: #2d3141;
  border: 1px solid rgba(255, 118, 241, 0.3);
  color: #fcfcfc;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.ws-dot-hit:hover .ws-dot-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.ws-bar-guideline {
  position: absolute;
  top: 0;
  bottom: 20px;
  width: 1px;
  border-left: 1px dashed rgba(255,255,255,0.08);
  pointer-events: none;
}

.ws-legend-chevron {
  margin-left: 2px;
  flex-shrink: 0;
  vertical-align: middle;
}

.ws-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  position: relative;
  z-index: 2;
}

.ws-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.ws-bar-wrapper {
  display: flex;
  align-items: flex-end;
}

.ws-bar {
  width: 12px;
  border-radius: 17px;
  background: linear-gradient(180deg, #00f0ff 0%, #1da5f1 50%, #0f8acf 50%);
  transition: height 1s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.ws-bar-dark {
  width: 100%;
  background: #0f8acf;
  border-radius: 0 0 17px 17px;
}

.ws-bar-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-transform: lowercase;
}

/* 5. Summary Stats */
.ws-stats {
  display: flex;
  gap: 25px;
}

.ws-stat-card {
  flex: 1;
  background: #313649;
  border-radius: 8px;
  padding: 17px 17px 1px;
}

.ws-stat-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ws-stat-label {
  font-size: 16px;
  font-weight: 400;
  color: #8390b7;
}

.ws-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 30px;
  padding-bottom: 16px;
}

/* 6. Key Insights */
.ws-insights {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: -20px;
}

.ws-insights-title {
  font-size: 16px;
  font-weight: 400;
  color: #fff;
  line-height: 24px;
}

.ws-insights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-insight-card {
  background: #313649;
  border-radius: 8px;
  padding: 17px 17px 1px;
  min-height: 86px;
  position: relative;
}

.ws-insight-icon {
  position: absolute;
  left: 17px;
  top: 19px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ws-insight-body {
  margin-left: 30px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-insight-heading {
  font-size: 16px;
  font-weight: 400;
  color: #fff;
  line-height: 24px;
}

.ws-insight-desc {
  font-size: 16px;
  font-weight: 400;
  color: #8390b7;
  line-height: 24px;
}

/* 7. Final CTA Block */
.ws-cta {
  background: #292c39;
  border-radius: 16px;
  padding: 24px;
}

/* Confirm variant: single primary button, subtitle inline */
.ws-cta-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.ws-cta-confirm .ws-cta-subtitle {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 240px;
}
.ws-cta-confirm .ws-cta-buttons {
  flex: 0 0 auto;
}
.ws-cta-confirm .ws-cta-btn {
  padding: 12px 28px;
}

.ws-cta-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.ws-cta-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: #8390b7;
  margin-bottom: 20px;
}

.ws-cta-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ws-cta-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.ws-cta-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.ws-btn-primary {
  background: #2ba7ee;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.ws-btn-primary:hover {
  background: #1d96d8;
}

/* ===== FINAL SCREEN ===== */
.final-section {
  background: var(--bg-dark);
  border-radius: var(--radius-m);
  padding: 36px;
  text-align: center;
  margin-top: 14px;
}

.final-section h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.final-section p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.final-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.final-btn {
  padding: 14px 28px;
  border-radius: var(--radius-s);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.final-btn.outline {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-dimmed);
}

.final-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* ===== CHAT INPUT ===== */
.chat-input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 20px 24px;
  background: linear-gradient(to bottom, transparent, #393d53 30%);
  z-index: 15;
}

.chat-input-pill {
  display: flex;
  align-items: center;
  background: #222531;
  border-radius: 24px;
  padding: 8px 8px 8px 24px;
  height: 48px;
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-white);
  outline: none;
  min-width: 0;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: 12px;
}

.chat-attach {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.8;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.chat-attach:hover {
  opacity: 1;
  transform: scale(1.1);
}

.chat-attach:active {
  transform: scale(0.92);
  transition-duration: 0.08s;
}

.chat-send {
  width: 30px;
  height: 30px;
  min-width: 30px;
  background: var(--blue-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.chat-send:hover {
  background: #1b96dd;
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(42, 167, 238, 0.35);
}

.chat-send:active {
  transform: scale(0.92);
  transition-duration: 0.08s;
}

.btn-skip {
  display: block;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  opacity: 0.6;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: opacity 0.2s, color 0.2s;
}

.btn-skip:hover {
  color: var(--text-dimmed);
  opacity: 1;
}

/* ===== FILE UPLOAD STATES ===== */

.drop-zone-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.drop-zone-formats {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}

.drop-zone.drag-hover {
  background: #2e3d52;
  border-style: solid;
  border-color: var(--blue-primary);
}

.drop-zone.uploading,
.drop-zone.uploaded {
  text-align: left;
  cursor: default;
  border: none;
  padding: 0;
}

.drop-zone.file-error {
  border-color: #fd5b6e;
  border-style: solid;
}

.drop-zone-error-text {
  color: #fd5b6e;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
}

/* File upload list */
.file-upload-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-upload-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.file-loader {
  width: 12px;
  height: 12px;
  border: 2px solid #2aa7ee;
  border-bottom-color: rgba(42, 167, 238, 0.2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.file-check {
  flex-shrink: 0;
}

.upload-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 12px;
}

.upload-complete-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.add-more-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-primary);
  cursor: pointer;
}

.add-more-link:hover {
  text-decoration: underline;
}

.upload-complete-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* App connect button states */
.chat-btn.app-connect.connecting {
  border: 1px solid var(--blue-primary);
  color: var(--text-muted);
  pointer-events: none;
}

.chat-btn.app-connect.connected {
  background: rgba(76, 199, 118, 0.15);
  color: #4cc776;
  pointer-events: none;
}

.chat-btn.app-connect.app-error {
  border: 1px solid #fd5b6e;
  color: #fd5b6e;
  background: rgba(253, 91, 110, 0.08);
}

/* Connect status line */
.connect-status {
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s;
}

.connect-status.connecting {
  color: var(--text-muted);
}

.connect-status.connected {
  color: #f5f6fa;
}

.connect-status.error {
  color: #fd5b6e;
}

/* connect spinner uses .file-loader */

/* ===== REVIEW SOURCES BUBBLE ===== */
.review-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.review-file-item.review-app .review-file-name {
  color: #4cc776;
}

.review-file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.review-file-remove:hover {
  color: #fd5b6e;
}

.review-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.review-sources-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-action-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-primary);
  cursor: pointer;
}

.review-action-link:hover {
  text-decoration: underline;
}

.review-subtitle {
  line-height: 1.5;
}

.review-ready-text {
  line-height: 1.5;
}

.review-button-wrap {
  padding-top: 8px;
  display: flex;
  align-items: flex-start;
}

.btn-analyze {
  background: var(--blue-primary);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-analyze:hover {
  background: #1b96dd;
  transform: translateY(-1px);
}

/* ===== ANALYZE DATA BUBBLE ===== */
.analyze-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.analyze-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analyze-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analyze-item.pending .analyze-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.analyze-item.loading .analyze-name,
.analyze-item.done .analyze-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-white);
}

.analyze-details {
  padding-left: 24px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.detail-highlight {
  font-weight: 600;
  color: var(--blue-primary);
}

.analyze-divider {
  width: 100%;
  height: 1px;
  background: rgba(131, 144, 183, 0.3);
  position: relative;
  overflow: hidden;
}

.analyze-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--blue-primary);
}

.analyze-stats {
  display: flex;
  gap: 24px;
  align-items: baseline;
  flex-wrap: wrap;
  padding-top: 14px;
}

.analyze-stat {
  display: flex;
  gap: 4px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.analyze-stat-num {
  font-weight: 600;
  color: var(--text-white);
  font-variant-numeric: tabular-nums;
}

/* Only transactions counter needs wide min-width (0→1433) */
#stat-txn {
  display: inline-block;
  min-width: 3.5ch;
  text-align: right;
}

.analyze-stat-num.highlight {
  color: var(--blue-primary);
}

.analyze-stat-label {
  font-weight: 400;
  color: var(--text-muted);
}

.status-pending {
  flex-shrink: 0;
}

/* Insight icon (sparkle) */
.insight-icon {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -1px;
  animation: insightPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.insight-icon-footer {
  display: inline-flex;
  align-items: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-right: 1px;
}

.insight-icon-footer.visible {
  opacity: 1;
  transform: scale(1);
  animation: insightPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes insightPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== ANIMATIONS ===== */

/* Dramatic blur dissolve — hero titles, subtitles */
@keyframes blurIn {
  0% {
    opacity: 0;
    filter: blur(16px);
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
  }
}

/* Universal element entrance — blur + scale + overshoot */
@keyframes fadeIn {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95);
  }
  70% {
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
  }
}

/* Chat exit — welcome screen fades out beautifully */
@keyframes welcomeOut {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: scale(1.03);
    filter: blur(10px);
  }
}

/* Chat messages */
@keyframes messageIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

/* User message slides from right */
@keyframes userMessageIn {
  0% {
    opacity: 0;
    transform: translateX(12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

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

@keyframes progressBar {
  from { width: 0; }
  to { width: 100%; }
}

/* Chat container fade in */
@keyframes chatIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== DEBUG STEP SWITCHER ===== */
#debug-stepper {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 8px;
  padding: 5px 8px;
  font-family: var(--font);
  font-size: 14px;
  color: white;
  backdrop-filter: blur(10px);
  user-select: none;
}

#debug-stepper button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

#debug-stepper button:hover {
  background: rgba(255, 255, 255, 0.25);
}

#debug-step-num {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1600px) {
  .header { padding: 0 160px; }
}

@media (max-width: 1200px) {
  .header { padding: 0 40px; }
  .welcome-title { font-size: 120px; }
}

@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .welcome-title { font-size: 72px; }
  .welcome-content { padding: 24px; }
  .plan-stats { flex-direction: column; gap: 16px; padding: 20px; }
  .chat-messages { padding-left: 12px; padding-right: 12px; }
  .categories-grid { grid-template-columns: 1fr; }
  .avatar-grid { grid-template-columns: repeat(4, 48px); }
  /* Workspace dashboard responsive */
  .ws-two-cards { flex-direction: column; gap: 20px; }
  .ws-accounts-row { flex-direction: column; }
  .ws-stats { flex-wrap: wrap; }
  .ws-stat-card { flex: 1 1 calc(50% - 13px); }
  .ws-bars { gap: 4px; }
  .ws-bar-label { font-size: 11px; }
}
