/* ==========================================================================
   Werlabs Genomics Component Classes
   Use with werlabs-tokens.css. Based on Werlabs design framework,
   with chat modal, upload, pricing, and data table components ported from Allela.
   ========================================================================== */

/* ---------- Reset + Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Container ---------- */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
@media (min-width: 768px) {
  .container { padding-left: var(--space-4); padding-right: var(--space-4); }
}

.container-narrow {
  max-width: var(--max-width-narrow);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

/* ---------- Panels ---------- */
.panel-pine {
  background-color: var(--color-coral-lightest);
  color: var(--color-text);
  padding: var(--section-md) 0;
}
.panel-pine a:not(.btn-coral):not(.btn-green):not(.btn-secondary):not(.btn-ghost) {
  color: var(--color-coral);
  text-decoration: underline;
  text-decoration-color: var(--color-coral-lighter);
  text-underline-offset: 2px;
  transition: color var(--duration-fast) var(--ease-default);
}
.panel-pine a:not(.btn-coral):not(.btn-green):not(.btn-secondary):not(.btn-ghost):hover {
  color: var(--color-coral-hover);
  text-decoration-color: var(--color-coral);
}
.panel-pine .text-muted { color: var(--color-text-muted); }
.panel-pine .border-subtle { border-color: var(--color-border); }

.panel-cream {
  background-color: var(--color-surface);
  color: var(--color-text);
  padding: var(--section-md) 0;
}

.panel-warm {
  background-color: var(--color-surface-alt);
  color: var(--color-text);
  padding: var(--section-md) 0;
}

.panel-grey {
  background-color: var(--color-grey);
  color: var(--color-text);
  padding: var(--section-md) 0;
}

.panel-coral-light {
  background-color: var(--color-coral-lightest);
  color: var(--color-text);
  padding: var(--section-md) 0;
}

.panel-green-light {
  background-color: var(--color-green-lighter);
  color: var(--color-text);
  padding: var(--section-md) 0;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--color-coral-lightest);
  padding: var(--section-lg) 0;
  text-align: center;
  color: var(--color-text);
}
.hero h1 {
  font-family: var(--font-primary);
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}
.hero p {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
/* ---------- Logo mono masks ---------- */
.logo-mono {
  display: inline-block;
  background: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* ---------- Typography ---------- */
.heading-display {
  font-family: var(--font-primary);
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.heading-1 {
  font-family: var(--font-primary);
  font-size: var(--text-3xl);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.heading-2 {
  font-family: var(--font-primary);
  font-size: var(--text-2xl);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.heading-3 {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.25;
}
.heading-4 {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.3;
}

.eyebrow {
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-coral);
  margin-bottom: var(--space-2);
}
.panel-pine .eyebrow { color: var(--color-coral); }


/* ---------- Prose (article content) ---------- */
.prose {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text);
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--color-pine);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}
.prose h2 { font-size: var(--text-xl); }
.prose h3 { font-size: var(--text-lg); }
.prose h4 { font-size: var(--text-base); }
.prose p { margin-bottom: 1em; }
.prose ul, .prose ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}
.prose li { margin-bottom: 0.35em; }
.prose a {
  color: var(--color-coral);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover { color: var(--color-coral-hover); }
.prose strong { font-weight: 600; color: var(--color-pine); }
.prose blockquote {
  border-left: 3px solid var(--color-coral);
  padding-left: var(--space-4);
  margin: 1em 0;
  color: var(--color-text-muted);
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-warm);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
}
.prose pre {
  background: var(--color-pine);
  color: var(--color-white);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 1em;
}
.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.5em 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}
.prose th, .prose td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: var(--text-sm);
}
.prose th {
  font-weight: 600;
  color: var(--color-pine);
  background: var(--color-coral-lightest);
}
.prose img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 1em 0;
}
/* ---------- Buttons ---------- */
.btn-coral {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-4);
  background-color: var(--color-coral);
  color: var(--color-white);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default);
}
.btn-coral:hover { background-color: var(--color-coral-hover); box-shadow: var(--shadow-md); }
.btn-coral:active { transform: scale(0.98); }

