/* ==========================================================================
   BLW ENGINE VALVES PVT. LTD. - CALM, PRECISE B2B INDUSTRIAL DESIGN
   Developed & Deployed by Aditya Yogabrata (yogabrata.com)
   ========================================================================== */

:root {
  /* DEFAULT THEME: 1. Precision Light */
  --bg-main: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --border-color: #E2E8F0;
  --border-focus: #174A70;

  --text-main: #17212D;
  --text-muted: #475569;
  --text-dim: #64748B;

  --accent-primary: #174A70;      /* Deep Blue */
  --accent-secondary: #B57842;    /* Restrained Copper */
  --accent-success: #0F766E;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-subtle: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-card: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-dropdown: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

  --transition: all 0.2s ease-in-out;
}

/* 2. Warm Industrial Theme */
[data-theme="warm"] {
  --bg-main: #F7F4EE;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EFEBE4;
  --border-color: #E2DDD5;
  --border-focus: #315C57;

  --text-main: #292D2F;
  --text-muted: #575D60;
  --text-dim: #7B8286;

  --accent-primary: #315C57;      /* Forest / Steel Green */
  --accent-secondary: #A67643;    /* Muted Bronze */
  --accent-success: #2C6E49;
}

/* 3. Graphite Showcase (Dark Option) */
[data-theme="dark"] {
  --bg-main: #0F172A;
  --bg-surface: #1E293B;
  --bg-subtle: #334155;
  --border-color: #334155;
  --border-focus: #38BDF8;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --accent-primary: #38BDF8;
  --accent-secondary: #F59E0B;
  --accent-success: #10B981;

  --shadow-card: 0 4px 12px rgba(0,0,0,0.3);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.card-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card-panel:hover {
  border-color: var(--accent-primary);
}

.bg-subtle {
  background-color: var(--bg-subtle);
}

.section-padding {
  padding: 4.5rem 0;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-subtitle {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  max-width: 44rem;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* CONCEPT BANNER */
.concept-preview-bar {
  background: #17212D;
  color: #F8FAFC;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.concept-preview-bar a {
  color: #38BDF8;
  text-decoration: underline;
}

/* TOP ANNOUNCEMENT BAR */
.top-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.825rem;
  padding: 0.5rem 0;
  color: var(--text-muted);
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-tag {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-success);
  border: 1px solid rgba(15, 118, 110, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.top-bar-right a {
  color: var(--text-muted);
  text-decoration: none;
}
.top-bar-right a:hover {
  color: var(--accent-primary);
}

/* HEADER & NAVBAR */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #ffffff;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-name .highlight {
  color: var(--accent-primary);
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
}
.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-success);
  border-radius: 50%;
}

/* THEME SELECTOR DROPDOWN */
.theme-switcher-wrapper {
  position: relative;
}

.theme-dropdown {
  position: absolute;
  top: 45px;
  right: 0;
  width: 210px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: var(--transition);
}

.theme-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.theme-option:hover, .theme-option.active {
  background: var(--bg-subtle);
  color: var(--accent-primary);
}

.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-precision { background: #174A70; }
.dot-warm { background: #315C57; }
.dot-dark { background: #38BDF8; }

/* HERO SECTION */
.hero-section {
  padding: 4rem 0 5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* COMPONENT VISUALIZER */
.visualizer-card {
  padding: 1.5rem;
}

.visualizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.visualizer-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}

.visualizer-controls {
  display: flex;
  gap: 0.35rem;
}

.viz-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.viz-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.interactive-stage {
  height: 240px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.engine-valve-model {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.valve-head {
  width: 130px;
  height: 20px;
  background: linear-gradient(90deg, #94A3B8 0%, #E2E8F0 50%, #64748B 100%);
  border-radius: 50% 50% 10% 10% / 100% 100% 20% 20%;
  border: 1px solid var(--border-color);
}

.valve-stem {
  width: 20px;
  height: 130px;
  background: linear-gradient(90deg, #64748B 0%, #CBD5E1 50%, #475569 100%);
}

.stage-info-box {
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.75rem;
}

.info-key { color: var(--text-muted); }
.info-val { font-weight: 700; color: var(--text-main); }

/* GRID & CARDS */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.gap-md { gap: 1.25rem; }
.gap-lg { gap: 1.75rem; }
.gap-xl { gap: 2.5rem; }

.feature-card {
  padding: 1.75rem;
}

.feature-icon-wrapper {
  width: 48px; height: 48px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.feature-list {
  list-style: none;
}
.feature-list li {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* CATALOG */
.catalog-search-bar {
  position: relative;
  width: 340px;
}
.catalog-search-bar i {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.catalog-search-bar input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.875rem;
}

.tab-buttons-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.product-card:hover {
  border-color: var(--accent-primary);
}

.product-badge-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.p-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.p-tag-blue { background: rgba(23, 74, 112, 0.1); color: var(--accent-primary); }

.oem-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-img-box {
  height: 120px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.product-spec-table {
  width: 100%;
  font-size: 0.775rem;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.product-spec-table td {
  padding: 3px 0;
  border-bottom: 1px solid var(--border-color);
}
.product-spec-table td:first-child { color: var(--text-muted); }
.product-spec-table td:last-child { font-weight: 700; text-align: right; color: var(--text-main); }

.product-card-footer {
  margin-top: auto;
  display: flex;
  gap: 0.4rem;
}

/* CALCULATOR */
.calculator-card {
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.calc-input, .form-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-size: 0.9rem;
}

.calc-input:focus, .form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.summary-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.summary-box h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}
.summary-val { font-weight: 700; color: var(--text-main); }

/* FOOTER */
.main-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 1.5rem;
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent-primary); }

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
}

/* FLOATING CHATBOT ADITYA (ALWAYS VISIBLE) */
.nexus-chatbot-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
}

.nexus-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--accent-primary);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.25rem 0.75rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.925rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(23, 74, 112, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: floatChatPulse 2.5s infinite;
  position: relative;
}

.nexus-trigger-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(23, 74, 112, 0.45);
}

.nexus-online-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10B981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

@keyframes floatChatPulse {
  0% { box-shadow: 0 0 0 0px rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0px rgba(37, 99, 235, 0); }
}

.nexus-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexus-chat-window {
  width: 400px; height: 550px;
  position: absolute;
  bottom: 65px; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: var(--transition);
}

.nexus-chat-window.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.nexus-chat-header {
  background: var(--bg-subtle);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nexus-chat-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg-main);
}

.chat-msg {
  display: flex;
  gap: 0.6rem;
  max-width: 90%;
}
.chat-msg.bot-msg { align-self: flex-start; }
.chat-msg.user-msg { align-self: flex-end; flex-direction: row-reverse; }

.msg-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0 10px 10px 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text-main);
}

.user-msg .msg-content {
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: 10px 0 10px 10px;
  border: none;
}

.nexus-chat-input-bar {
  padding: 0.75rem 0.85rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.nexus-chat-input-bar input {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.85rem;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

/* N8N-STYLE BUSINESS WORKFLOW CANVAS */
.n8n-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 680px;
  background-color: var(--bg-card);
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-top: 1.5rem;
}

.n8n-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
  position: relative;
  z-index: 20;
}

.n8n-canvas-viewport {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100% - 60px);
  overflow: auto;
}

.n8n-canvas-area {
  position: relative;
  width: 2200px;
  height: 1200px;
  transform-origin: 0 0;
}

.n8n-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.n8n-svg-path {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 3px;
  stroke-linecap: round;
  transition: stroke 0.3s ease;
}

.n8n-svg-path.active {
  stroke: var(--accent-primary);
  stroke-width: 3.5px;
  stroke-dasharray: 8, 6;
  animation: flowBeam 1.5s linear infinite;
}

.n8n-svg-path.exception {
  stroke: #F59E0B;
  stroke-width: 3px;
  stroke-dasharray: 6, 4;
}

@keyframes flowBeam {
  from { stroke-dashoffset: 28; }
  to { stroke-dashoffset: 0; }
}

.n8n-node {
  position: absolute;
  width: 230px;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.n8n-node:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-dropdown);
  border-color: var(--accent-primary);
}

