/* ==========================================================================
   Cosmetics Intelligence Dashboard Design System
   Aesthetic: Dark Modern Luxury & Biotech Intelligence
   ========================================================================== */

:root {
  --font-main: 'Pretendard', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  
  /* HSL Color Palette */
  --bg-dark: hsl(222, 47%, 9%);
  --bg-card: hsl(220, 39%, 13%);
  --bg-card-hover: hsl(220, 35%, 17%);
  --bg-subtle: hsl(218, 30%, 18%);
  
  --border-subtle: hsl(220, 25%, 22%);
  --border-glow: hsl(156, 72%, 45%, 0.3);
  
  --text-main: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 75%);
  --text-muted: hsl(215, 16%, 52%);
  
  /* Accent Colors */
  --primary: hsl(156, 72%, 45%);        /* Biotech Emerald */
  --primary-glow: hsla(156, 72%, 45%, 0.25);
  --accent-purple: hsl(265, 89%, 66%);  /* Intelligence Violet */
  --accent-blue: hsl(205, 90%, 55%);    /* Data Blue */
  --accent-amber: hsl(38, 92%, 50%);    /* Warning Amber */
  --accent-red: hsl(0, 84%, 60%);       /* Hazard Red */
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: hsla(222, 47%, 9%, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 24px;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 26px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, hsl(156, 72%, 25%), hsl(220, 39%, 13%));
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

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

.status-dot.pulse {
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), hsl(156, 80%, 35%));
  color: hsl(222, 47%, 9%);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   Main Container & Section Titles
   ========================================================================== */

.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.section-header {
  margin-bottom: 20px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.badge-priority {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--primary);
}

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

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   KPI Metrics Grid
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: hsla(215, 20%, 45%, 0.5);
}

.kpi-card.highlight {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--bg-card), hsl(156, 50%, 12%));
}

.kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 8px;
  text-align: center;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

.accent-green .kpi-value { color: var(--primary); }
.accent-purple .kpi-value { color: var(--accent-purple); }
.accent-blue .kpi-value { color: var(--accent-blue); }

/* ==========================================================================
   Pipeline Control Block (Active vs History)
   ========================================================================== */

.pipeline-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 24px;
}

.pipeline-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.block-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.block-title h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.live-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-amber);
  animation: pulseGlow 1.5s infinite;
}

.completed-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: hsl(222, 47%, 9%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
}

.badge-active-count, .badge-history-count {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.site-cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#historySitesList {
  max-height: 440px; /* 현재 수집 중 박스의 약 2.1배 세로 길이 (최근 2개 여유 노출 + 내부 스크롤) */
  min-height: 200px;
  overflow-y: auto;
  padding-right: 6px;
  transition: max-height 0.3s ease;
}

#historySitesList::-webkit-scrollbar {
  width: 6px;
}

#historySitesList::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#historySitesList::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

#historySitesList::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.site-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.2s ease;
}

.site-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.site-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.site-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.site-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.site-status-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-status-badge.collecting {
  background: hsla(38, 92%, 50%, 0.15);
  color: var(--accent-amber);
  border: 1px solid hsla(38, 92%, 50%, 0.3);
}

.site-status-badge.completed {
  background: hsla(156, 72%, 45%, 0.15);
  color: var(--primary);
  border: 1px solid hsla(156, 72%, 45%, 0.3);
}

.site-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.metric-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.progress-bar-container {
  margin-top: 8px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--accent-blue));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ==========================================================================
   Explorer & Search Controls
   ========================================================================== */

/* ==========================================================================
   Shopping Mall Style Faceted Filters & Search Panel
   ========================================================================== */

.filter-dashboard-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.search-bar-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrap input {
  width: 100%;
  padding: 14px 44px 14px 48px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}

.search-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-primary-search {
  background: linear-gradient(135deg, var(--primary), hsl(156, 80%, 35%));
  color: hsl(222, 47%, 9%);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.filter-facets-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(0, 0, 0, 0.2);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.facet-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.facet-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 76px;
  padding-top: 5px;
  flex-shrink: 0;
}

.facet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.facet-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.facet-chip:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.facet-chip.active {
  background: var(--primary);
  color: hsl(222, 47%, 9%);
  border-color: var(--primary);
  font-weight: 800;
}