.btn-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-4);
  background-color: var(--color-green);
  color: var(--color-white);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default);
}
.btn-green:hover { background-color: var(--color-green-hover); box-shadow: var(--shadow-md); }
.btn-green:active { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-4);
  background-color: transparent;
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-default), border-color var(--duration-fast) var(--ease-default);
}
.btn-secondary:hover { background-color: var(--color-white); border-color: var(--color-text-muted); }
.panel-pine .btn-secondary { color: var(--color-text); border-color: var(--color-border); }
.panel-pine .btn-secondary:hover { background-color: var(--color-white); border-color: var(--color-text-muted); }
.hero .btn-secondary { color: var(--color-text); border-color: var(--color-border); }
.hero .btn-secondary:hover { background-color: var(--color-white); border-color: var(--color-text-muted); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-3);
  background-color: transparent;
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-default);
}
.btn-ghost:hover { background-color: var(--color-grey); }
.panel-pine .btn-ghost { color: var(--color-text); }
.panel-pine .btn-ghost:hover { background-color: var(--color-white); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--color-coral);
  transition: text-decoration-color var(--duration-fast) var(--ease-default);
}
.btn-link:hover { text-decoration-color: transparent; }

.btn-lg { height: 52px; padding: 0 var(--space-5); font-size: var(--text-base); }
.btn-sm { height: 36px; padding: 0 var(--space-3); font-size: var(--text-xs); }

/* ---------- Cards ---------- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-normal) var(--ease-default), transform var(--duration-normal) var(--ease-default);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-flat {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

.card-coral {
  background: var(--color-coral-lightest);
  border: 1px solid var(--color-coral-lighter);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.card-green {
  background: var(--color-green-lighter);
  border: 1px solid var(--color-green-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

/* ---------- Data Cards ---------- */
.data-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.data-card-allele {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-sm);
  min-width: 3.5rem;
  text-align: center;
  flex-shrink: 0;
}
.data-card-body h4 {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: var(--space-1);
}
.data-card-body p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.data-card-rsid {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}

