/* =============================================
   HealthyScan — Desktop-First Dark Theme CSS
   ============================================= */

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --card: #161616;
  --card-hover: #1c1c1c;
  --border: #222222;
  --border-light: #2a2a2a;
  --text: #f0f0f0;
  --text-sec: #888888;
  --text-muted: #555555;
  --green: #22c55e;
  --green-light: #4ade80;
  --green-glow: rgba(34, 197, 94, 0.15);
  --yellow: #eab308;
  --red: #ef4444;
  --purple: #8b5cf6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* =============================================
   HEADER
   ============================================= */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  user-select: none;
}

.logo span {
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
}

.logo strong {
  font-weight: 800;
  color: var(--green-light);
}

/* Search */
.search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

#main-search {
  width: 100%;
  height: 42px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  padding: 0 42px 0 44px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

#main-search::placeholder {
  color: var(--text-muted);
}

#main-search:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

#clear-search {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

#clear-search:hover {
  color: var(--text);
  background: var(--border);
}

#clear-search svg {
  width: 14px;
  height: 14px;
}

/* Filter Pills */
.filter-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn svg {
  width: 14px;
  height: 14px;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--card);
}

.filter-btn.active {
  color: var(--green-light);
  border-color: var(--green);
  background: var(--green-glow);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
#main-content {
  padding-top: 64px;
  min-height: 100vh;
}

/* Sections */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* =============================================
   HOME SECTION
   ============================================= */
.home-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 32px 80px;
}

.home-headline {
  text-align: center;
  margin-bottom: 48px;
}

.home-headline h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 12px;
}

.green-text {
  color: var(--green-light);
}

.home-sub {
  font-size: 18px;
  color: var(--text-sec);
  font-weight: 400;
}

/* Hero Cards */
.home-hero-cards {
  display: flex;
  gap: 24px;
  margin-bottom: 36px;
}

.hero-card {
  flex: 1;
  height: 220px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.hero-card:hover {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: 0 16px 48px rgba(34, 197, 94, 0.12);
}

.hero-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s;
}

.hero-card:hover .hero-card-bg {
  transform: scale(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,10,10,0.82) 0%, rgba(10,10,10,0.5) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-icon {
  width: 36px !important;
  height: 36px !important;
  color: var(--green-light);
  margin-bottom: 12px;
}

.hero-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.hero-content p {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 16px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 8px;
  width: fit-content;
  transition: background 0.2s;
}

.hero-btn svg {
  width: 14px;
  height: 14px;
}

.hero-card:hover .hero-btn {
  background: var(--green-light);
}

/* Tagline */
.home-tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 48px;
}

/* Feature items */
.home-features {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sec);
  font-size: 14px;
  font-weight: 500;
}

.feature-item svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

/* =============================================
   RESULTS SECTION
   ============================================= */
.results-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Result Card */
.result-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.25s, box-shadow 0.25s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.result-card:hover {
  border-color: var(--border-light);
  background: var(--card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.result-img-wrap {
  position: relative;
  width: 100%;
  height: 188px;
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
}

.result-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s;
}

.result-card:hover .result-img {
  transform: scale(1.05);
}

.result-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.result-img-placeholder svg { width: 40px; height: 40px; }

.result-score-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(10,10,10,0.82);
  backdrop-filter: blur(6px);
  border: 2.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.5px;
  z-index: 2;
}

.result-body {
  padding: 14px 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}

.result-desc {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.result-desc .desc-pos { color: var(--green-light); font-weight: 500; }
.result-desc .desc-neg { color: #f59e0b; font-weight: 500; }

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 18px;
}

.result-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(34,197,94,0.09);
  color: var(--green-light);
  border: 1px solid rgba(34,197,94,0.2);
}

.result-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.result-details-btn {
  font-size: 12px;
  font-weight: 600;
  color: #0a0a0a;
  background: var(--green);
  border: none;
  border-radius: 7px;
  padding: 7px 18px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.result-details-btn:hover {
  background: var(--green-light);
  transform: scale(1.03);
}

/* Loading state */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-sec);
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-sec);
  gap: 12px;
  text-align: center;
}

.empty-state svg {
  width: 56px;
  height: 56px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
}

