@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=VT323&display=swap');

:root {
  --bg:          #fdf6ec;
  --bg-page:     #f5ede0;
  --surface:     #fff8ee;
  --border:      #d4a96a;
  --border-dark: #c47d2a;
  --accent:      #f4a94e;
  --accent-dark: #c47d2a;
  --text:        #4a3010;
  --text-muted:  #a07840;
  --shadow:      2px 2px 0 #d4a96a;
  --shadow-lg:   3px 3px 0 #c47d2a;

  --uv-low:       #5a9e5a;
  --uv-low-bg:    #f4fff4;
  --uv-mod:       #c9a227;
  --uv-mod-bg:    #fffdf0;
  --uv-high:      #d4714a;
  --uv-high-bg:   #fff8f4;
  --uv-vhigh:     #c94a4a;
  --uv-vhigh-bg:  #fff4f4;
  --uv-ext:       #8a4ac9;
  --uv-ext-bg:    #fbf4ff;

  --font-body:    'Nunito', sans-serif;
  --font-pixel:   'VT323', monospace;
  --radius:       10px;
  --radius-lg:    16px;
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

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

body {
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  overscroll-behavior: none;
}

.vt { font-family: var(--font-pixel); letter-spacing: 1px; }

/* ── NAVBAR ───────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--accent);
  border-bottom: 3px solid var(--accent-dark);
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-pixel);
  font-size: 22px;
  color: var(--surface);
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 #8a4a00;
}

.nav-loc {
  font-size: 11px;
  font-weight: 700;
  color: var(--surface);
  background: rgba(0,0,0,0.15);
  padding: 3px 10px;
  border-radius: 20px;
}

.nav-user {
  font-size: 11px;
  font-weight: 700;
  color: var(--surface);
  background: rgba(0,0,0,0.15);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── BOTTOM TAB BAR ───────────────────────────────────────────────────────── */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--accent);
  border-top: 3px solid var(--accent-dark);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  padding-bottom: calc(6px + var(--safe-bottom));
  z-index: 200;
}

.tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}

.tab-link.active { background: var(--surface); }

.tab-icon { font-size: 18px; }

.tab-label {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--surface);
  letter-spacing: 1px;
}

.tab-link.active .tab-label { color: var(--accent-dark); }

/* ── CONTAINER ────────────────────────────────────────────────────────────── */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 14px calc(80px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── CARDS ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.card-lg {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--accent-dark);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 2px;
  background: var(--accent);
  color: var(--surface);
  border: 3px solid var(--accent-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 16px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  display: block;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
}

.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--accent-dark); }

.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.btn-sm {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 1px;
  background: var(--accent);
  color: var(--surface);
  border: 2px solid var(--accent-dark);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--accent-dark);
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-sm:active { transform: translate(2px,2px); box-shadow: none; }

/* ── FORMS ────────────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.form-label {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-page);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-dark);
}

.form-textarea { resize: vertical; min-height: 80px; }

/* ── TOGGLE ───────────────────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed #e8d0a0;
}

.toggle-row:last-child { border-bottom: none; }

.toggle-info {}
.toggle-lbl { font-family: var(--font-pixel); font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }
.toggle-sub { font-size: 9px; color: #b89060; margin-top: 1px; }

input[type="checkbox"].toggle {
  width: 40px; height: 22px;
  appearance: none;
  background: var(--border);
  border: 2px solid var(--accent-dark);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

input[type="checkbox"].toggle:checked { background: var(--uv-low); border-color: #3a7a3a; }

input[type="checkbox"].toggle::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  background: var(--surface);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform 0.2s;
}

input[type="checkbox"].toggle:checked::after { transform: translateX(18px); }

/* ── ALERTS ───────────────────────────────────────────────────────────────── */
.alert {
  border: 2px solid var(--uv-vhigh);
  border-radius: var(--radius-lg);
  background: var(--uv-vhigh-bg);
  box-shadow: 2px 2px 0 var(--uv-vhigh);
  padding: 10px 12px;
  display: none;
  align-items: flex-start;
  gap: 8px;
}

.alert.visible { display: flex; }