/* ---------- Severity ---------- */
.severity-critical { background-color: #FDE8E8; color: #991B1B; border-color: #FECACA; }
.severity-warning  { background-color: #FFF3E0; color: #9A3412; border-color: #FED7AA; }
.severity-caution  { background-color: #FFFDE7; color: #854D0E; border-color: #FEF08A; }
.severity-normal   { background-color: #E8F5E9; color: #166534; border-color: #BBF7D0; }

.severity-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }
.severity-dot-critical { background-color: #DC2626; }
.severity-dot-warning  { background-color: #EA580C; }
.severity-dot-caution  { background-color: #CA8A04; }
.severity-dot-normal   { background-color: #16A34A; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  background-color: var(--color-grey);
  color: var(--color-text);
}
.badge-coral {
  background-color: var(--color-coral-lightest);
  color: var(--color-coral-hover);
}
.badge-green {
  background-color: var(--color-green-lighter);
  color: var(--color-green-hover);
}
.badge-outline {
  background-color: transparent;
  border: 1px solid var(--color-green);
  color: var(--color-green);
}
.badge-active {
  background-color: var(--color-green);
  color: var(--color-white);
}
.badge-dark {
  background-color: var(--white-10);
  color: var(--white-80);
}

/* ---------- Icon Badge ---------- */
.icon-badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.icon-badge-sm { width: 48px; height: 48px; font-size: 1.25rem; }
.icon-badge-green { background: var(--color-green-lighter); }
.icon-badge-coral { background: var(--color-coral-lightest); }

/* ---------- Feature Grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 640px)  { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.feature-item { text-align: left; }
.feature-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-coral-lightest);
  color: var(--color-coral);
  border-radius: 50%;
  margin-bottom: var(--space-3);
  font-size: 1.25rem;
}
.panel-pine .feature-icon { background-color: var(--color-coral-lighter); color: var(--color-coral); }
.feature-item h3 {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.feature-item p {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-muted);
}
.panel-pine .feature-item p { color: var(--color-text-muted); }

/* ---------- Stats ---------- */
.stat { text-align: center; }
.stat-value {
  font-family: var(--font-primary);
  font-size: var(--text-3xl);
  font-weight: 500;
  line-height: 1;
  color: var(--color-pine);
}
.panel-pine .stat-value { color: var(--color-text); }
.stat-label {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}
.panel-pine .stat-label { color: var(--color-text-muted); }

/* ---------- Divider ---------- */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--section-xs) 0;
}
.panel-pine .divider { border-top-color: var(--color-border); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-3);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}
@media (min-width: 768px) { .nav { padding: 0 var(--space-4); } }
.nav-brand {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-pine);
  text-decoration: none;
}
.nav-brand span { color: var(--color-coral); }
.nav-links { display: flex; gap: var(--space-3); align-items: center; }
.nav-links a {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}
.nav-links a:hover { color: var(--color-coral); }

/* Nav mobile panel */
.nav-mobile-panel {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  padding: var(--space-2);
  box-shadow: var(--shadow-lg);
}
.nav-mobile-panel a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.nav-mobile-panel a:hover { background: var(--color-grey); color: var(--color-coral); }

/* ---------- Footer ---------- */
.footer {
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--section-sm) 0;
  margin-top: var(--section-sm);
  border-top: 1px solid var(--color-border);
}
.footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}
.footer a:hover { color: var(--color-coral); }
.footer-brand {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}
.footer-tagline {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}
.footer h4 {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: var(--space-3);
}
.footer-legal {
  color: var(--color-text-dim);
  font-size: var(--text-sm);
}
.footer-divider {
  border-top: 1px solid var(--color-border);
}
.footer-powered {
  color: var(--color-text-dim);
  font-size: var(--text-xs);
}
.footer-powered a { color: var(--color-text-muted); }
.footer-powered a:hover { color: var(--color-coral); }

/* ---------- Form Elements ---------- */
.form-input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default);
}
.form-input:focus {
  border-color: var(--color-green);
  box-shadow: 0 0 0 2px rgba(53, 167, 110, 0.15);
}
.form-input::placeholder { color: var(--color-text-dim); }

.form-select {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  background-color: var(--color-white);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default);
}
.form-select:focus {
  border-color: var(--color-green);
  box-shadow: 0 0 0 2px rgba(53, 167, 110, 0.15);
}

.form-checkbox { accent-color: var(--color-green); }

/* ---------- Upload Drop Zone ---------- */
.upload-dropzone {
  display: block;
  width: 100%;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default),
              background-color var(--duration-fast) var(--ease-default);
}
.upload-dropzone:hover {
  border-color: var(--color-green);
  background-color: var(--color-green-lighter);
}
.upload-dropzone svg { color: var(--color-coral); }

/* ---------- Flash Messages ---------- */
.flash-notice {
  border-radius: var(--radius-sm);
  background-color: #E8F5E9;
  border: 1px solid #BBF7D0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: #166534;
}
.flash-alert {
  border-radius: var(--radius-sm);
  background-color: var(--color-coral-lightest);
  border: 1px solid var(--color-coral-lighter);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
}

/* ---------- Link styles ---------- */
.link-primary {
  color: var(--color-coral);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}
.link-primary:hover { color: var(--color-coral-hover); }

/* ---------- Data Table ---------- */
.data-table {
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.data-table thead tr {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}
.data-table tbody tr {
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color var(--duration-fast) var(--ease-default);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background-color: var(--color-coral-lightest); }

/* ---------- Pagination ---------- */
.pagination-link {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-coral);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-default);
}
.pagination-link:hover { background-color: var(--color-coral-lightest); }