/* =============================================
   DETAIL SECTION
   ============================================= */
.detail-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.detail-topbar {
  margin-bottom: 28px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sec);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.back-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--card);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

/* Detail loading */
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  gap: 16px;
  color: var(--text-sec);
}

/* Detail layout grid */
#detail-content {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  align-items: start;
}

/* LEFT COLUMN */
.detail-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-product-img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  object-fit: contain;
  max-height: 340px;
}

.detail-img-placeholder {
  width: 100%;
  height: 260px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
}

.detail-img-placeholder svg {
  width: 56px;
  height: 56px;
}

.detail-product-info {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.detail-product-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
}

.detail-product-brand {
  font-size: 14px;
  color: var(--text-sec);
  margin-bottom: 12px;
}

.analyzed-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-glow);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analyzed-label svg {
  width: 11px;
  height: 11px;
}

/* Ingredients collapsible */
.ing-raw-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ing-raw-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
}

.ing-raw-toggle:hover {
  color: var(--text);
}

.ing-raw-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s;
}

.ing-raw-toggle.open svg {
  transform: rotate(180deg);
}

.ing-raw-text {
  display: none;
  padding: 0 18px 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.ing-raw-text.open {
  display: block;
}

/* RIGHT COLUMN */
.detail-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Gauge & Score card */
.score-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.gauge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gauge-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-score {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}

.gauge-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 3px;
}

.score-info {
  flex: 1;
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.verdict-badge .verdict-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.verdict-desc {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.6;
}

/* Nutrition Grid */
.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nutrition-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.nutrition-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.nutrition-header svg {
  width: 15px;
  height: 15px;
}

.nutrition-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nutrition-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.nutrition-value span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.nutrition-bar-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.nutrition-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

/* Ingredient Breakdown */
.ing-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.ing-item:hover {
  background: var(--surface);
  border-color: var(--border);
}

.ing-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ing-icon.good {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-light);
}

.ing-icon.bad {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.ing-icon.moderate {
  background: rgba(234, 179, 8, 0.12);
  color: var(--yellow);
}

.ing-icon svg {
  width: 15px;
  height: 15px;
}

.ing-text {
  flex: 1;
  min-width: 0;
}

.ing-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ing-desc-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.ing-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.ing-tag.good {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-light);
}

.ing-tag.bad {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.ing-tag.moderate {
  background: rgba(234, 179, 8, 0.12);
  color: var(--yellow);
}

.show-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.show-more-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--card-hover);
}

.show-more-btn svg {
  width: 14px;
  height: 14px;
}

/* Alternatives */
.alt-scroll {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 4px 0 10px;
  scrollbar-width: thin;
}

.alt-card {
  flex: 0 0 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  text-align: center;
}

.alt-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.alt-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto 8px;
  border-radius: 6px;
}

.alt-name {
  font-size: 11px;
  color: var(--text-sec);
  line-height: 1.35;
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.alt-score {
  font-size: 13px;
  font-weight: 700;
}

/* COSMETIC: Expandable ingredient rows */
.cosmetic-ing-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 6px;
  transition: border-color 0.2s;
}

.cosmetic-ing-item:hover {
  border-color: var(--border-light);
}

.cosmetic-ing-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  background: var(--surface);
  user-select: none;
}

.cosmetic-ing-expand {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.25s;
}

.cosmetic-ing-expand svg {
  width: 14px;
  height: 14px;
}

.cosmetic-ing-item.open .cosmetic-ing-expand svg {
  transform: rotate(180deg);
}

.cosmetic-ing-body {
  display: none;
  padding: 10px 14px 12px 56px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.cosmetic-ing-item.open .cosmetic-ing-body {
  display: block;
}

/* Skin Type Grid */
.skin-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.skin-type-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.skin-type-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}

.skin-type-icon.ok {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-light);
}

.skin-type-icon.warn {
  background: rgba(234, 179, 8, 0.12);
  color: var(--yellow);
}