.facet-chip.highlight-chip.active {
  background: #f59e0b;
  color: #111827;
  border-color: #f59e0b;
}

.facet-chip.toggle-chip.active {
  background: hsl(265, 89%, 66%);
  color: #fff;
  border-color: hsl(265, 89%, 66%);
}

.facet-divider {
  color: var(--border-subtle);
  margin: 0 4px;
}

.active-filter-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.active-chips-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 9999px;
}

.active-filter-tag span.tag-close {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.active-filter-tag span.tag-close:hover {
  color: #fff;
}

.btn-reset-filters {
  background: none;
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-filters:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ==========================================================================
   Initial Empty Search State vs Result Cards
   ========================================================================== */

.initial-search-prompt {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-top: 20px;
}

.prompt-icon {
  font-size: 40px;
  margin-bottom: 14px;
}

.initial-search-prompt h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.initial-search-prompt p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 24px auto;
}

.quick-recommend-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-quick-search {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-quick-search:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.load-more-container {
  text-align: center;
  margin-top: 28px;
}

.btn-load-more {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 32px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-load-more:hover {
  background: var(--primary);
  color: hsl(222, 47%, 9%);
  border-color: var(--primary);
}

.cloud-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.cloud-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cloud-tag {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.cloud-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.cloud-tag.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* ==========================================================================
   Product Grid
   ========================================================================== */

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 12px 0;
}

.results-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sort-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sort-select-wrap select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  outline: none;
}

.product-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: hsla(156, 72%, 45%, 0.4);
}

.card-source-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.brand-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: 4px;
}

.channel-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.tag-hwahae { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.tag-sidmool { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.tag-bonajour { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.4;
  min-height: 48px;
}

.card-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.card-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}

.card-capacity {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-rating-badge {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
}

.card-ingredients-preview {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  flex: 1;
}

.preview-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.preview-tag {
  font-size: 0.72rem;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.hazard-info {
  display: flex;
  gap: 6px;
}

.hazard-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.hazard-badge.safe { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.hazard-badge.warn { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.btn-detail {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-detail:hover {
  background: var(--primary);
  color: hsl(222, 47%, 9%);
  border-color: var(--primary);
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-brand {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 700;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close-btn:hover { color: #fff; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-meta-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.modal-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.ingredients-table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ing-table th {
  background: var(--bg-subtle);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.ing-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.ing-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.ewg-grade-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.ewg-low { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.ewg-mid { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.ewg-high { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* ==========================================================================
   Analyzer & Crawler Scheduling Section
   ========================================================================== */

.section-analyzer {
  background: linear-gradient(135deg, hsl(220, 39%, 13%), hsl(222, 47%, 11%));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.analyzer-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.analyzer-input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.url-input-container {
  flex: 1;
  min-width: 300px;
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color 0.2s;
}

.url-input-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.url-prefix {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 6px;
  user-select: none;
}

.url-input-container input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  padding: 12px 0;
  outline: none;
}

.btn-analyze {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, hsl(205, 90%, 55%), hsl(220, 90%, 45%));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.preset-links-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.preset-label {
  color: var(--text-muted);
}

.btn-preset {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-preset:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.analyzer-result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 6px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.result-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-title-box h4 {
  font-size: 1.2rem;
  font-weight: 800;
}

.result-grade-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
}

.grade-a { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.grade-b { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.grade-c { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.btn-schedule-confirm {
  background: linear-gradient(135deg, var(--primary), hsl(156, 80%, 35%));
  color: hsl(222, 47%, 9%);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-schedule-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-ai-help {
  background: linear-gradient(135deg, var(--accent-purple), hsl(265, 80%, 55%));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ai-help:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.result-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.detail-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.result-reasons-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.reasons-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.reasons-list {
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-help-notice {
  background: hsla(0, 84%, 60%, 0.1);
  border: 1px solid hsla(0, 84%, 60%, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.ai-notice-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-red);
  margin-bottom: 6px;
}

#aiNoticeDesc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.ai-criteria-list {
  padding-left: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-sub {
  font-size: 0.75rem;
  margin-top: 4px;
}
