/* "Soft Spa" — warm cream + sage. Light is the default; dark is a warm charcoal toggle. */
:root {
  --bg: #16140f;                          /* warm charcoal (dark toggle) */
  --card: rgba(255, 255, 255, 0.05);
  --card-solid: #211f19;
  --stroke: rgba(255, 252, 244, 0.12);
  --text: #f4efe4;
  --muted: #b3aa97;
  --pink: #cd7a5b;        /* warm clay — secondary accent / italic highlights */
  --violet: #57a08c;      /* sage — primary accent reference */
  --peach: #e0a64b;       /* warm amber */
  --mint: #5cbf9a;        /* success green (sage family) */
  --accent-grad: linear-gradient(120deg, #74b3a0, #3f7d6b);  /* sage */
  --accent-ink: #ffffff;  /* white text on sage buttons */
  --radius: 20px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg: #f5f0e7;                          /* warm cream */
  --card: rgba(255, 253, 249, 0.82);
  --card-solid: #fffdf9;
  --stroke: rgba(74, 62, 46, 0.13);
  --text: #2c2824;                        /* warm espresso ink */
  --muted: #847a6b;
  --shadow: 0 18px 48px rgba(96, 78, 50, 0.13);
}

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

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  background: radial-gradient(1100px 680px at 84% -12%, #28392f 0%, transparent 58%),
              radial-gradient(950px 640px at -8% 8%, #322a1d 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  transition: background .4s ease, color .4s ease;
}

/* soft ambient orbs — a refined, cohesive cool palette (no rainbow) */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; filter: blur(80px); opacity: 0.5; }
.orb { position: absolute; border-radius: 50%; }
.orb-1 { width: 380px; height: 380px; background: #5d8c7d; top: -90px; left: -60px; animation: float 18s ease-in-out infinite; }
.orb-2 { width: 360px; height: 360px; background: #b98a5e; bottom: -140px; right: -80px; animation: float 21s ease-in-out infinite reverse; }
.orb-3 { width: 300px; height: 300px; background: #4f8c7a; top: 42%; left: 62%; animation: float 19s ease-in-out infinite; }
.orb-4 { width: 240px; height: 240px; background: #79a08f; bottom: 8%; left: 4%; animation: float 23s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translate(0,0); } 50% { transform: translate(26px,-26px); } }

/* LIGHT theme (default) — warm cream + soft sage wash (airy, not flat white) */
[data-theme="light"] body {
  background:
    radial-gradient(1100px 720px at 82% -12%, #efe6d4 0%, transparent 56%),
    radial-gradient(940px 680px at -6% 4%, #e4eee2 0%, transparent 52%),
    radial-gradient(900px 760px at 50% 122%, #f3ebdd 0%, transparent 55%),
    var(--bg);
}
[data-theme="light"] .bg-orbs { opacity: 0.5; filter: blur(95px); }
[data-theme="light"] .orb-1 { background: #cfe0d4; }
[data-theme="light"] .orb-2 { background: #ecdcc1; }
[data-theme="light"] .orb-3 { background: #d6e6d4; }
[data-theme="light"] .orb-4 { background: #e8ddc9; }

.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; flex-wrap: wrap; gap: 8px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; }
.logo-mark { font-size: 1.4rem; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .5px; }
.tagline { color: var(--muted); font-size: .9rem; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* auth chip / login button */
.auth-area { display: flex; align-items: center; }
.btn-auth { font: inherit; font-weight: 700; font-size: .85rem; color: var(--accent-ink); background: var(--accent-grad); border: none; border-radius: 999px; padding: 8px 16px; cursor: pointer; box-shadow: 0 6px 18px rgba(87,160,140,.3); }
.btn-auth:hover { transform: translateY(-1px); }
.user-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06); border: 1px solid var(--stroke); border-radius: 999px; padding: 5px 10px 5px 5px; cursor: pointer; }
.user-chip:hover { background: rgba(255,255,255,.12); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--accent-ink); background: var(--accent-grad); flex: none; }
.avatar.lg { width: 46px; height: 46px; font-size: 1.3rem; }
.plan-badge { font-size: .72rem; font-weight: 800; letter-spacing: .3px; }
.plan-badge.free { color: var(--muted); }
.plan-badge.premium { color: #ffd479; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(4,6,14,.62); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 18px; animation: rise .25s ease; }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: 100%; max-width: 400px; background: var(--card-solid); border: 1px solid var(--stroke); border-radius: 20px; box-shadow: var(--shadow); padding: 26px 24px; }
.modal-x { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.08); border: none; color: var(--text); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: .9rem; }
.modal-title { font-size: 1.4rem; margin-bottom: 6px; }
.modal-sub { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.modal-fine { color: var(--muted); font-size: .75rem; margin-top: 12px; opacity: .8; text-align: center; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; font: inherit; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 14px; }
.field input:focus { outline: none; border-color: var(--violet); }
.perk-list { list-style: none; display: grid; gap: 11px; margin: 4px 0 18px; }
.perk-list li { font-size: .95rem; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 11px 14px; }
.price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.price { font-size: 1.9rem; font-weight: 800; } .price small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.price-note { color: var(--muted); font-size: .85rem; }
.acct-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.acct-name { font-weight: 800; font-size: 1.1rem; } .acct-email { color: var(--muted); font-size: .85rem; }
.acct-plan { font-size: .9rem; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--stroke); margin-bottom: 16px; }
.acct-plan.premium { color: #ffd479; border-color: rgba(255,212,121,.4); background: rgba(255,212,121,.1); }

/* premium gate / upsell */
.lock-pill { font-size: .62rem; font-weight: 800; letter-spacing: .4px; color: #ffd479; background: rgba(255,212,121,.14); border: 1px solid rgba(255,212,121,.35); border-radius: 999px; padding: 3px 9px; vertical-align: middle; margin-left: 6px; }
.premium-gate { position: relative; border: 1px solid var(--stroke); border-radius: 16px; overflow: hidden; }
.pg-blur { padding: 18px; filter: blur(3px); opacity: .55; pointer-events: none; }
.pg-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--stroke); font-size: .95rem; }
.pg-row b { color: var(--violet); }
.pg-cta { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; background: linear-gradient(180deg, rgba(12,15,31,.4), rgba(12,15,31,.78)); }
.premium-gate.slim { padding: 0; } .premium-gate.slim .pg-cta { position: static; background: none; padding: 20px; }
.pg-cta p { font-size: .95rem; max-width: 320px; }

/* affiliate find-links */
.shop-item { justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.shop-name { flex: 1; min-width: 60%; }
.shop-find { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.find-lbl { color: var(--muted); }
.aff { color: var(--peach); text-decoration: none; border: 1px solid var(--stroke); border-radius: 999px; padding: 3px 9px; transition: background .15s; }
.aff:hover { background: rgba(255,255,255,.08); }

/* reminders */
.reminders { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 14px; padding: 16px; }
.rem-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.rem-row label { font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.rem-row input[type=time] { font: inherit; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--stroke); border-radius: 10px; padding: 8px 10px; }
.rem-note { color: var(--muted); font-size: .85rem; margin-top: 12px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); z-index: 60; background: var(--card-solid); border: 1px solid var(--stroke); border-radius: 999px; padding: 12px 22px; font-weight: 700; box-shadow: var(--shadow); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer { position: relative; z-index: 2; text-align: center; color: var(--muted); font-size: .8rem; line-height: 1.7; padding: 8px 18px 34px; }
.footer a { color: var(--peach); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.app { position: relative; z-index: 2; max-width: 760px; margin: 10px auto 40px; padding: 0 18px; }

.card {
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 30px;
}
.card.wide { max-width: 760px; }

/* screen switching */
.screen { display: none; animation: rise .45s ease; }
.screen.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

h1 { font-size: 2.1rem; line-height: 1.18; margin-bottom: 14px; letter-spacing: -.5px; }
h2 { font-size: 1.5rem; margin-bottom: 8px; letter-spacing: -.3px; }
.sub { color: var(--muted); font-size: 1.02rem; margin-bottom: 22px; }
.sub em { color: var(--pink); font-style: italic; }

.feature-list { list-style: none; display: grid; gap: 12px; margin: 6px 0 26px; }
.feature-list li { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); padding: 12px 14px; border-radius: 14px; font-size: .98rem; }
.feature-list li span { font-size: 1.2rem; }

/* buttons */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: none; border-radius: 999px; padding: 13px 26px;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s; color: var(--accent-ink);
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent-grad); box-shadow: 0 10px 30px rgba(87,160,140,.4); }
.btn.primary:hover { box-shadow: 0 14px 40px rgba(87,160,140,.55); transform: translateY(-2px); }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.big { font-size: 1.08rem; padding: 16px 34px; }
.btn.ghost { background: rgba(255,255,255,.07); color: var(--text); border: 1px solid var(--stroke); }
.btn.ghost:hover { background: rgba(255,255,255,.13); }

.disclaimer-small { color: var(--muted); font-size: .78rem; margin-top: 18px; opacity: .8; }
.center { text-align: center; }

/* progress */
.progress-wrap { margin-bottom: 26px; }
.progress-bar { height: 8px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 12%; background: var(--accent-grad); border-radius: 999px; transition: width .4s ease; }
.progress-label { display: block; margin-top: 8px; font-size: .82rem; color: var(--muted); }

/* quiz */
.quiz-q { font-size: 1.45rem; margin-bottom: 6px; letter-spacing: -.3px; }
.quiz-help { color: var(--muted); margin-bottom: 20px; font-size: .95rem; }
.options { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: rgba(255,255,255,.04); border: 1.5px solid var(--stroke);
  border-radius: 16px; padding: 16px 18px; cursor: pointer; font: inherit; color: var(--text);
  transition: all .18s ease; width: 100%;
}
.opt:hover { border-color: var(--violet); background: rgba(87,160,140,.12); }
.opt.selected { border-color: var(--pink); background: rgba(244,114,182,.16); box-shadow: 0 0 0 3px rgba(244,114,182,.14); }
.opt .emoji { font-size: 1.45rem; }
.opt .opt-label { font-weight: 600; }
.opt .opt-desc { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; }
.opt-check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--stroke); flex: none; display: grid; place-items: center; font-size: .8rem; }
.opt.selected .opt-check { background: var(--pink); border-color: var(--pink); color: var(--accent-ink); }
/* multi-select: square checkboxes signal "pick several" */
.options.multi .opt-check { border-radius: 6px; }

.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.quiz-nav.center { justify-content: center; }

/* dropzone */
.dropzone {
  display: block; position: relative; border: 2px dashed var(--stroke); border-radius: 18px;
  min-height: 240px; cursor: pointer; overflow: hidden; transition: all .2s; background: rgba(255,255,255,.03);
}
.dropzone:hover, .dropzone.drag { border-color: var(--violet); background: rgba(87,160,140,.1); }
.dropzone-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; }
.dz-icon { font-size: 2.6rem; }
.dz-text { font-weight: 700; font-size: 1.05rem; }
.dz-hint { color: var(--muted); font-size: .85rem; }
#preview-img { display: none; width: 100%; height: 320px; object-fit: cover; }
.dropzone.has-img .dropzone-inner { display: none; }
.dropzone.has-img #preview-img { display: block; }

.btn.full { width: 100%; margin-top: 4px; }

.preview-tools { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.preview-tools .btn { font-size: .85rem; padding: 9px 16px; }
.consent-line { margin: 16px 0 4px; font-size: .82rem; color: var(--muted); line-height: 1.5;
  background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 14px; }
.consent-line strong { color: var(--text); }
.unbiased-note { margin-top: 14px; font-size: .85rem; color: var(--muted); line-height: 1.55;
  background: rgba(87,160,140,.08); border: 1px solid rgba(87,160,140,.25); border-radius: 12px; padding: 13px 15px; }
.unbiased-note strong { color: var(--text); } .unbiased-note em { color: var(--pink); font-style: normal; font-weight: 600; }

.or-divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; color: var(--muted); font-size: .85rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--stroke); }

.camera-box { margin-top: 16px; border: 1px solid var(--stroke); border-radius: 18px; overflow: hidden; background: #000; }
#camera-video { display: block; width: 100%; max-height: 380px; object-fit: cover; background: #000; transform: scaleX(-1); }
.camera-box.rear #camera-video { transform: none; }
.camera-controls { display: flex; gap: 10px; justify-content: center; padding: 14px; background: rgba(255,255,255,.04); flex-wrap: wrap; }
.camera-error { color: #ff8a8a; font-size: .9rem; margin-top: 12px; background: rgba(255,138,138,.1); border: 1px solid rgba(255,138,138,.3); border-radius: 12px; padding: 12px 14px; }

.upload-tips { margin: 18px 0 6px; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 14px; padding: 14px 16px; font-size: .9rem; display: flex; flex-direction: column; gap: 6px; }
.upload-tips span { color: var(--muted); }

/* loader */
.loader { text-align: center; padding: 26px 0; }
.scan-box { position: relative; width: 220px; height: 220px; margin: 0 auto 26px; border-radius: 20px; overflow: hidden; border: 1px solid var(--stroke); }
#scan-img { width: 100%; height: 100%; object-fit: cover; }
.scan-line { position: absolute; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, transparent, var(--mint), transparent); box-shadow: 0 0 18px 4px var(--mint); animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { 0% { top: 0; } 50% { top: calc(100% - 4px); } 100% { top: 0; } }

/* results */
.result-head { text-align: center; margin-bottom: 26px; }
.result-head h2 { font-size: 1.9rem; }
.skin-type-badge { display: inline-block; margin-top: 10px; padding: 8px 18px; border-radius: 999px; background: var(--accent-grad); color: var(--accent-ink); font-weight: 800; font-size: 1rem; }

.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin: 8px 0 30px; }
.score-card { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 16px; padding: 16px; }
.score-card .sc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.score-card .sc-name { font-weight: 700; font-size: .95rem; }
.score-card .sc-val { font-size: .8rem; color: var(--muted); font-weight: 700; }
.meter { height: 9px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; border-radius: 999px; transition: width .9s ease; }
.sc-note { font-size: .78rem; color: var(--muted); margin-top: 8px; }

.section-title { font-size: 1.25rem; margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--stroke); }

.ingredient { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-left: 4px solid var(--pink); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.ingredient h4 { font-size: 1.08rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ing-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 3px 9px; border-radius: 999px; background: rgba(87,160,140,.22); color: #bfe0d2; }
.ingredient p { color: var(--muted); font-size: .92rem; }
.ingredient .ing-where { color: var(--peach); font-size: .85rem; font-weight: 600; margin-top: 6px; }

.routine { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.routine-col { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 16px; padding: 18px; }
.routine-col h4 { font-size: 1.1rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.step { display: flex; gap: 12px; margin-bottom: 14px; }
.step-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-grad); color: var(--accent-ink); font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.step-body strong { display: block; font-size: .94rem; }
.step-body span { color: var(--muted); font-size: .82rem; }

.spot-list, .avoid-list { list-style: none; display: grid; gap: 10px; }
.spot-list li, .avoid-list li { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 14px; font-size: .92rem; }
.spot-list li strong { color: var(--peach); }
.avoid-list li { border-left: 4px solid #ff8a8a; }
.avoid-list li strong { color: #ff8a8a; }

.shop-list { display: grid; gap: 8px; }
.shop-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 14px; font-size: .92rem; }
.shop-item .chk { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--mint); flex: none; }
.shop-item b { color: var(--mint); }

.callout { background: rgba(87,160,140,.10); border: 1px solid rgba(87,160,140,.28); border-radius: 14px; padding: 14px 16px; font-size: .9rem; margin-top: 14px; }
.callout.warn { background: rgba(255,138,138,.1); border-color: rgba(255,138,138,.35); }

/* topbar right + theme toggle */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.theme-toggle { background: rgba(255,255,255,.08); border: 1px solid var(--stroke); color: var(--text); width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; transition: transform .15s, background .2s; line-height: 1; }
.theme-toggle:hover { transform: rotate(-15deg) scale(1.05); background: rgba(255,255,255,.16); }

/* overall score gauge */
.overall { display: flex; align-items: center; gap: 22px; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 18px; padding: 22px; margin-bottom: 8px; flex-wrap: wrap; }
.gauge { --val: 0; --col: var(--mint); position: relative; width: 132px; height: 132px; flex: none; border-radius: 50%;
  background: radial-gradient(closest-side, var(--card-solid) 70%, transparent 71% 100%),
              conic-gradient(var(--col) calc(var(--val) * 1%), rgba(255,255,255,.10) 0); }
.gauge::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--stroke); }
.gauge-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-num b { font-size: 2.1rem; line-height: 1; }
.gauge-num span { font-size: .68rem; color: var(--muted); letter-spacing: .5px; margin-top: 3px; }
.overall-info { flex: 1; min-width: 200px; }
.overall-info h3 { font-size: 1.25rem; margin-bottom: 4px; }
.overall-info p { color: var(--muted); font-size: .92rem; }
.grade-chip { display: inline-block; margin-top: 8px; padding: 5px 14px; border-radius: 999px; font-weight: 800; font-size: .82rem; }

/* progress tracker */
.progress-track { display: grid; gap: 10px; }
.track-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.track-row .t-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.track-row .t-bar { height: 8px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.track-row .t-bar > div { height: 100%; background: var(--accent-grad); border-radius: 999px; }
.track-row .t-score { font-weight: 800; }
.trend { font-size: .82rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.trend.up { color: #34d399; background: rgba(52,211,153,.14); }
.trend.down { color: #fbbf24; background: rgba(251,191,36,.14); }
.trend.flat { color: var(--muted); background: rgba(255,255,255,.07); }
.track-empty { color: var(--muted); font-size: .9rem; }
.btn.danger-ghost { color: #fca5a5; }

/* annotated photo — futuristic AR skin scan */
.annot-stage { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--stroke); background: #05070d;
  margin: 0 auto; max-width: 100%; max-height: 470px; } /* aspect-ratio set inline per photo; cap tall portraits */
.annot-stage .base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* each concern is a toggleable LAYER — hidden until its legend chip reveals it */
.layer { position: absolute; inset: 0; display: none; }
.annot-stage.show-m-red .layer.m-red,
.annot-stage.show-m-spot .layer.m-spot,
.annot-stage.show-m-shine .layer.m-shine { display: block; animation: layerReveal .45s ease both; }
@keyframes layerReveal { from { opacity: 0; } to { opacity: 1; } }
.heat { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none;
  mix-blend-mode: screen; opacity: .5; animation: heatPulse 2.6s ease-in-out infinite; }
@keyframes heatPulse { 0%,100% { opacity: .5; } 50% { opacity: .32; } }

/* face-tracking reticle with corner brackets */
.face-reticle { position: absolute; border: 1px solid rgba(86,205,255,.35); border-radius: 8px; pointer-events: none; box-shadow: 0 0 0 100vmax rgba(3,6,14,.10) inset; }
.face-reticle i { position: absolute; width: 16px; height: 16px; border: 2.5px solid #46cdff; filter: drop-shadow(0 0 4px #46cdff); }
.face-reticle i:nth-child(1) { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.face-reticle i:nth-child(2) { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.face-reticle i:nth-child(3) { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.face-reticle i:nth-child(4) { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

/* scanning sweep + subtle grid for the "diagnostic" feel */
.scan-sweep { position: absolute; left: 0; right: 0; height: 26%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(86,205,255,.22) 60%, rgba(86,205,255,.5));
  border-bottom: 2px solid rgba(140,225,255,.9); box-shadow: 0 0 22px 4px rgba(86,205,255,.45);
  animation: sweep 3.2s cubic-bezier(.5,0,.5,1) infinite; }
@keyframes sweep { 0% { top: -26%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.scan-grid { position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: linear-gradient(rgba(120,200,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(120,200,255,.6) 1px, transparent 1px);
  background-size: 24px 24px; }
@media (prefers-reduced-motion: reduce) { .scan-sweep, .heat, .pin, .hud-callout { animation: none !important; } }
.annot-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.legend-chip { display: flex; align-items: center; gap: 8px; font: inherit; font-size: .85rem; font-weight: 700; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--stroke); border-radius: 999px; padding: 8px 14px; cursor: pointer; transition: all .18s ease; }
.legend-chip b { color: var(--muted); font-weight: 700; }
.legend-chip .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
.legend-chip.active { background: rgba(70,205,255,.14); border-color: rgba(70,205,255,.55); box-shadow: 0 0 14px rgba(70,205,255,.25); }
.legend-chip:not(.active):not(:disabled):hover { background: rgba(255,255,255,.1); }
.legend-chip:disabled { opacity: .35; cursor: default; }
.annot-hint { color: var(--muted); font-size: .85rem; margin-top: 10px; }

/* faint facial-landmark wireframe */
.mesh { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; opacity: .4; mix-blend-mode: screen; }

/* futuristic targeting reticle (SVG) marking each detected spot */
.pin { position: absolute; transform: translate(-50%, -50%); aspect-ratio: 1; min-width: 22px; min-height: 22px; pointer-events: auto; cursor: default; }
.pin.m-red { color: #ff4655; }
.pin.m-spot { color: #ffbe3c; }
.reticle { width: 100%; height: 100%; display: block; overflow: visible;
  filter: drop-shadow(0 0 1.5px rgba(0,0,0,.85)) drop-shadow(0 0 6px currentColor); /* dark halo so it reads on any color */
  animation: pinPop .5s cubic-bezier(.2,1.5,.4,1) both; }
.reticle .r-ring { fill: none; stroke: #fff; stroke-width: 6; stroke-dasharray: 31 23; stroke-linecap: round;
  transform-origin: 50% 50%; animation: spin 7s linear infinite, breathe 2.4s ease-in-out infinite; }
.reticle .r-mid { fill: none; stroke: currentColor; stroke-width: 3; opacity: .55; }
.reticle .r-tick { stroke: #fff; stroke-width: 6; stroke-linecap: round; opacity: .95; }
.reticle .r-core { fill: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes pinPop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pin:hover { z-index: 5; }
.pin:hover .reticle { filter: drop-shadow(0 0 7px currentColor); }
.pin-label { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%) scale(.9);
  white-space: nowrap; font-size: 10px; font-weight: 800; letter-spacing: .3px; color: #04121e;
  background: currentColor; border-radius: 5px; padding: 2px 6px; opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; }
.pin:hover .pin-label { opacity: 1; transform: translateX(-50%) scale(1); }
@media (prefers-reduced-motion: reduce) { .reticle, .reticle .r-ring { animation: none !important; } }

/* HUD callout — the labeled readout that names the concern + % */
.hud-callout { position: absolute; transform: translate(-50%, -50%); pointer-events: none; display: flex; align-items: center; gap: 6px; animation: layerReveal .5s ease both; }
.hud-callout .hud-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; flex: none; }
.hud-callout .hud-box { transform: translateX(8px); font-size: 11px; font-weight: 700; letter-spacing: .2px; color: #eaf6ff;
  background: rgba(6,14,26,.82); border: 1px solid currentColor; border-radius: 8px; padding: 5px 10px; white-space: normal; max-width: 200px; line-height: 1.35;
  backdrop-filter: blur(3px); box-shadow: 0 0 14px color-mix(in srgb, currentColor 40%, transparent); }
.hud-callout .hud-box b { color: currentColor; }
.hud-tip { display: block; font-weight: 600; font-size: 10px; opacity: .92; margin-top: 2px; }
/* safety net: never show an empty callout box, nor a callout from a hidden layer */
.hud-box:empty { display: none; }
.annot-stage:not(.show-m-red) .layer.m-red .hud-callout,
.annot-stage:not(.show-m-spot) .layer.m-spot .hud-callout,
.annot-stage:not(.show-m-shine) .layer.m-shine .hud-callout { display: none; }
.hud-callout.m-red { color: #ff6b78; }
.hud-callout.m-spot { color: #ffce63; }
.hud-callout.m-shine { color: #6fd6ff; }

.method { display: inline-block; margin-top: 10px; font-size: .82rem; color: var(--muted); background: rgba(255,255,255,.05);
  border: 1px solid var(--stroke); border-radius: 999px; padding: 6px 12px; }
.method.ok { color: #8fe6ff; border-color: rgba(70,205,255,.4); background: rgba(70,205,255,.1); }

.zone-head { font-weight: 700; margin: 16px 0 8px; font-size: .98rem; }
.zone-list { list-style: none; display: grid; gap: 8px; }
.zone-list li { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 14px; font-size: .92rem; display: flex; align-items: center; gap: 10px; }
.zone-list .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }

/* safety banner (pregnancy / nursing / under-18) */
.safety-banner { background: linear-gradient(135deg, rgba(52,211,153,.14), rgba(56,189,248,.12));
  border: 1px solid rgba(52,211,153,.4); border-radius: 16px; padding: 18px 20px; margin: 18px 0 6px; }
.safety-head { font-weight: 800; font-size: 1.08rem; margin-bottom: 8px; color: #6ee7b7; }
.safety-banner p { font-size: .92rem; margin-bottom: 8px; }
.safety-removed { list-style: none; display: grid; gap: 6px; margin-top: 6px; }
.safety-removed li { font-size: .88rem; color: var(--muted); padding-left: 16px; position: relative; }
.safety-removed li::before { content: "✕"; position: absolute; left: 0; color: #f87171; font-weight: 800; }
.safety-removed li strong { color: var(--text); }

/* lighting-quality readout */
.callout.lighting .lite-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .95rem; margin-bottom: 6px; flex-wrap: wrap; }
.callout.lighting .lite-meter { flex: 1; min-width: 120px; max-width: 220px; height: 8px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.callout.lighting .lite-meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#f87171,#fbbf24,#34d399); }
.callout.lighting.good { border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.callout.lighting.fair { border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.1); }
.callout.lighting.poor { border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.1); }
.lite-tag { display: inline-block; font-size: .66rem; font-weight: 700; color: #7dd3fc; background: rgba(125,211,252,.14); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }

/* before / after */
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ba-card { margin: 0; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 14px; overflow: hidden; }
.ba-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.ba-card figcaption { padding: 10px 12px; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ba-card figcaption b { color: var(--text); }

/* light theme card solidify (warm-cream body + orbs live in the Soft Spa block near the top) */
[data-theme="light"] .card { background: rgba(255,253,249,0.92); }
[data-theme="light"] .tagline { color: var(--muted); }

/* light theme panel fixes (translucent-white fills -> subtle dark tint) */
[data-theme="light"] .feature-list li,
[data-theme="light"] .opt,
[data-theme="light"] .score-card,
[data-theme="light"] .ingredient,
[data-theme="light"] .routine-col,
[data-theme="light"] .spot-list li,
[data-theme="light"] .avoid-list li,
[data-theme="light"] .shop-item,
[data-theme="light"] .upload-tips,
[data-theme="light"] .overall,
[data-theme="light"] .track-row,
[data-theme="light"] .camera-controls,
[data-theme="light"] .legend-chip,
[data-theme="light"] .ba-card,
[data-theme="light"] .dropzone { background: rgba(15,23,42,.035); }
[data-theme="light"] .btn.ghost,
[data-theme="light"] .theme-toggle { background: rgba(15,23,42,.06); color: var(--text); }
[data-theme="light"] .btn.ghost:hover { background: rgba(15,23,42,.11); }
[data-theme="light"] .meter, [data-theme="light"] .t-bar,
[data-theme="light"] .progress-bar { background: rgba(15,23,42,.12); }
[data-theme="light"] .opt:hover { background: rgba(87,160,140,.14); }

@media (max-width: 600px) {
  h1 { font-size: 1.7rem; }
  .card { padding: 26px 20px; }
  .routine { grid-template-columns: 1fr; }
  .tagline { display: none; }
}

@media print {
  body { background: #fff; color: #111; }
  .bg-orbs, .topbar, .footer, .quiz-nav, .disclaimer-small { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; background: #fff; }
  .screen { display: none !important; }
  #screen-results { display: block !important; }
  .ingredient, .score-card, .routine-col, .spot-list li, .shop-item, .callout { background: #f7f7f7 !important; color: #111; }
  .sub, .muted, .score-card .sc-val, .sc-note, .ingredient p, .step-body span { color: #444 !important; }
}

/* ============================================================
   SKINTEL — multi-feature UI (nav, home hub, products, chat, progress)
   ============================================================ */
body { padding-bottom: 78px; } /* room for the bottom tab bar */

/* bottom tab navigation */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: space-around;
  background: color-mix(in srgb, var(--card-solid) 92%, transparent); border-top: 1px solid var(--stroke);
  backdrop-filter: blur(14px); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.tabbar button { flex: 1; background: none; border: none; color: var(--muted); font: inherit; font-size: .68rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px; cursor: pointer; }
.tabbar button span { font-size: 1.25rem; }
.tabbar button.active { color: var(--text); }
.tabbar button.active span { filter: drop-shadow(0 0 8px rgba(87,160,140,.6)); }
.tabbar .tab-scan { flex: 0 0 auto; margin-top: -22px; }
.tabbar .tab-scan span { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-grad); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(87,160,140,.45); font-size: 1.5rem; }

/* home hub */
.home-actions { display: grid; gap: 12px; margin: 6px 0 22px; }
.action-card { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--stroke); border-radius: 18px; padding: 16px 18px; color: var(--text); font: inherit;
  transition: transform .15s, border-color .15s, background .15s; }
.action-card:hover { transform: translateY(-2px); border-color: var(--violet); background: rgba(87,160,140,.1); }
.action-card .ac-ico { font-size: 1.9rem; flex: none; }
.action-card .ac-body { flex: 1; display: flex; flex-direction: column; }
.action-card .ac-title { font-weight: 800; font-size: 1.08rem; }
.action-card .ac-sub { color: var(--muted); font-size: .86rem; }
.action-card .ac-sub em { color: var(--pink); font-style: normal; }
.action-card .ac-arrow { font-size: 1.3rem; color: var(--violet); }
.home-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.hf { background: rgba(255,255,255,.035); border: 1px solid var(--stroke); border-radius: 14px; padding: 13px; }
.hf span { font-size: 1.3rem; } .hf b { display: block; margin: 6px 0 2px; font-size: .92rem; } .hf small { color: var(--muted); font-size: .78rem; line-height: 1.4; }

/* product scanner */
#ingredient-text { width: 100%; font: inherit; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--stroke);
  border-radius: 14px; padding: 14px; resize: vertical; min-height: 110px; }
#ingredient-text:focus { outline: none; border-color: var(--violet); }
.product-tools { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.product-tools .btn { flex: 1; min-width: 140px; }
.ocr-status { color: var(--muted); font-size: .85rem; margin-top: 10px; }
.verdict { display: flex; align-items: center; gap: 14px; margin: 18px 0 12px; padding: 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--vc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--vc) 45%, transparent); }
.verdict-emo { font-size: 2rem; } .verdict-label { font-weight: 800; font-size: 1.15rem; color: var(--vc); } .verdict-sub { color: var(--muted); font-size: .85rem; }
.flag-list { list-style: none; display: grid; gap: 9px; margin: 0 0 6px; }
.flag { font-size: .92rem; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--stroke); background: rgba(255,255,255,.04); border-left-width: 4px; }
.flag.avoid { border-left-color: #f87171; } .flag.caution { border-left-color: #fbbf24; } .flag.good { border-left-color: #34d399; }
.ing-list { display: grid; gap: 8px; }
.ing-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 13px; font-size: .9rem; }
.ing-row b { min-width: 130px; } .ing-row span { color: var(--muted); flex: 1; min-width: 50%; }
.ing-tagx { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 999px; font-style: normal; }
.ing-tagx.warn { background: rgba(251,191,36,.16); color: #fbbf24; }

/* chat */
.chat-screen { display: flex; flex-direction: column; }
/* on the chat tab the fixed tab bar replaces the footer — hide it so it can't overlap the input */
body:has(#screen-chat.active) .footer { display: none; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--stroke); margin-bottom: 12px; }
.chat-ava { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-grad); color: var(--accent-ink); display: grid; place-items: center; font-size: 1.2rem; font-weight: 800; }
.chat-head b { display: block; } .chat-head small { color: var(--muted); font-size: .8rem; }
.chat-log { flex: none; max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; min-height: 120px; }
.msg { max-width: 84%; padding: 11px 14px; border-radius: 16px; font-size: .94rem; line-height: 1.5; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: rgba(255,255,255,.06); border: 1px solid var(--stroke); border-bottom-left-radius: 5px; }
.msg.user { align-self: flex-end; background: var(--accent-grad); color: var(--accent-ink); font-weight: 600; border-bottom-right-radius: 5px; }
.msg.typing { opacity: .6; letter-spacing: 3px; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sug { font: inherit; font-size: .82rem; color: var(--text); background: rgba(87,160,140,.12); border: 1px solid rgba(87,160,140,.35); border-radius: 999px; padding: 8px 13px; cursor: pointer; }
.sug:hover { background: rgba(87,160,140,.22); }
.chat-bar { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--stroke); }
.chat-bar input { flex: 1; font: inherit; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--stroke); border-radius: 999px; padding: 12px 16px; }
.chat-bar input:focus { outline: none; border-color: var(--violet); }
.chat-bar .btn { padding: 12px 18px; }

/* progress / timeline */
.streak-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 6px 0 22px; }
.streak { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 16px; padding: 16px 12px; text-align: center; }
.streak span { font-size: 1.5rem; } .streak b { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.1; } .streak small { color: var(--muted); font-size: .78rem; }
.timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px,1fr)); gap: 10px; margin-bottom: 18px; }
.tl-tile { margin: 0; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; overflow: hidden; }
.tl-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.tl-tile figcaption { padding: 7px 8px; font-size: .74rem; color: var(--muted); text-align: center; } .tl-tile b { color: var(--text); }
.empty-state { text-align: center; padding: 40px 20px; } .empty-state span { font-size: 2.5rem; } .empty-state p { color: var(--muted); margin: 12px 0 18px; }

/* light theme tweaks for new surfaces */
[data-theme="light"] .tabbar { background: rgba(255,255,255,.92); }
[data-theme="light"] .action-card, [data-theme="light"] .hf, [data-theme="light"] #ingredient-text,
[data-theme="light"] .ing-row, [data-theme="light"] .flag, [data-theme="light"] .msg.assistant,
[data-theme="light"] .streak, [data-theme="light"] .tl-tile, [data-theme="light"] .chat-bar input { background: rgba(15,23,42,.04); }

@media (max-width: 600px) { .home-feats { grid-template-columns: 1fr; } .tagline { display: none; } }

/* trust badges — counter the competitor's sign-up/scan complaints */
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.trust-pill { font-size: .78rem; font-weight: 700; color: #6ee7b7; background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.3); border-radius: 999px; padding: 6px 12px; }
[data-theme="light"] .trust-pill { color: #047857; background: rgba(16,185,129,.1); }

/* routine-first results: product links per step + collapsible science */
.route-lead { color: var(--muted); font-size: .9rem; margin: -4px 0 14px; }
.route-lead em { color: var(--pink); font-style: normal; }
.step-body .shop-find { margin-top: 7px; flex-wrap: wrap; }
.ing-details { margin: 6px 0 4px; border: 1px solid var(--stroke); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.025); }
.ing-details > summary { cursor: pointer; padding: 15px 16px; font-weight: 700; font-size: 1.05rem; list-style: none; }
.ing-details > summary::-webkit-details-marker { display: none; }
.ing-details > summary::after { content: " ▾"; color: var(--muted); }
.ing-details[open] > summary::after { content: " ▴"; }
.ing-details[open] > summary { border-bottom: 1px solid var(--stroke); }
.ing-details > .ingredient { margin: 12px 16px; }
.ing-details > .section-title { margin: 16px 16px 10px; }
.ing-details > .shop-list { margin: 0 16px 18px; }

/* My Shelf + conflict checker */
.shelf-block { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--stroke); }
.pr-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pr-actions input { flex: 1; min-width: 160px; font: inherit; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--stroke); border-radius: 12px; padding: 11px 14px; }
.pr-actions input:focus { outline: none; border-color: var(--violet); }
.shelf-items { display: grid; gap: 8px; margin-bottom: 6px; }
.shelf-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; padding: 11px 14px; }
.shelf-meta { flex: 1; min-width: 0; } .shelf-meta b { display: block; } .shelf-meta small { color: var(--muted); font-size: .8rem; }
.shelf-x { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--stroke); background: rgba(255,255,255,.05); color: var(--muted); cursor: pointer; font-size: .85rem; }
.shelf-x:hover { color: #f87171; border-color: #f87171; }
.flag em { color: var(--cyan); font-style: italic; }
.ampm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ampm-col { background: rgba(255,255,255,.035); border: 1px solid var(--stroke); border-radius: 14px; padding: 14px; }
.ampm-col h4 { margin: 0 0 10px; } .ampm-col small { color: var(--muted); }
.pill-tag { display: inline-block; margin: 0 6px 6px 0; font-size: .8rem; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: rgba(87,160,140,.14); border: 1px solid rgba(87,160,140,.32); color: var(--text); }
.pill-tag.spf { background: rgba(34,211,238,.14); border-color: rgba(34,211,238,.34); }

/* Daily routine check-off — Home "Today" card */
.today-card { margin: 4px 0 20px; }
.today-card:empty { display: none; }
.today-empty { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.04); border: 1px dashed var(--stroke); border-radius: 18px; padding: 16px 18px; }
.today-empty span { font-size: 1.8rem; } .today-empty b { display: block; } .today-empty small { color: var(--muted); font-size: .84rem; }
.today-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.today-head b { font-size: 1.1rem; }
.streak-chip { font-size: .8rem; font-weight: 800; color: #fbbf24; background: rgba(251,191,36,.14); border: 1px solid rgba(251,191,36,.35); border-radius: 999px; padding: 5px 11px; }
.today-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.today-col { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 16px; padding: 12px; }
.today-col-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: .92rem; margin-bottom: 9px; }
.today-count { font-size: .76rem; color: var(--muted); background: rgba(255,255,255,.06); border-radius: 999px; padding: 2px 9px; }
.today-count.full { color: #34d399; background: rgba(52,211,153,.16); }
.today-step { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; font: inherit; font-size: .86rem; color: var(--text); background: none; border: none; border-radius: 10px; padding: 7px 6px; cursor: pointer; }
.today-step:hover { background: rgba(255,255,255,.04); }
.today-check { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--stroke); display: grid; place-items: center; font-size: .72rem; color: var(--accent-ink); }
.today-step.on .today-check { background: var(--accent-grad); border-color: transparent; }
.today-step.on > span:last-child { color: var(--muted); text-decoration: line-through; }
@media (max-width: 480px) { .today-cols { grid-template-columns: 1fr; } }

/* Live camera for label scanning */
.label-cam { margin: 14px 0; }
.label-cam[hidden] { display: none; }
.label-cam video { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--stroke); }
.label-cam-tools { display: flex; gap: 10px; margin-top: 10px; }
.label-cam-tools .btn { flex: 1; }
.label-hint { color: var(--muted); font-size: .82rem; margin-top: 8px; text-align: center; }
.cam-error { color: #f87171; font-size: .86rem; margin-top: 8px; }
.cam-error[hidden] { display: none; }

/* timeline tiles are now tappable (reopen full read) */
button.tl-tile { font: inherit; cursor: pointer; padding: 0; text-align: left; transition: transform .12s ease, box-shadow .12s ease; }
button.tl-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Home dashboard blocks — products you need + reminders */
.home-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--stroke); }
.home-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.home-block-head b { font-size: .98rem; }
.link-btn { background: none; border: none; color: var(--violet); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; padding: 0; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.prod-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.prod-chip { font-size: .82rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: rgba(87,160,140,.12); border: 1px solid rgba(87,160,140,.30); color: var(--text); }
.reminders-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reminders-row small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }

/* personalized home greeting */
.greeting { font-weight: 800; font-size: 1.02rem; color: var(--violet); margin-bottom: 8px; letter-spacing: .2px; }
.greeting[hidden] { display: none; }

/* Home daily check-in line */
.home-checkin { color: var(--muted); font-size: .95rem; margin: -2px 0 14px; }
.home-checkin[hidden] { display: none; }
.home-checkin a { color: var(--violet); font-weight: 700; text-decoration: none; }
.home-checkin a:hover { text-decoration: underline; }

/* Guided multi-angle live capture */
.guide-cam { margin: 4px 0 14px; }
.guide-cam[hidden] { display: none; }
.guide-stage { position: relative; width: 100%; max-width: 360px; margin: 0 auto; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #000; }
.guide-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); } /* mirror = natural selfie */
.guide-ring { position: absolute; inset: 12%; border-radius: 50%; border: 3px solid rgba(255,255,255,.7); box-shadow: 0 0 0 9999px rgba(8,10,14,.34); transition: border-color .2s, transform .2s; }
.guide-ring.locking { border-color: var(--mint); transform: scale(1.03); animation: ringPulse 1s ease-in-out infinite; }
.guide-ring.captured { border-color: var(--mint); box-shadow: 0 0 0 9999px rgba(8,10,14,.34), 0 0 26px var(--mint); }
@keyframes ringPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.guide-step { text-align: center; font-weight: 800; font-size: 1.02rem; margin: 14px 0 8px; }
.guide-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.gdot { width: 9px; height: 9px; border-radius: 50%; background: var(--stroke); border: 1px solid var(--stroke); transition: background .2s, transform .2s; }
.gdot.on { background: var(--accent-grad); transform: scale(1.25); }
.guide-controls { display: flex; gap: 10px; justify-content: center; }
.guide-controls .btn { flex: 1; max-width: 200px; }

/* 3D "hologram" drag-to-rotate viewer */
.holo-viewer { position: relative; max-width: 380px; margin: 0 auto 8px; perspective: 950px; touch-action: none; user-select: none; cursor: grab; }
.holo-viewer.dragging { cursor: grabbing; }
.holo-stage { position: relative; width: 100%; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #07101a; transform-style: preserve-3d; box-shadow: 0 0 40px rgba(116,179,160,.18); }
.holo-rotor { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .1s ease-out; will-change: transform; }
.holo-frame { position: absolute; inset: 0; margin: 0; transition: opacity .12s ease; }
.holo-frame img { width: 100%; height: 100%; object-fit: cover; }
.holo-scan { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(116,179,160,.14), transparent 38%); mix-blend-mode: screen; }
.holo-label { position: absolute; top: 12px; left: 12px; font-size: .8rem; font-weight: 800; color: #fff; background: rgba(8,12,18,.55); padding: 3px 11px; border-radius: 999px; backdrop-filter: blur(3px); }
.holo-hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: .78rem; font-weight: 700; color: #fff; opacity: .9; transition: opacity .3s; text-shadow: 0 1px 6px rgba(0,0,0,.6); pointer-events: none; }
.spin-pin { position: absolute; width: 18px; height: 18px; transform: translate(-50%,-50%); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 8px rgba(0,0,0,.5); }
.spin-pin.m-red { background: rgba(255,70,85,.6); } .spin-pin.m-spot { background: rgba(255,190,60,.65); }

/* hologram arrow controls */
.holo-arrow { position: absolute; z-index: 3; width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(8,12,18,.5); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; backdrop-filter: blur(3px); display: grid; place-items: center; }
.holo-arrow:hover { background: rgba(8,12,18,.72); }
.holo-arrow.left { left: 8px; top: 50%; transform: translateY(-50%); }
.holo-arrow.right { right: 8px; top: 50%; transform: translateY(-50%); }
.holo-arrow.up { top: 8px; left: 50%; transform: translateX(-50%); }
.holo-arrow.down { bottom: 8px; left: 50%; transform: translateX(-50%); }

/* a11y: bigger tap targets + respect reduced motion */
.tabbar button { min-height: 48px; }
.modal-x, .shelf-x { min-width: 40px; min-height: 40px; }
@media (prefers-reduced-motion: reduce) {
  .orb, .scan-sweep, .scan-grid, .guide-ring.locking, .holo-rotor, .holo-frame, .heat, .pin, .hud-callout { animation: none !important; transition: none !important; }
  .screen, .modal-backdrop { animation: none !important; }
}

/* premium lock pill on CTAs + chat upsell bubble */
.cta-lock { display: inline-block; margin-left: 8px; font-size: .66rem; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.22); color: #fff; vertical-align: middle; }
.msg.assistant:has(+ *)[data-upsell], .chat-upsell { }

/* 3D face viewer (Three.js) */
.holo3d { position: relative; max-width: 380px; margin: 0 auto 8px; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #07101a; touch-action: none; user-select: none; cursor: grab; box-shadow: 0 0 36px rgba(116,179,160,.16); }
.holo3d:active { cursor: grabbing; }
.holo3d canvas { width: 100%; height: 100%; display: block; }
.holo3d-fallback { position: absolute; inset: 0; display: grid; place-items: center; gap: 8px; padding: 16px; text-align: center; }
.holo3d-fallback[hidden] { display: none; }
.holo3d-fallback img { max-width: 86%; max-height: 78%; border-radius: 12px; }
.holo3d-fallback span { color: #cfe0d4; font-size: .82rem; }

/* multi-angle "angles we checked" thumbnail strip (replaced the 3D viewer) */
.angle-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch; }
.angle-thumb { margin: 0; flex: 0 0 auto; width: 120px; border-radius: 12px; overflow: hidden; border: 1px solid var(--stroke); background: var(--card); }
.angle-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.angle-thumb figcaption { padding: 6px 8px; font-size: .78rem; font-weight: 700; text-align: center; color: var(--muted); }

/* "Why us" competitive differentiation band on the home hub */
.why-us { margin: 22px 0 6px; padding: 18px; border-radius: 16px; border: 1px solid var(--stroke); background: var(--card); }
.why-title { font-weight: 800; font-size: 1.02rem; margin-bottom: 12px; }
.why-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.why-list li { display: flex; gap: 11px; align-items: flex-start; font-size: .92rem; line-height: 1.4; color: var(--muted); }
.why-list li b { color: var(--ink); }
.why-ico { flex: 0 0 auto; font-size: 1.1rem; line-height: 1.3; }
.why-foot { margin: 14px 0 0; font-size: .84rem; color: var(--muted); }
.why-foot em { color: var(--violet); font-style: normal; font-weight: 700; }

/* skin-score "stock line" trend chart (Progress tab) */
.score-chart { margin: 4px 0 18px; padding: 14px 14px 10px; border-radius: 16px; border: 1px solid var(--stroke); background: var(--card); }
.sc-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.sc-head b { font-size: 1.7rem; font-weight: 800; }
.sc-delta { font-size: .82rem; font-weight: 700; color: var(--muted); }
.score-chart.up .sc-delta { color: var(--violet); }
.score-chart.down .sc-delta { color: var(--pink); }
.score-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.sc-line { fill: none; stroke: var(--violet); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.score-chart.down .sc-line { stroke: var(--pink); }
.sc-area { fill: rgba(87,160,140,.14); stroke: none; }
.score-chart.down .sc-area { fill: rgba(205,122,91,.14); }
.sc-dot { fill: var(--violet); }
.score-chart.down .sc-dot { fill: var(--pink); }
.sc-dot.last { stroke: var(--card); stroke-width: 2.5; }
.sc-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: .72rem; color: var(--muted); }

/* trustworthy trend chart extras: results-window band + coach note */
.sc-band { fill: rgba(87,160,140,.10); }
.score-chart.down .sc-band { fill: rgba(205,122,91,.10); }
.sc-bandlbl { fill: var(--muted); font-size: 8px; font-weight: 700; text-anchor: middle; }
.sc-coach { margin: 8px 0 0; font-size: .8rem; line-height: 1.35; color: var(--muted); }

/* "How your score is computed" trust/methodology panel */
.how-scored { margin: 2px 0 18px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--card); overflow: hidden; }
.how-scored summary { cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: .9rem; list-style: none; }
.how-scored summary::-webkit-details-marker { display: none; }
.how-scored summary::after { content: "▸"; float: right; color: var(--muted); transition: transform .2s; }
.how-scored[open] summary::after { transform: rotate(90deg); }
.how-body { padding: 0 14px 14px; font-size: .86rem; line-height: 1.45; color: var(--muted); }
.how-body b { color: var(--ink); }
.how-body ul { margin: 8px 0; padding-left: 18px; }
.how-foot { font-size: .78rem; opacity: .8; margin-top: 8px; }