.skin-type-icon.bad {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.skin-type-icon svg {
  width: 16px;
  height: 16px;
}

.skin-type-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.skin-type-compat {
  font-size: 11px;
}

.skin-type-compat.ok { color: var(--green-light); }
.skin-type-compat.warn { color: var(--yellow); }
.skin-type-compat.bad { color: var(--red); }

/* Safety Bars */
.safety-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.safety-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.safety-bar-label {
  font-size: 13px;
  color: var(--text-sec);
  width: 120px;
  flex-shrink: 0;
  font-weight: 500;
}

.safety-bar-track {
  flex: 1;
  height: 7px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.safety-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

.safety-bar-value {
  font-size: 12px;
  font-weight: 700;
  width: 36px;
  text-align: right;
}

/* =============================================
   NOT FOUND SECTION
   ============================================= */
.not-found-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 40px 20px;
  gap: 16px;
  text-align: center;
}

.nf-icon {
  width: 80px !important;
  height: 80px !important;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.not-found-inner h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.not-found-inner p {
  font-size: 16px;
  color: var(--text-sec);
}

/* =============================================
   COMMON COMPONENTS
   ============================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 10px;
  transition: background 0.2s, transform 0.15s;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

.btn-primary svg {
  width: 15px;
  height: 15px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Summary stats row */
.ing-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.ing-stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
}

.ing-stat-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 3px;
}

.ing-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ing-stat-value.good { color: var(--green-light); }
.ing-stat-value.moderate { color: var(--yellow); }
.ing-stat-value.bad { color: var(--red); }

/* =============================================
   RESPONSIVE — TABLET
   ============================================= */
@media (max-width: 1024px) {
  .header-inner {
    padding: 0 20px;
    gap: 16px;
  }

  .search-wrap {
    max-width: 320px;
  }

  #detail-content {
    grid-template-columns: 300px 1fr;
    gap: 24px;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #detail-content {
    grid-template-columns: 1fr;
  }

  .detail-left {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }

  .detail-product-img {
    max-height: 260px;
  }

  .skin-type-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    gap: 10px;
  }
}

/* =============================================
   DETAIL PAGE (dp-*) — uses the website's own design
   ============================================= */

#detail-content { display: block !important; grid-template-columns: unset !important; }

.dp-page {
  max-width: 860px;
  margin: 0 auto;
  padding-bottom: 80px;
}