.alert-badge {
  background: var(--uv-vhigh);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 13px;
  padding: 1px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.alert-msg { font-size: 11px; font-weight: 700; color: #8a2020; line-height: 1.5; }

/* ── UV HERO ──────────────────────────────────────────────────────────────── */
.uv-hero {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s, background 0.4s;
}

.uv-hero.uv-low   { border-color: var(--uv-low);   background: var(--uv-low-bg);   box-shadow: 3px 3px 0 var(--uv-low); }
.uv-hero.uv-mod   { border-color: var(--uv-mod);   background: var(--uv-mod-bg);   box-shadow: 3px 3px 0 var(--uv-mod); }
.uv-hero.uv-high  { border-color: var(--uv-high);  background: var(--uv-high-bg);  box-shadow: 3px 3px 0 var(--uv-high); }
.uv-hero.uv-vhigh { border-color: var(--uv-vhigh); background: var(--uv-vhigh-bg); box-shadow: 3px 3px 0 var(--uv-vhigh); }
.uv-hero.uv-ext   { border-color: var(--uv-ext);   background: var(--uv-ext-bg);   box-shadow: 3px 3px 0 var(--uv-ext); }

.sun-sprite {
  width: 80px; height: 80px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.uv-eyebrow {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.uv-number {
  font-family: var(--font-pixel);
  font-size: 64px;
  line-height: 1;
  transition: color 0.4s;
}

.uv-number.uv-low   { color: var(--uv-low); }
.uv-number.uv-mod   { color: var(--uv-mod); }
.uv-number.uv-high  { color: var(--uv-high); }
.uv-number.uv-vhigh { color: var(--uv-vhigh); }
.uv-number.uv-ext   { color: var(--uv-ext); }

.uv-category {
  font-family: var(--font-pixel);
  font-size: 18px;
  letter-spacing: 1px;
  transition: color 0.4s;
}

.uv-category.uv-low   { color: var(--uv-low); }
.uv-category.uv-mod   { color: var(--uv-mod); }
.uv-category.uv-high  { color: var(--uv-high); }
.uv-category.uv-vhigh { color: var(--uv-vhigh); }
.uv-category.uv-ext   { color: var(--uv-ext); }

/* ── REC CARDS ────────────────────────────────────────────────────────────── */
.rec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rec-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 10px;
}

.rec-icon  { font-size: 20px; margin-bottom: 4px; display: block; }
.rec-label { font-family: var(--font-pixel); font-size: 11px; color: var(--text-muted); letter-spacing: 1px; display: block; margin-bottom: 3px; }
.rec-value { font-size: 13px; font-weight: 800; color: var(--text); display: block; }

/* ── NEXT APPLY ───────────────────────────────────────────────────────────── */
.next-apply-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.next-apply-label { font-family: var(--font-pixel); font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }
.next-apply-time  { font-family: var(--font-pixel); font-size: 22px; color: var(--text); }

/* ── TIMELINE ─────────────────────────────────────────────────────────────── */
.timeline-wrap {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 10px;
}

.timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.timeline::-webkit-scrollbar { display: none; }

.tl-slot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg-page);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tl-sun { width: 28px; height: 28px; image-rendering: pixelated; }
.tl-time { font-family: var(--font-pixel); font-size: 11px; color: var(--text-muted); }
.tl-uv   { font-family: var(--font-pixel); font-size: 13px; font-weight: bold; }

/* ── LOCATION FALLBACK ────────────────────────────────────────────────────── */
.loc-fallback {
  display: none;
  gap: 8px;
  align-items: center;
}

.loc-fallback.visible { display: flex; }

.loc-input {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
}

.loc-input:focus { outline: none; border-color: var(--accent-dark); }

/* ── EQUITY CARD ──────────────────────────────────────────────────────────── */
.equity-card {
  background: #fbf4ff;
  border: 2px solid var(--uv-ext);
  border-radius: var(--radius-lg);
  box-shadow: 2px 2px 0 var(--uv-ext);
  padding: 12px 14px;
  display: none;
}

.equity-card.visible { display: block; }
.equity-title { font-family: var(--font-pixel); font-size: 14px; color: var(--uv-ext); letter-spacing: 1px; margin-bottom: 8px; }
.equity-list  { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.equity-item  { font-size: 11px; color: #5a3a8a; font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.equity-item::before { content: "✦"; color: var(--uv-ext); flex-shrink: 0; }

/* ── REAPPLY CARD ─────────────────────────────────────────────────────────── */
.reapply-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reapply-label { font-family: var(--font-pixel); font-size: 12px; color: var(--text-muted); letter-spacing: 1px; display: block; margin-bottom: 2px; }
.reapply-val   { font-size: 12px; font-weight: 700; color: var(--text); }

/* ── CHAT PAGE ────────────────────────────────────────────────────────────── */
.chat-header {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px;
  text-align: center;
}

.chat-header-title { font-family: var(--font-pixel); font-size: 20px; color: var(--accent-dark); letter-spacing: 2px; }
.chat-header-sub   { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-top: 2px; }

.chat-window {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 600;
  max-width: 85%;
}

.bubble-bot {
  background: var(--bg-page);
  border: 2px solid var(--border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.bubble-user {
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  color: var(--surface);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bubble-typing {
  font-style: italic;
  color: var(--text-muted);
  font-size: 11px;
}

.chat-input-wrap {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: var(--bg-page);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
}

.chat-input:focus { outline: none; border-color: var(--accent-dark); }

.chat-send {
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--accent-dark);
  width: 36px; height: 36px;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send:active { transform: translate(2px,2px); box-shadow: none; }

.chat-loader { display: none; justify-content: center; align-items: center; gap: 8px; padding: 1rem; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.chat-loader.visible { display: flex; }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCANNER PAGE ─────────────────────────────────────────────────────────── */
.scan-result { display: none; }
.scan-result.visible { display: block; }

.score-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }

.score-circle {
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 3px solid;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--font-pixel);
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.score-circle span { font-size: 11px; color: var(--text-muted); }
.score-title { font-size: 14px; font-weight: 800; color: var(--text); }
.score-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.scan-section { margin-bottom: 10px; }
.scan-label   { font-family: var(--font-pixel); font-size: 11px; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 5px; }

.badge-row { display: flex; flex-wrap: wrap; gap: 5px; }

.flag-badge {
  background: rgba(201,74,74,0.12);
  border: 2px solid rgba(201,74,74,0.3);
  color: var(--uv-vhigh);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}

.safe-badge {
  background: rgba(90,158,90,0.12);
  border: 2px solid rgba(90,158,90,0.3);
  color: var(--uv-low);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}

.scan-alt     { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.scan-summary { font-size: 12px; color: var(--text-muted); line-height: 1.6; padding-top: 10px; border-top: 1px dashed #e8d0a0; margin-top: 10px; }

/* ── PROFILE PAGE ─────────────────────────────────────────────────────────── */
.profile-avatar {
  width: 64px; height: 64px;
  background: var(--accent);
  border: 3px solid var(--accent-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  margin: 0 auto 6px;
}

.profile-name { font-family: var(--font-pixel); font-size: 22px; color: var(--text); text-align: center; letter-spacing: 1px; }
.profile-sub  { font-size: 11px; color: var(--text-muted); text-align: center; font-weight: 600; margin-top: 2px; margin-bottom: 2px; }

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #e8d0a0;
}

.field-row:last-child { border-bottom: none; padding-bottom: 0; }

.field-label { font-family: var(--font-pixel); font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }
.field-val   { font-size: 12px; font-weight: 700; color: var(--text); }

.exposure-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 4px; }

.exp-day { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.exp-dot { width: 100%; aspect-ratio: 1; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1); }
.exp-lbl { font-family: var(--font-pixel); font-size: 9px; color: var(--text-muted); }

.integration-card {
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.integration-card.watch {
  background: #f0f4ff;
  border: 2px solid #8aabdd;
  box-shadow: 2px 2px 0 #8aabdd;
}

.integration-card.health {
  background: var(--uv-low-bg);
  border: 2px solid var(--uv-low);
  box-shadow: 2px 2px 0 var(--uv-low);
}

.integration-icon  { font-size: 28px; flex-shrink: 0; }
.integration-title { font-family: var(--font-pixel); font-size: 14px; letter-spacing: 1px; }
.integration-sub   { font-size: 9px; font-weight: 600; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

.integration-card.watch .integration-title { color: #2a4a8a; }
.integration-card.health .integration-title { color: #2a6a2a; }

.int-btn {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1px;
  background: var(--surface);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.integration-card.watch .int-btn  { color: #2a4a8a; border: 2px solid #8aabdd; box-shadow: 1px 1px 0 #8aabdd; }
.integration-card.health .int-btn { color: #2a6a2a; border: 2px solid var(--uv-low); box-shadow: 1px 1px 0 var(--uv-low); }

.skin-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }

.skin-opt {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 6px 2px;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.skin-opt.selected { background: var(--accent); border-color: var(--accent-dark); }

.skin-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); margin: 0 auto 3px; }
.skin-opt-label { font-family: var(--font-pixel); font-size: 9px; color: var(--text); }

/* ── RECCS PAGE ───────────────────────────────────────────────────────────── */
.recc-item {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.recc-icon  { font-size: 24px; flex-shrink: 0; }
.recc-name  { font-size: 12px; font-weight: 800; color: var(--text); }
.recc-desc  { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.recc-price { font-family: var(--font-pixel); font-size: 16px; color: var(--uv-low); flex-shrink: 0; }

/* ── ONBOARDING ───────────────────────────────────────────────────────────── */
.onboarding-wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px; }
.onboarding-wrap h1 { font-family: var(--font-pixel); font-size: 22px; color: var(--text); letter-spacing: 2px; margin-bottom: 6px; }
.onboarding-sub { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 20px; line-height: 1.6; }

.skin-select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

.skin-select-opt {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.skin-select-opt.selected { background: #fff3e0; border-color: var(--accent-dark); box-shadow: var(--shadow-lg); }
.skin-select-opt input[type="radio"] { display: none; }

.skin-select-swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.15); }
.skin-type-num { font-family: var(--font-pixel); font-size: 10px; color: var(--text-muted); }
.skin-type-name { font-size: 13px; font-weight: 800; color: var(--text); }
.skin-type-desc { font-size: 10px; color: var(--text-muted); }

/* ── AUTH ─────────────────────────────────────────────────────────────────── */
.auth-wrap { max-width: 400px; margin: 40px auto; padding: 0 16px; }

.auth-card {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
}

.auth-title { font-family: var(--font-pixel); font-size: 22px; color: var(--text); letter-spacing: 2px; margin-bottom: 4px; }
.auth-sub   { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 20px; }
.auth-switch { margin-top: 16px; font-size: 12px; color: var(--text-muted); text-align: center; font-weight: 600; }
.auth-switch a { color: var(--accent-dark); text-decoration: none; font-weight: 800; }

.alert-error {
  background: rgba(201,74,74,0.08);
  border: 2px solid rgba(201,74,74,0.3);
  border-radius: var(--radius);
  color: var(--uv-vhigh);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.alert-success {
  background: rgba(90,158,90,0.08);
  border: 2px solid rgba(90,158,90,0.3);
  border-radius: var(--radius);
  color: var(--uv-low);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* ── SETTINGS PAGE ────────────────────────────────────────────────────────── */
.settings-section {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

/* ── PLAN PAGE ────────────────────────────────────────────────────────────── */
.plan-result {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
  display: none;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.plan-result.visible { display: block; }
.plan-result p { margin-bottom: 10px; }
.plan-result p:last-child { margin-bottom: 0; }

/* ── UTILITY ──────────────────────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent-dark); }
.text-center { text-align: center; }

.divider { border: none; border-top: 1px dashed #e8d0a0; margin: 4px 0; }

.page-title { font-family: var(--font-pixel); font-size: 18px; color: var(--text); letter-spacing: 2px; }
.page-sub   { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

/* ── FILTER BUTTONS ───────────────────────────────────────────────────────── */
.filter-btn {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 1px;
  background: var(--surface);
  color: var(--text-muted);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}

.filter-btn.active {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent-dark);
  box-shadow: 2px 2px 0 var(--accent-dark);
}

/* ── PRODUCT CARD ─────────────────────────────────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.product-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.product-name  { font-size: 13px; font-weight: 800; color: var(--text); line-height: 1.3; }
.product-brand { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 1px; }
.product-price { font-family: var(--font-pixel); font-size: 16px; color: var(--uv-low); flex-shrink: 0; }

.product-tags  { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }

.tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}

.tag-mineral  { background: rgba(90,158,90,0.12);  border: 1px solid rgba(90,158,90,0.3);  color: var(--uv-low); }
.tag-chemical { background: rgba(201,162,39,0.12); border: 1px solid rgba(201,162,39,0.3); color: var(--uv-mod); }
.tag-spf      { background: rgba(244,169,78,0.12); border: 1px solid rgba(244,169,78,0.3); color: var(--accent-dark); }
.tag-nocast   { background: rgba(138,74,201,0.10); border: 1px solid rgba(138,74,201,0.3); color: var(--uv-ext); }
.tag-budget   { background: rgba(90,158,90,0.12);  border: 1px solid rgba(90,158,90,0.3);  color: var(--uv-low); }

.product-why  { font-size: 11px; color: var(--text-muted); font-weight: 600; line-height: 1.5; }

.no-results {
  text-align: center;
  padding: 2rem;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ── CHAT ROW LAYOUT ──────────────────────────────────────────────────────── */
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.chat-row.user-row { flex-direction: row-reverse; }

.sun-avatar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 44px;
}

.sun-avatar img,
.sun-avatar svg {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}

.sun-avatar-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.bubble-bot  { border-bottom-left-radius: 4px !important; }
.bubble-user { border-bottom-right-radius: 4px !important; }