/* ---------- Tag ---------- */
.tag-primary {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-xl);
  background-color: var(--color-coral-lightest);
  color: var(--color-coral);
  font-size: var(--text-xs);
  font-weight: 500;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  background-color: var(--color-green);
  border-radius: var(--radius-pill);
}

/* ---------- Genotype highlight ---------- */
.genotype-yours {
  border-color: var(--color-coral);
  background-color: var(--color-coral-lightest);
}

/* ---------- Product Card ---------- */
.product-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-default), transform var(--duration-normal) var(--ease-default);
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--color-coral-lightest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.product-card-body { padding: var(--space-3); }
.product-card-body h4 {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: var(--space-1);
}
.product-card-body p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-2);
}
.product-card-price {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.product-card-price-member {
  font-size: var(--text-sm);
  color: var(--color-coral);
  font-weight: 500;
}

/* ---------- Pricing Grid ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  max-width: 960px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); align-items: start; }
}
.pricing-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-5);
  text-align: center;
  position: relative;
  transition: box-shadow var(--duration-normal) var(--ease-default), transform var(--duration-normal) var(--ease-default);
}
.pricing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.pricing-card-featured {
  border-color: var(--color-green);
  border-width: 2px;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) {
  .pricing-card-featured { transform: scale(1.05); }
  .pricing-card-featured:hover { transform: scale(1.05) translateY(-2px); }
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-green);
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
}
.pricing-tier {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.pricing-price {
  font-family: var(--font-primary);
  font-size: var(--text-3xl);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1;
}
.pricing-period {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  margin-bottom: var(--space-5);
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-8);
  text-align: left;
}
.pricing-features li {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-check {
  color: var(--color-green);
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- MCP Flow Diagram ---------- */
.mcp-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: var(--space-8) 0;
}
.mcp-flow-node {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.mcp-flow-node-werlabs {
  background: var(--color-coral);
  border-color: var(--color-coral);
  color: var(--color-white);
}
.mcp-flow-arrow {
  color: var(--color-text-dim);
  font-size: var(--text-xl);
}

/* ---------- Chat Modal ---------- */
.chat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease-default);
}
.chat-modal-overlay.hidden { display: none; }
.chat-modal-active { opacity: 1; }
.chat-modal-active .chat-modal-panel {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.chat-modal-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--color-white);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96) translateY(12px);
  transition: opacity 0.3s var(--ease-default), transform 0.3s var(--ease-default);
}
@media (min-width: 640px) {
  .chat-modal-panel {
    width: 90vw;
    height: 85vh;
    max-width: 1100px;
    max-height: 800px;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(30, 30, 30, 0.25);
  }
}
.chat-modal-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.chat-modal-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-pine) 0%, var(--color-coral) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.chat-modal-header-info { flex: 1; min-width: 0; }
.chat-modal-name {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.2;
}
.chat-modal-status {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.2;
}
.chat-modal-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.chat-modal-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-grey);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: background 0.15s var(--ease-default);
}
.chat-modal-header-btn:hover { background: var(--color-border); }
.chat-modal-sidebar-btn { display: flex; }
@media (min-width: 640px) { .chat-modal-sidebar-btn { display: none; } }
.chat-modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.chat-modal-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.chat-modal-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.chat-modal-messages .chat-bubble {
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  max-width: 80%;
  opacity: 1;
  transform: none;
}
.chat-modal-input-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
.chat-modal-input {
  flex: 1;
  height: 40px;
  background: var(--color-grey);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s var(--ease-default);
}
.chat-modal-input:focus { border-color: var(--color-green); }
.chat-modal-input::placeholder { color: var(--color-text-dim); }
.chat-modal-send {
  width: 36px;
  height: 36px;
  background: var(--color-coral);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s var(--ease-default);
}
.chat-modal-send:hover { background: var(--color-coral-hover); }
.chat-modal-send:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-modal-input:disabled { opacity: 0.6; }