/* Hero */
.dp-hero {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.dp-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dp-hero-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 10%, rgba(0,0,0,0.55) 55%, #000 100%);
}
.dp-hero-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 22px 28px;
}
.dp-hero-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.dp-hero-name {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-transform: uppercase;
}
.dp-hero-noimg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dp-hero-noimg svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Gauge */
.dp-gauge-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.gauge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gauge-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gauge-score {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
}
.gauge-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Verdict */
.dp-verdict-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 28px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.dp-verdict-badge {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #000;
  padding: 8px 26px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.dp-brand {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.dp-verdict-desc {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.6;
  max-width: 520px;
}

/* Section cards */
.dp-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  margin-bottom: 12px;
  overflow: hidden;
}
.dp-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Ingredient summary stats */
.dp-ing-summary {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dp-ing-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-right: 1px solid var(--border);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  background: var(--surface);
}
.dp-ing-stat:last-child { border-right: none; }
.dp-ing-stat span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 6px;
  text-transform: uppercase;
}
.dp-ing-stat.good { color: #4ADE80; }
.dp-ing-stat.moderate { color: #FACC15; }
.dp-ing-stat.bad { color: #F87171; }

/* Bento grid */
.dp-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.dp-bento-cell {
  background: var(--surface);
  padding: 14px 14px 12px;
}
.dp-bento-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dp-bento-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-bottom: 10px;
}
.dp-bento-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.dp-bento-bar {
  height: 3px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}
.dp-bento-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 1.1s cubic-bezier(0.4,0,0.2,1);
}

/* Ingredient rows */
.dp-ing-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dp-ing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.dp-ing-row:last-child { border-bottom: none; }
.dp-ing-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dp-ing-icon svg { width: 14px; height: 14px; }
.dp-ing-icon.good     { background: rgba(74,222,128,0.18); color: #4ade80; }
.dp-ing-icon.moderate { background: rgba(250,204,21,0.18);  color: #FACC15; }
.dp-ing-icon.bad      { background: rgba(248,113,113,0.18); color: #F87171; }
.dp-ing-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}
.dp-ing-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.dp-ing-tag.good     { background: rgba(74,222,128,0.15); color: #4ade80; }
.dp-ing-tag.moderate { background: rgba(250,204,21,0.15);  color: #FACC15; }
.dp-ing-tag.bad      { background: rgba(248,113,113,0.15); color: #F87171; }

/* Show more */
.dp-show-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--green-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background 0.15s;
}
.dp-show-more:hover { background: var(--card-hover); }

/* Cosmetic expandable ingredient rows */
.dp-cosmetic-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dp-cosmetic-item {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  transition: background 0.15s;
}
.dp-cosmetic-item.no-expand { cursor: default; }
.dp-cosmetic-item:last-child { border-bottom: none; }
.dp-cosmetic-item:hover:not(.no-expand) { background: var(--card-hover); }
.dp-cosmetic-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}
.dp-cosmetic-expand { color: var(--text-muted); margin-left: auto; }
.dp-cosmetic-expand svg { width: 14px; height: 14px; transition: transform 0.2s; }
.dp-cosmetic-item.open .dp-cosmetic-expand svg { transform: rotate(180deg); }
.dp-cosmetic-body {
  display: none;
  padding: 0 14px 13px 58px;
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.65;
}
.dp-cosmetic-item.open .dp-cosmetic-body { display: block; }

/* Skin grid */
.dp-skin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dp-skin-cell {
  background: var(--surface);
  padding: 14px 10px;
  text-align: center;
}
.dp-skin-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 5px;
}
.dp-skin-compat { font-size: 11px; font-weight: 700; }
.dp-skin-compat.ok   { color: #4ADE80; }
.dp-skin-compat.warn { color: #FACC15; }
.dp-skin-compat.bad  { color: #F87171; }

/* Safety bars */
.dp-safety-list { display: flex; flex-direction: column; gap: 14px; }
.dp-safety-bar-item { display: flex; align-items: center; gap: 12px; }
.dp-safety-bar-label { font-size: 12px; color: var(--text-sec); width: 140px; flex-shrink: 0; }
.dp-safety-bar-track { flex: 1; height: 4px; background: var(--border-light); border-radius: 2px; overflow: hidden; }
.dp-safety-bar-fill { height: 100%; width: 0; border-radius: 2px; transition: width 1.1s ease; }
.dp-safety-bar-val { font-size: 12px; font-weight: 700; width: 30px; text-align: right; flex-shrink: 0; }

/* Alternatives */
.dp-alts {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.dp-alts::-webkit-scrollbar { display: none; }
.dp-alts .alt-card {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 160px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.dp-alts .alt-card:hover { border-color: var(--green); }
.dp-alts .alt-card img { width: 100%; height: 100px; object-fit: cover; background: var(--border); }
.dp-alts .alt-card-info { padding: 10px 10px 12px; }
.dp-alts .alt-card-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: 4px; }
.dp-alts .alt-card-score { font-size: 11px; font-weight: 700; }

/* Raw ingredients toggle */
.dp-raw-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.dp-raw-toggle svg { width: 16px; height: 16px; transition: transform 0.2s; }
.dp-raw-toggle.open svg { transform: rotate(180deg); }
.dp-raw-text {
  display: none;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}
.dp-raw-text.open { display: block; }

/* Responsive — detail page */
@media (max-width: 600px) {
  .dp-hero { height: 220px; }
  .dp-skin-grid { grid-template-columns: repeat(2, 1fr); }
  .dp-bento-val { font-size: 22px; }
  .gauge-score { font-size: 42px; }
}

/* Responsive — main layout */
@media (max-width: 600px) {
  .logo span { font-size: 16px; }
  .search-wrap { max-width: 100%; flex: 1; }
  .filter-group { display: none; }
  .home-headline h1 { font-size: 36px; }
  .home-inner { padding: 32px 16px 48px; }
  .home-hero-cards { flex-direction: column; }
  .hero-card { height: 180px; }
  .results-grid { grid-template-columns: 1fr; }
  .results-inner, .detail-inner { padding: 16px 16px 48px; }
  .home-features { gap: 20px; }
}
