:root {
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --emerald-50: #ecfdf5;
  --emerald-200: #a7f3d0;
  --emerald-700: #047857;
  --rose-50: #fff1f2;
  --rose-200: #fecdd3;
  --rose-600: #e11d48;
  --rose-700: #be123c;
  --amber-50: #fffbeb;
  --amber-200: #fde68a;
  --amber-900: #78350f;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-800: #1e293b;
  --radius: 1rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--slate-50);
  color: var(--slate-600);
}
h1, h2, h3, .logo, button, .font-head { font-family: 'Outfit', 'Inter', system-ui, sans-serif; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s, border-color .2s;
}
.site-header.scrolled { border-color: var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.header-inner { max-width: 64rem; margin: 0 auto; padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--teal-700); font-size: 1.1rem; background: none; border: none; padding: 0; }
.nav-primary { display: none; align-items: center; gap: .25rem; flex-wrap: wrap; position: relative; }
.nav-link { background: none; border: none; padding: .5rem .75rem; border-radius: .6rem; font-size: .875rem; font-weight: 500; color: var(--slate-600); }
.nav-link:hover { background: var(--slate-100); }
.nav-link.active { background: var(--teal-50); color: var(--teal-700); }
.more-menu { position: relative; }
.more-menu summary { list-style: none; padding: .5rem .75rem; border-radius: .6rem; font-size: .875rem; font-weight: 500; color: var(--slate-600); cursor: pointer; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu[open] summary { background: var(--slate-100); }
.more-dropdown { position: absolute; right: 0; top: 110%; background: #fff; border: 1px solid var(--slate-200); border-radius: .8rem; box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: .25rem; width: 12rem; }
.dropdown-link { display: block; width: 100%; text-align: left; background: none; border: none; padding: .5rem .75rem; font-size: .875rem; color: var(--slate-600); border-radius: .5rem; }
.dropdown-link:hover { background: var(--slate-50); }
.mobile-nav { border: 1px solid var(--slate-200); border-radius: .6rem; padding: .35rem .5rem; font-size: .875rem; }

@media (min-width: 768px) {
  .nav-primary { display: flex; }
  .mobile-nav { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.2rem; border-radius: .8rem; font-weight: 500; font-size: .95rem; border: 1px solid transparent; transition: all .15s; }
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-secondary { background: #fff; border-color: var(--slate-200); color: var(--slate-600); }
.btn-secondary:hover { border-color: var(--teal-600); }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; border-radius: .6rem; }
.link-btn { background: none; border: none; color: var(--teal-600); font-weight: 500; font-size: .875rem; padding: 0; }

/* Cards & layout */
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.25rem; transition: box-shadow .15s, transform .15s, border-color .15s; }
.card.clickable { text-align: left; cursor: pointer; width: 100%; }
.card.clickable:hover { border-color: var(--teal-600); box-shadow: 0 6px 16px rgba(0,0,0,0.06); transform: translateY(-2px); }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.grid-stats { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Page title */
.eyebrow { color: var(--teal-600); font-size: .85rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; margin: 0 0 .25rem; }
.page-title { font-size: 2rem; font-weight: 700; color: var(--slate-800); margin: 0 0 .5rem; }
.page-sub { color: var(--slate-500); max-width: 40rem; margin: 0; }
.page-header { margin-bottom: 2rem; }

/* Disclaimer */
.disclaimer { display: flex; gap: .5rem; align-items: flex-start; background: var(--amber-50); border: 1px solid var(--amber-200); color: var(--amber-900); border-radius: .8rem; padding: 1rem; font-size: .9rem; }
.disclaimer.compact { padding: .75rem; font-size: .85rem; }

/* Hero */
.hero { position: relative; overflow: hidden; border-radius: 1.5rem; background: linear-gradient(135deg, var(--teal-50), #fff, var(--emerald-50)); border: 1px solid var(--teal-100); padding: 3.5rem 1.5rem; margin-bottom: 2.5rem; text-align: center; }
.hero-content { position: relative; max-width: 40rem; margin: 0 auto; }
.hero h1 { font-size: 2.2rem; font-weight: 700; color: var(--slate-800); margin: .5rem 0 1rem; }
@media (min-width: 768px) { .hero h1 { font-size: 2.75rem; } }
.hero-blob { position: absolute; border-radius: 50%; opacity: .35; pointer-events: none; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.5rem; }

.stat-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--teal-700); margin: 0; }
.stat-label { font-size: .75rem; color: var(--slate-500); margin: 0; }

/* Ingredient / research pick boxes */
.pick-box { border-radius: var(--radius); padding: 1.1rem; }
.pick-box.best { background: var(--teal-50); border: 1px solid var(--teal-200); }
.pick-box.budget { background: var(--emerald-50); border: 1px solid var(--emerald-200); }
.pick-box.skip { background: var(--rose-50); border: 1px solid var(--rose-200); }
.pick-label { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 .25rem; }
.pick-box.best .pick-label { color: var(--teal-700); }
.pick-box.budget .pick-label { color: var(--emerald-700); }
.pick-box.skip .pick-label { color: var(--rose-700); }

/* Misc */
.section-title { font-size: 1.15rem; font-weight: 600; color: var(--slate-800); margin: 0 0 1rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
input[type="text"], input[type="number"], input[type="time"], select, textarea {
  border: 1px solid var(--slate-200); border-radius: .6rem; padding: .55rem .8rem; font-size: .9rem; font-family: inherit; width: 100%;
}
textarea { resize: vertical; min-height: 4rem; }
label.field { display: block; font-size: .875rem; color: var(--slate-600); }
.search-input { padding: .8rem 1rem; border-radius: .8rem; margin-bottom: 1.5rem; }
.progress-bar { width: 100%; background: var(--slate-100); border-radius: 999px; height: .5rem; margin-bottom: 1.5rem; overflow: hidden; }
.progress-fill { background: var(--teal-600); height: 100%; transition: width .2s; }
.accordion-item { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); overflow: hidden; margin-bottom: .75rem; }
.accordion-head { width: 100%; text-align: left; background: none; border: none; padding: 1rem 1.25rem; font-weight: 500; color: var(--slate-800); display: flex; justify-content: space-between; align-items: center; }
.accordion-body { padding: 0 1.25rem 1rem; font-size: .9rem; color: var(--slate-600); }
.streak-banner { background: var(--teal-50); border: 1px solid var(--teal-200); border-radius: var(--radius); padding: 1.25rem; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.streak-num { font-size: 1.6rem; font-weight: 700; color: var(--teal-700); margin: 0; }
.check-row { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--slate-600); padding: .3rem 0; }
.type-detail-box { text-align: left; }
.avoid-list, .helps-list { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.timeline-box { background: var(--teal-50); border: 1px solid var(--teal-200); color: var(--teal-700); border-radius: var(--radius); padding: 1rem; font-size: .9rem; margin-top: 1rem; }
.log-entry { background: #fff; border: 1px solid var(--slate-200); border-radius: .8rem; padding: .75rem 1rem; font-size: .875rem; display: flex; flex-wrap: wrap; gap: 0 1rem; margin-bottom: .5rem; }
.footer-note { font-size: .75rem; color: var(--slate-400); margin-top: 1rem; }
.site-footer { border-top: 1px solid var(--slate-200); margin-top: 3rem; padding: 2rem 0; }
a.source-link { color: var(--teal-600); font-size: .75rem; font-weight: 500; text-decoration: none; }
a.source-link:hover { text-decoration: underline; }

/* Skin Assistant chat widget */
.chat-fab {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 30;
  width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: var(--teal-600); color: #fff; border: none; font-size: 1.4rem;
  box-shadow: 0 8px 20px rgba(13,148,136,0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s;
}
.chat-fab:hover { background: var(--teal-700); transform: scale(1.05); }

.chat-panel {
  position: fixed; bottom: 5.5rem; right: 1.5rem; z-index: 30;
  width: min(22rem, calc(100vw - 2rem)); height: min(28rem, calc(100vh - 8rem));
  background: #fff; border: 1px solid var(--slate-200); border-radius: 1.1rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.15);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel.hidden { display: none; }
.chat-header {
  background: var(--teal-600); color: #fff; padding: .85rem 1rem;
  font-weight: 600; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.chat-close { background: none; border: none; color: #fff; font-size: 1rem; opacity: .85; }
.chat-close:hover { opacity: 1; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--slate-50); }
.chat-msg { max-width: 85%; padding: .55rem .8rem; border-radius: .9rem; font-size: .875rem; line-height: 1.4; }
.chat-msg.bot { background: #fff; border: 1px solid var(--slate-200); color: var(--slate-600); align-self: flex-start; border-bottom-left-radius: .25rem; }
.chat-msg.user { background: var(--teal-600); color: #fff; align-self: flex-end; border-bottom-right-radius: .25rem; }
.chat-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.chat-chip { background: var(--teal-50); border: 1px solid var(--teal-200); color: var(--teal-700); font-size: .75rem; padding: .3rem .6rem; border-radius: 999px; }
.chat-chip:hover { background: var(--teal-100); }
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--slate-200); flex-shrink: 0; background: #fff; }
.chat-form input { flex: 1; }