/* Chat bubble */
.chat-bubble {
  max-width: 85%;
  padding: var(--space-2) var(--space-3);
  border-radius: 16px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.bubble-user {
  align-self: flex-end;
  background-color: var(--color-coral);
  color: var(--color-white);
  border-bottom-right-radius: 4px;
}
.bubble-werlabs {
  align-self: flex-start;
  background-color: var(--color-coral-lightest);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}

/* Chat sidebar */
.chat-sidebar {
  width: 280px;
  border-left: 1px solid var(--color-border);
  background: var(--color-surface);
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
@media (min-width: 640px) { .chat-sidebar { display: flex; } }
@media (max-width: 639px) {
  .chat-sidebar {
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 10;
    border-left: none;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease-default);
  }
  .chat-sidebar-open { display: flex; transform: translateX(0); }
}
.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.chat-sidebar-title {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: var(--text-sm);
}
.chat-sidebar-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
@media (min-width: 640px) { .chat-sidebar-close { display: none; } }
.chat-sidebar-list {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.chat-doc-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s var(--ease-default);
}
.chat-doc-item:hover { background: var(--pine-5); }
.chat-doc-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.chat-doc-info { flex: 1; min-width: 0; }
.chat-doc-name { font-size: var(--text-sm); font-weight: 500; line-height: 1.3; }
.chat-doc-meta { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.3; }

/* Chat notification */
.chat-notification { text-align: center; padding: var(--space-2) 0; }
.chat-notification-text {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-1) var(--space-4);
  background: var(--color-surface-alt);
  border-radius: var(--radius-pill);
}

/* Typing indicator */
.chat-typing-indicator {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-coral-lightest);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.chat-typing-indicator .typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-text-dim);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}
.chat-typing-indicator .typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}

/* Markdown inside assistant bubbles */
.chat-bubble-markdown h1,
.chat-bubble-markdown h2,
.chat-bubble-markdown h3 {
  font-family: var(--font-primary);
  font-weight: 600;
  margin: var(--space-3) 0 var(--space-2);
  line-height: 1.3;
}
.chat-bubble-markdown h1 { font-size: var(--text-lg); }
.chat-bubble-markdown h2 { font-size: var(--text-base); }
.chat-bubble-markdown h3 { font-size: var(--text-sm); font-weight: 700; }
.chat-bubble-markdown h1:first-child,
.chat-bubble-markdown h2:first-child,
.chat-bubble-markdown h3:first-child { margin-top: 0; }
.chat-bubble-markdown p { margin: var(--space-2) 0; line-height: 1.6; }
.chat-bubble-markdown p:first-child { margin-top: 0; }
.chat-bubble-markdown p:last-child { margin-bottom: 0; }
.chat-bubble-markdown ul,
.chat-bubble-markdown ol { margin: var(--space-2) 0; padding-left: 1.5em; }
.chat-bubble-markdown li { margin: var(--space-1) 0; line-height: 1.5; }
.chat-bubble-markdown strong { font-weight: 600; }
.chat-bubble-markdown a { color: var(--color-coral); text-decoration: underline; }
.chat-bubble-markdown code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}
.chat-bubble-markdown pre {
  background: rgba(0, 0, 0, 0.06);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: var(--space-2) 0;
}
.chat-bubble-markdown pre code { background: none; padding: 0; }

/* ---------- Dashboard doc cards ---------- */
.hub-doc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 640px) { .hub-doc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .hub-doc-grid { grid-template-columns: repeat(3, 1fr); } }
.hub-doc-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: box-shadow var(--duration-normal) var(--ease-default), transform var(--duration-normal) var(--ease-default);
}
.hub-doc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.hub-doc-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-coral-lightest);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-coral);
  margin-bottom: var(--space-3);
}
.hub-doc-card-title {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.hub-doc-card-preview {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .chat-modal-overlay,
  .chat-modal-panel,
  .chat-sidebar { transition: none; }
  .chat-typing-indicator .typing-dot { animation: none; }
}