.n8n-node.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.n8n-node.completed {
  border-color: #10B981;
}
.n8n-node.completed .n8n-node-header {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
}

.n8n-node.active {
  border-color: var(--accent-primary);
  animation: nodeActiveGlow 2s infinite;
}
.n8n-node.active .n8n-node-header {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-primary);
}

.n8n-node.waiting {
  border-color: #F59E0B;
}
.n8n-node.waiting .n8n-node-header {
  background: rgba(245, 158, 11, 0.15);
  color: #D97706;
}

.n8n-node.blocked {
  border-color: #EF4444;
}
.n8n-node.blocked .n8n-node-header {
  background: rgba(239, 68, 68, 0.15);
  color: #DC2626;
}

@keyframes nodeActiveGlow {
  0% { box-shadow: 0 0 0 0px rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0px rgba(37, 99, 235, 0); }
}

.n8n-node-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: 4px 4px 0 0;
}

.n8n-node-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.775rem;
}

.n8n-node-title {
  font-weight: 800;
  color: var(--text-main);
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.n8n-node-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.exec-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.exec-manual { background: rgba(245, 158, 11, 0.12); color: #D97706; border: 1px solid rgba(245, 158, 11, 0.3); }
.exec-rule { background: rgba(16, 185, 129, 0.12); color: #059669; border: 1px solid rgba(16, 185, 129, 0.3); }
.exec-approval { background: rgba(139, 92, 246, 0.12); color: #7C3AED; border: 1px solid rgba(139, 92, 246, 0.3); }
.exec-integration { background: rgba(37, 99, 235, 0.12); color: #2563EB; border: 1px solid rgba(37, 99, 235, 0.3); }

/* SIDE DETAIL PANEL */
.n8n-detail-panel {
  position: absolute;
  top: 60px;
  right: -420px;
  width: 400px;
  height: calc(100% - 60px);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 50;
  box-shadow: -8px 0 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.n8n-detail-panel.open {
  right: 0;
}

.n8n-detail-header {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.n8n-detail-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.n8n-detail-section-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.n8n-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  padding: 4px 0;
  color: var(--text-main);
}

.n8n-minimap {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 140px;
  height: 90px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  z-index: 30;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.modal-card {
  width: 100%; max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  position: relative;
  box-shadow: var(--shadow-dropdown);
}

.modal-close-btn {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
}

@media (max-width: 900px) {
  .hero-grid, .grid-cols-2, .grid-cols-3, .grid-cols-4, .calc-grid, .catalog-grid {
    grid-template-columns: 1fr;
  }
  .nav-menu { display: none; }
  .catalog-search-bar { width: 100%; }
}

/* DELEGATE COMMAND CENTRE STYLES (KAI247 -> SMB) */
.delegate-notice-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.delegate-workspace {
  display: grid;
  grid-template-columns: 320px 1fr 350px;
  height: 720px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.delegate-sidebar {
  border-right: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.delegate-filter-scroll {
  display: flex;
  gap: 4px;
  padding: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
  scrollbar-width: thin;
}

.group-filter-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.group-filter-pill.active, .group-filter-pill:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.delegate-group-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
}

.delegate-group-item:hover, .delegate-group-item.active {
  background: var(--bg-subtle);
}

.delegate-group-item.active {
  border-left: 3px solid var(--accent-primary);
}

.group-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}

.group-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.group-preview {
  font-size: 0.775rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.delegate-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.st-observing { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.st-supervised { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.st-drafting { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.st-auto { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.st-paused { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.risk-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}
.risk-critical { background: #dc2626; color: #ffffff; }
.risk-high { background: #d97706; color: #ffffff; }

.unread-pill {
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CENTRE CHAT COLUMN */
.delegate-chat-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  overflow: hidden;
}

.chat-header-bar {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.chat-thread-scroll {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fafafa;
}

.noise-compressed-bar {
  background: #eff6ff;
  border: 1px dashed #3b82f6;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.775rem;
  color: #1e40af;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.noise-compressed-bar:hover {
  background: #dbeafe;
}

.chat-bubble {
  max-width: 78%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  position: relative;
}

.customer-bubble {
  background: #ffffff;
  border: 1px solid var(--border-color);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  color: var(--text-main);
}

.user-bubble {
  background: #174a70;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.user-bubble .bubble-sender { color: #93c5fd; }
.user-bubble .bubble-time { color: #bfdbfe; }

.bot-bubble {
  background: #f8fafc;
  border: 1.5px solid #2563eb;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  color: var(--text-main);
}

.draft-bubble {
  background: #fffbe6;
  border: 1.5px dashed #d97706;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  color: var(--text-main);
}

.bubble-sender {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.bubble-time {
  font-weight: 400;
  font-size: 0.675rem;
}

.bubble-attachment {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
  font-size: 0.775rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.bot-disclosure-tag {
  margin-top: 6px;
  font-size: 0.675rem;
  color: #2563eb;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.draft-badge-bar {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #d97706;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.725rem;
  color: #d97706;
  font-weight: 700;
}

/* RIGHT INTEL COLUMN */
.delegate-intel-column {
  border-left: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.intel-tabs-header {
  display: flex;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.intel-tab-btn {
  flex: 1;
  padding: 10px 4px;
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-align: center;
}

.intel-tab-btn.active, .intel-tab-btn:hover {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.intel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.intel-section-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.suggested-reply-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-primary);
  border-radius: 4px;
  padding: 0.75rem;
  font-size: 0.825rem;
  color: var(--text-main);
  line-height: 1.5;
  font-style: italic;
}

.source-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.775rem;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.source-chip:hover {
  border-color: var(--accent-primary);
}

.priority-card {
  padding: 1.25rem;
  transition: transform 0.2s ease;
}

.priority-card:hover {
  transform: translateY(-2px);
}

.priority-critical { border-left: 4px solid #dc2626; }
.priority-high { border-left: 4px solid #d97706; }
.priority-medium { border-left: 4px solid #2563eb; }

.delegate-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.delegate-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1024px) {
  .delegate-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }
  .delegate-sidebar, .delegate-chat-column, .delegate-intel-column {
    height: 500px;
  }
}

/* AUTHENTIC WHATSAPP BUSINESS WEB STYLING */
.wa-header-bar {
  background: #075E54;
  color: #ffffff;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.wa-header-avatar {
  width: 40px; height: 40px;
  background: #128C7E;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.wa-header-members {
  font-size: 0.725rem;
  color: #b5ead7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.wa-chat-bg {
  background-color: #efeae2;
  background-image: radial-gradient(#d5ccc2 1px, transparent 1px);
  background-size: 16px 16px;
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wa-date-divider {
  align-self: center;
  background: #ffffff;
  color: #54656f;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(11,20,26,0.12);
  margin: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wa-bubble {
  max-width: 78%;
  position: relative;
  padding: 8px 12px 6px 12px;
  border-radius: 7.5px;
  font-size: 0.85rem;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgba(11,20,26,0.13);
  word-wrap: break-word;
}

.wa-bubble-incoming {
  align-self: flex-start;
  background: #ffffff;
  color: #111b21;
  border-top-left-radius: 0;
}

.wa-bubble-outgoing {
  align-self: flex-end;
  background: #d9fdd3;
  color: #111b21;
  border-top-right-radius: 0;
}

.wa-bubble-ai {
  align-self: flex-start;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  color: #0f172a;
  border-top-left-radius: 0;
}

.wa-sender-name {
  font-weight: 800;
  font-size: 0.775rem;
  margin-bottom: 2px;
}

.wa-msg-meta {
  float: right;
  font-size: 0.65rem;
  color: #667781;
  margin-left: 12px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.wa-tick-blue {
  color: #53bdeb;
  font-weight: 900;
}

.wa-input-bar {
  background: #f0f2f5;
  border-top: 1px solid #e9edef;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-input-field {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e9edef;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.875rem;
  color: #111b21;
  outline: none;
  font-family: inherit;
}

.wa-input-field:focus {
  border-color: #00a884;
}

.wa-send-btn {
  width: 40px; height: 40px;
  background: #00a884;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  transition: background 0.2s ease;
}

.wa-send-btn:hover {
  background: #008069;
}

/* CAMUNDA / TIBCO ZERO-CODE STUDIO PALETTE & MODES */
.n8n-studio-palette {
  position: absolute;
  top: 60px;
  left: -280px;
  width: 260px;
  height: calc(100% - 60px);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  z-index: 45;
  box-shadow: 4px 0 16px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.n8n-studio-palette.open {
  left: 0;
}

.palette-category-title {
  font-size: 0.725rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.6rem 1rem 0.3rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.palette-item:hover {
  background: var(--bg-subtle);
}

.palette-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.palette-icon-trigger { background: #10B981; }
.palette-icon-task { background: #2563EB; }
.palette-icon-ai { background: #8B5CF6; }
.palette-icon-end { background: #EF4444; }

.studio-active-badge {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.775rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.node-studio-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}

.node-action-btn {
  flex: 1;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
}

.node-action-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}


