:root {
  --primary: #DC2626; /* Heartbeat Red */
  --primary-hover: #B91C1C;
  --secondary: #0D9488; /* Clinical Teal */
  --secondary-hover: #0F766E;
  --bg-color: #F8FAFC;
  --surface: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #475569;
  --border: #E2E8F0;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.logo-lockup svg {
  width: 32px;
  height: 32px;
}
nav { display: flex; gap: 2rem; align-items: center; }
nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}
nav a:hover { color: var(--text-main); }
.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover { background: var(--primary-hover); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #F1F5F9; }

/* Hero Section */
.hero {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}
.hero-content p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 90%;
}

/* Signature Element: Locator & Refill */
.signature-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.tab {
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem 0;
}
.tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  margin-bottom: -9px;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}
.input-group input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}
.signature-result {
  margin-top: 1rem;
  padding: 1rem;
  background: #F0FDF4;
  border-left: 4px solid #16A34A;
  border-radius: 4px;
  display: none;
}
.signature-result.active { display: block; }
.signature-result p { margin: 0; font-size: 0.875rem; color: #166534; }

/* Features Grid */
.features {
  padding: 4rem 2rem;
  background: var(--surface);
}
.features-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.features-inner h2 {
  font-size: 2.25rem;
  text-align: center;
  margin-bottom: 3rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.feature-card {
  padding: 2rem;
  background: var(--bg-color);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.feature-icon {
  width: 48px;
  height: 48px;
  background: #CCFBF1;
  color: var(--secondary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-content p { margin: 0 auto 2rem; }
  .grid { grid-template-columns: 1fr; }
}
/* Chat Widget (Bespoke styles for chassis DOM) */
#chatLaunch {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 1rem 1.5rem;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}
#chatLaunch:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}
#chatPanel {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 350px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  pointer-events: none;
}
#chatPanel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
#chatPanel header {
  background: var(--primary);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
#chatClose {
  background: transparent;
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
#chatLog {
  height: 300px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #F8FAFC;
}
.msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.msg.system { margin: 0 auto; background: transparent; color: var(--text-muted); font-size: 0.8rem; text-align: center; }
.msg.user { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.assistant { background: white; color: var(--text-main); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.error { background: #FEF2F2; color: #991B1B; border: 1px solid #F87171; align-self: center; text-align: center;}
.msg.blocked { background: #FFFBEB; color: #92400E; border: 1px solid #FCD34D; align-self: center; text-align: center;}
#chatForm {
  display: flex;
  padding: 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
#chatInput {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.9rem;
  outline: none;
}
#chatInput:focus { border-color: var(--primary); }
#chatSend {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 600;
  cursor: pointer;
}
#chatSend:hover { background: var(--primary-hover); }
#chatSend:disabled { background: var(--text-muted); cursor: not-allowed; }
