/* =========================================
   LIPIDCOACH — STYLES
   Design: Medical-tech, dark-first, refined
   ========================================= */

:root {
  --bg: #0a0f1a;
  --bg2: #111827;
  --bg3: #1a2236;
  --card: #151e2e;
  --card-border: rgba(255,255,255,0.07);
  --text: #e8edf5;
  --text2: #8a9ab5;
  --text3: #5a6a85;
  --green: #4ade80;
  --green-dim: rgba(74,222,128,0.12);
  --cyan: #22d3ee;
  --yellow: #f59e0b;
  --yellow-dim: rgba(245,158,11,0.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font-display: 'DM Serif Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --header-h: 60px;
  --nav-h: 68px;
}

[data-theme="light"] {
  --bg: #f0f4f8;
  --bg2: #e8edf5;
  --bg3: #dde4ef;
  --card: #ffffff;
  --card-border: rgba(0,0,0,0.08);
  --text: #1a2236;
  --text2: #4a5a75;
  --text3: #8a9ab5;
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
}

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

html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ===== SPLASH ===== */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(145deg, #0a0f1a 0%, #0f2027 50%, #0a1628 100%);
  display: flex; align-items: center; justify-content: center;
}
.splash-inner {
  text-align: center;
  animation: splashIn 0.8s ease forwards;
}
@keyframes splashIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.logo-mark { width: 80px; height: 80px; margin: 0 auto 20px; }
.splash-title {
  font-family: var(--font-display);
  font-size: 3rem;
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.splash-sub { color: var(--text2); font-size: 1.1rem; margin-bottom: 20px; }
.splash-features {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 28px;
}
.splash-features span {
  background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.25);
  border-radius: 50px; padding: 6px 14px;
  font-size: 0.82rem; color: var(--green);
}
.splash-legal {
  margin-top: 14px; font-size: 0.78rem;
  color: var(--text3); text-align: center;
}
.splash-title-accent { color: #4ade80; -webkit-text-fill-color: #4ade80; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  color: #0a0f1a;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.full { width: 100%; text-align: center; }
.btn-small {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--text2);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--bg3); }
.icon-btn-large {
  background: var(--bg3);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 48px; height: 48px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn-large:hover { border-color: var(--green); }
.icon-btn-large.recording { background: var(--red-dim); border-color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(10,15,26,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}
[data-theme="light"] .header { background: rgba(240,244,248,0.85); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 20px;
  max-width: 600px; margin: 0 auto;
}
.logo-small { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.2rem; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.score-badge {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg3);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 4px 12px;
}
.score-num { font-size: 1.1rem; font-weight: 600; color: var(--green); line-height: 1; }
.score-label { font-size: 0.65rem; color: var(--text3); }

/* ===== NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(10,15,26,0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  max-width: 600px; margin: 0 auto;
}
[data-theme="light"] .bottom-nav { background: rgba(240,244,248,0.92); }
.nav-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text3); font-size: 0.7rem; font-family: var(--font-body);
  transition: color 0.2s; padding: 8px 0;
}
.nav-btn .nav-icon { font-size: 1.3rem; }
.nav-btn.active { color: var(--green); }
.nav-btn:hover { color: var(--text); }

/* ===== MAIN CONTENT ===== */
.main-content {
  padding-top: calc(var(--header-h) + 16px);
  padding-bottom: calc(var(--nav-h) + 16px);
  padding-left: 16px;
  padding-right: 16px;
  max-width: 600px;
  margin: 0 auto;
}
.hidden { display: none !important; }
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ===== SECTION HEADER ===== */
.section-header { margin-bottom: 20px; }
.section-title { font-family: var(--font-display); font-size: 1.8rem; color: var(--text); }
.section-sub { color: var(--text2); font-size: 0.9rem; margin-top: 4px; }

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card.full-width { grid-column: 1 / -1; }
.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-label { font-size: 0.75rem; color: var(--text2); margin-bottom: 6px; }
.stat-value { font-size: 1rem; font-weight: 600; }

/* Progress Ring */
.progress-ring-container { position: relative; width: 80px; height: 80px; margin: 12px auto 0; }
.progress-ring { width: 80px; height: 80px; }
.progress-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; line-height: 1;
}
.progress-text small { font-size: 0.7rem; color: var(--text2); }

/* ===== TIPS ===== */
.tip-card { border-left: 3px solid var(--cyan); }
.tip-header { font-size: 0.8rem; font-weight: 600; color: var(--cyan); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.tip-text { font-size: 0.95rem; color: var(--text2); line-height: 1.6; }

/* ===== MODE CARD ===== */
.mode-card {
  display: flex; align-items: center; gap: 16px; cursor: pointer;
  transition: border-color 0.2s;
}
.mode-card:hover { border-color: var(--yellow); }
.mode-icon { font-size: 2rem; }
.mode-title { font-weight: 600; font-size: 0.95rem; }
.mode-sub { font-size: 0.8rem; color: var(--text2); margin-top: 2px; }
.mode-arrow { margin-left: auto; font-size: 1.2rem; color: var(--text3); }

/* ===== MEAL LIST ===== */
.meal-list { display: flex; flex-direction: column; gap: 10px; }
.meal-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  background: var(--bg3);
}
.meal-item-icon { font-size: 1.3rem; }
.meal-item-info { flex: 1; }
.meal-item-name { font-size: 0.9rem; font-weight: 500; }
.meal-item-type { font-size: 0.75rem; color: var(--text2); }
.meal-item-score {
  font-weight: 700; font-size: 1rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.score-green { background: var(--green-dim); color: var(--green); }
.score-yellow { background: var(--yellow-dim); color: var(--yellow); }
.score-red { background: var(--red-dim); color: var(--red); }

.empty-state { text-align: center; padding: 24px; color: var(--text3); }
.empty-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }
.empty-state p { font-size: 0.9rem; line-height: 1.6; }

/* ===== REGISTER ===== */
.meal-type-selector {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.meal-type-btn {
  flex: 1; min-width: 80px;
  background: var(--bg3); border: 1px solid var(--card-border);
  border-radius: 50px; padding: 8px 4px;
  font-size: 0.78rem; font-family: var(--font-body); color: var(--text2);
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.meal-type-btn.active {
  background: var(--green-dim); border-color: var(--green); color: var(--green); font-weight: 600;
}
.input-area { display: flex; flex-direction: column; gap: 12px; }
.meal-textarea {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
  padding: 14px; resize: vertical; outline: none;
  transition: border-color 0.2s;
}
.meal-textarea:focus { border-color: var(--green); }
.meal-textarea::placeholder { color: var(--text3); }
.input-actions { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }

/* ===== ANALYSIS RESULT ===== */
.analysis-result { animation: fadeIn 0.4s ease; }
.result-card { border-color: rgba(74,222,128,0.2); }
.result-header { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.result-score-wrap { display: flex; align-items: baseline; gap: 4px; }
.result-score {
  font-family: var(--font-display); font-size: 3.5rem; line-height: 1;
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.result-score-label { font-size: 1.2rem; color: var(--text2); }
.result-effects { display: flex; flex-direction: column; gap: 6px; }
.effect-pill {
  padding: 4px 14px; border-radius: 50px; font-size: 0.8rem; font-weight: 600;
  background: var(--bg3); border: 1px solid var(--card-border); color: var(--text2);
}
.effect-pill.good { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.effect-pill.neutral { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); }
.effect-pill.bad { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.result-foods { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.food-tag {
  padding: 4px 12px; border-radius: 50px;
  font-size: 0.8rem; background: var(--bg3); border: 1px solid var(--card-border); color: var(--text2);
}
.result-comment {
  font-size: 0.9rem; color: var(--text2); line-height: 1.6;
  padding: 12px; background: var(--bg3); border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.compensation-box {
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(34,211,238,0.08));
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px;
}
.comp-title { font-size: 0.8rem; font-weight: 700; color: var(--yellow); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.comp-text { font-size: 0.9rem; color: var(--text2); line-height: 1.6; }

/* ===== FOOD SEARCH ===== */
.search-input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 0.9rem;
  padding: 12px 14px; outline: none; margin-bottom: 12px;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--cyan); }
.food-results { display: flex; flex-direction: column; gap: 8px; }
.food-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--card-border);
  cursor: pointer; transition: border-color 0.2s;
}
.food-result-item:hover { border-color: var(--cyan); }
.food-traffic {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.food-traffic.green { background: var(--green); }
.food-traffic.yellow { background: var(--yellow); }
.food-traffic.red { background: var(--red); }
.food-name { flex: 1; font-size: 0.88rem; font-weight: 500; }
.food-meta { font-size: 0.75rem; color: var(--text3); text-align: right; }

/* ===== PLANNER ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text2); margin-bottom: 8px; font-weight: 500; }
.form-input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
  padding: 12px 14px; outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--green); }
.range-wrap { display: flex; align-items: center; gap: 12px; }
.range-input { flex: 1; accent-color: var(--green); }

.weekly-plan { animation: fadeIn 0.4s ease; }
.day-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.day-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg3);
  cursor: pointer;
}
.day-name { font-weight: 600; font-size: 0.95rem; }
.day-score { font-size: 0.8rem; color: var(--green); }
.day-meals { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.plan-meal { }
.plan-meal-type { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cyan); font-weight: 600; margin-bottom: 4px; }
.plan-meal-text { font-size: 0.9rem; color: var(--text2); line-height: 1.5; }

/* ===== BLOOD ANALYSIS ===== */
.blood-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.blood-field label { display: block; font-size: 0.8rem; color: var(--text2); margin-bottom: 6px; }
.chart-container { position: relative; height: 200px; margin: 12px 0; }
.chart-legend { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text2); margin-bottom: 8px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.empty-state-small { text-align: center; padding: 40px; color: var(--text3); font-size: 0.9rem; }
.alerts-container { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.alert-item {
  display: flex; gap: 10px; padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 0.85rem;
}
.alert-item.warning { background: var(--yellow-dim); border: 1px solid rgba(245,158,11,0.3); color: var(--yellow); }
.alert-item.good { background: var(--green-dim); border: 1px solid rgba(74,222,128,0.3); color: var(--green); }
.alert-item.danger { background: var(--red-dim); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }

/* ===== HISTORY ===== */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.filter-tab {
  flex: 1; padding: 8px; border-radius: 50px;
  background: var(--card); border: 1px solid var(--card-border);
  color: var(--text2); font-family: var(--font-body); font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s;
}
.filter-tab.active { background: var(--green-dim); border-color: var(--green); color: var(--green); font-weight: 600; }
.stats-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.summary-stat { text-align: center; }
.summary-num { font-size: 1.5rem; font-weight: 700; color: var(--green); }
.summary-lbl { font-size: 0.75rem; color: var(--text2); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-day-group { }
.history-day-label {
  font-size: 0.8rem; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 4px; margin-top: 8px;
}
.history-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 6px;
}

/* ===== MODAL ===== */
.modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
}
.modal-content {
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 600px; margin: 0 auto;
  max-height: 85vh; overflow-y: auto;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 0; margin-bottom: 16px;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }
.modal-header button { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text2); }
.modal-body { padding: 0 20px 20px; }
.venue-selector { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.venue-btn {
  flex: 1; min-width: 100px; padding: 10px 8px;
  background: var(--bg3); border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); color: var(--text2);
  font-family: var(--font-body); font-size: 0.82rem; cursor: pointer;
  transition: all 0.2s; text-align: center;
}
.venue-btn.active { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); font-weight: 600; }
.venue-options { display: flex; flex-direction: column; gap: 10px; }
.venue-option {
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--card-border);
  display: flex; align-items: center; gap: 12px;
}
.venue-option-traffic {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.venue-option-name { font-size: 0.9rem; font-weight: 600; flex: 1; }
.venue-option-note { font-size: 0.8rem; color: var(--text2); }
.venue-option-score { font-size: 0.85rem; font-weight: 600; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 50px; padding: 12px 24px;
  font-size: 0.9rem; box-shadow: var(--shadow);
  z-index: 600; white-space: nowrap;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn { from{opacity:0;transform:translateX(-50%) translateY(20px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }

/* ===== APP CONTAINER ===== */
.app {
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* ===== LOADING SPINNER ===== */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 24px; gap: 12px; color: var(--text2);
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--card-border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  .bottom-nav { left: 50%; transform: translateX(-50%); border-radius: var(--radius) var(--radius) 0 0; }
}

/* ===== SCANNER ===== */
.scanner-card { padding: 0; overflow: hidden; }
.scanner-viewfinder {
  position: relative; width: 100%;
  aspect-ratio: 1 / 1; background: #000;
  overflow: hidden;
}
#scannerVideo {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.scanner-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
}
.scanner-frame {
  position: relative;
  width: 65%; aspect-ratio: 1 / 1;
}
.scanner-corner {
  position: absolute; width: 24px; height: 24px;
  border-color: var(--green); border-style: solid;
}
.scanner-corner.tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.scanner-corner.tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.scanner-corner.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.scanner-corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.scanner-line {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  animation: scanLine 2s ease-in-out infinite;
}
@keyframes scanLine {
  0%   { top: 10%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 90%; opacity: 0; }
}
.scanner-hint {
  font-size: 0.8rem; color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5); padding: 6px 14px;
  border-radius: 50px; backdrop-filter: blur(4px);
}
.scanner-actions { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.product-card { animation: fadeIn 0.4s ease; }
.product-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.product-traffic-big {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
}
.product-traffic-big.green { background: var(--green-dim); border: 2px solid var(--green); }
.product-traffic-big.yellow { background: var(--yellow-dim); border: 2px solid var(--yellow); }
.product-traffic-big.red { background: var(--red-dim); border: 2px solid var(--red); }
.product-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.product-brand { font-size: 0.82rem; color: var(--text2); }
.product-verdict { font-size: 0.88rem; font-weight: 600; margin-top: 4px; }
.product-verdict.green { color: var(--green); }
.product-verdict.yellow { color: var(--yellow); }
.product-verdict.red { color: var(--red); }
.product-nutrients {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 8px; margin-bottom: 16px;
}
.nutrient-box {
  background: var(--bg3); border-radius: var(--radius-sm);
  padding: 10px; text-align: center;
}
.nutrient-val { font-size: 1.1rem; font-weight: 700; }
.nutrient-lbl { font-size: 0.7rem; color: var(--text2); margin-top: 2px; }
.product-advice {
  font-size: 0.88rem; color: var(--text2); line-height: 1.6;
  padding: 12px; background: var(--bg3); border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.scan-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--card-border);
}
.scan-item:last-child { border-bottom: none; }
.scan-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.scan-dot.green { background: var(--green); }
.scan-dot.yellow { background: var(--yellow); }
.scan-dot.red { background: var(--red); }
.scan-name { flex: 1; font-size: 0.88rem; font-weight: 500; }
.scan-score { font-size: 0.82rem; color: var(--text2); }

/* ===== AUTH SCREEN ===== */
.auth-screen {
  position: fixed; inset: 0; z-index: 900;
  background: var(--bg);
  overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px;
}
.auth-inner {
  width: 100%; max-width: 400px;
  animation: fadeIn 0.4s ease;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  font-family: var(--font-display); font-size: 1.5rem;
  margin-bottom: 28px; color: var(--text);
}
.auth-logo strong { color: var(--green); }
.auth-tabs {
  display: flex; background: var(--bg3);
  border-radius: 50px; padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 10px;
  border: none; background: none;
  border-radius: 50px; cursor: pointer;
  font-family: var(--font-body); font-size: 0.9rem;
  color: var(--text2); transition: all 0.2s;
}
.auth-tab.active {
  background: var(--card); color: var(--text);
  font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.auth-form { animation: fadeIn 0.3s ease; }
.auth-legal {
  font-size: 0.75rem; color: var(--text3);
  text-align: center; margin-top: 12px; line-height: 1.6;
}
.auth-legal a { color: var(--cyan); text-decoration: none; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text3); font-size: 0.82rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--card-border);
}
.btn-social {
  width: 100%; padding: 13px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 50px; cursor: pointer;
  font-family: var(--font-body); font-size: 0.92rem;
  color: var(--text); font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}
.btn-social:hover { border-color: var(--green); }
.btn-ghost {
  width: 100%; padding: 10px; margin-top: 8px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.85rem;
  color: var(--text3); text-align: center;
}
.btn-ghost:hover { color: var(--cyan); }
.auth-premium-note {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: linear-gradient(135deg, rgba(74,222,128,0.08), rgba(34,211,238,0.08));
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.8rem; color: var(--text2); margin-top: 4px;
}

/* ===== USER MENU (header) ===== */
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-dim); border: 1px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: var(--green);
  cursor: pointer;
}
.premium-chip {
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  color: #0a0f1a; font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 50px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
