/* Tintify prototype - mobile first */
:root {
  --primary: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-700: #6d28d9;
  --primary-300: #c4b5fd;
  --primary-100: #ede9fe;
  --primary-50: #f5f3ff;
  --grad: linear-gradient(135deg, #a259f7 0%, #7c5cf0 100%);
  --bg: #f6f3fe;
  --card: #ffffff;
  --fg: #1e1b2e;
  --fg-2: #4b4862;
  --muted: #6e6a85;
  --border: #ebe6f6;
  --success: #1f9d55;
  --success-bg: #e3f6ea;
  --warning: #c77d0a;
  --warning-bg: #fdf1d8;
  --danger: #dc3c45;
  --danger-bg: #fde4e5;
  --info-bg: #dff4f5;
  --info: #1f8a8f;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 6px 24px -10px rgba(91, 52, 191, .18);
  --shadow-lg: 0 18px 50px -16px rgba(76, 42, 168, .35);
  --tab-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-head: "Outfit", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--fg);
  background: #e9e3f8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
svg.lucide { width: 20px; height: 20px; stroke-width: 2; flex: 0 0 auto; }

/* ---------- App shell ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 560px) {
  body {
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 600px at 20% 10%, #efe6ff, transparent 60%),
                radial-gradient(900px 600px at 90% 90%, #e2d8ff, transparent 60%), #ebe5f8;
  }
  .app {
    height: min(920px, calc(100dvh - 40px));
    border-radius: 36px;
    box-shadow: 0 30px 80px -20px rgba(60, 30, 140, .35), 0 0 0 10px #1e1b2e, 0 0 0 12px #3a3550;
  }
}
.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  outline: none;
  padding-bottom: 24px;
  scroll-behavior: smooth;
}
.screen.has-tab { padding-bottom: 28px; }
.page { padding: calc(20px + var(--safe-t)) 18px 8px; animation: fade-up .28s ease both; }
.page > * + * { margin-top: 18px; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tab bar ---------- */
.tabbar {
  flex: 0 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 0 6px var(--safe-b);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 28px -18px rgba(76, 42, 168, .35);
  z-index: 20;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-width: 0;
  color: #8f8aa6;
  font-size: 11px; font-weight: 500;
  transition: color .2s;
  position: relative;
}
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tab .tab-ic { width: 52px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: background .25s, transform .25s; }
.tab svg.lucide { width: 22px; height: 22px; }
.tab.active { color: var(--primary-700); font-weight: 600; }
.tab.active .tab-ic { background: var(--primary-100); transform: translateY(-1px); }
.tab:active .tab-ic { transform: scale(.92); }

/* ---------- Generic ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(235, 230, 246, .8);
}
.card-title { font-size: 19px; font-weight: 600; }
.card-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.page-title { font-size: 30px; font-weight: 700; line-height: 1.12; }
.page-sub { color: var(--muted); font-size: 15px; margin-top: 6px; line-height: 1.45; }
.section-label { font-size: 15px; font-weight: 600; color: var(--fg-2); margin: 22px 2px 10px; display: flex; align-items: center; gap: 8px; }
.section-label svg.lucide { color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 16px;
  font-weight: 600; font-size: 15.5px;
  transition: transform .12s, opacity .2s, box-shadow .2s;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(124, 58, 237, .7); }
.btn-soft { background: var(--primary-100); color: var(--primary-700); }
.btn-outline { background: #fff; color: var(--fg); border: 1px solid var(--border); }
.btn-ghost { color: var(--primary-600); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 12px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--border); color: var(--fg-2);
}
.icon-btn:active { transform: scale(.95); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.b-good { background: var(--success-bg); color: var(--success); }
.b-mod { background: var(--warning-bg); color: var(--warning); }
.b-bad { background: var(--danger-bg); color: var(--danger); }
.b-info { background: var(--primary-100); color: var(--primary-700); }
.b-crit { background: #fde4e5; color: #c62832; letter-spacing: .04em; font-size: 11.5px; }
.b-high { background: #ffead6; color: #c2570c; letter-spacing: .04em; font-size: 11.5px; }
.b-med { background: var(--warning-bg); color: var(--warning); letter-spacing: .04em; font-size: 11.5px; }
.b-low { background: var(--success-bg); color: var(--success); letter-spacing: .04em; font-size: 11.5px; }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border); text-align: left; width: 100%;
}
.list-item:last-child { border-bottom: 0; }
.li-icon {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  background: var(--primary-50); color: var(--primary); flex: 0 0 auto;
}
.li-title { font-weight: 600; font-size: 15.5px; color: var(--fg-2); }
.li-sub { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.chev { color: #a59fbd; }

/* ---------- Auth ---------- */
.auth { min-height: 100%; display: flex; flex-direction: column; padding: calc(28px + var(--safe-t)) 22px 28px; animation: fade-up .3s ease both; }
.auth-hero { text-align: center; margin-bottom: 26px; }
.auth-top { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
.lang-switch button { min-width: 44px; height: 32px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lang-switch button.active { background: var(--grad); color: #fff; }
.auth-logo { width: 116px; height: 116px; border-radius: 32px; margin: 8px auto 18px; box-shadow: var(--shadow-lg); }
.auth-hero h1 { font-size: 28px; font-weight: 700; }
.auth-hero p { color: var(--muted); margin-top: 8px; font-size: 14.5px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg-2); margin-bottom: 7px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg.lucide { position: absolute; left: 15px; color: #a59fbd; width: 19px; height: 19px; pointer-events: none; }
.input {
  width: 100%; height: 52px; border-radius: 15px; border: 1.5px solid var(--border);
  background: #fff; padding: 0 16px 0 44px; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input.no-icon { padding-left: 16px; }
.input:focus { border-color: var(--primary-300); box-shadow: 0 0 0 4px rgba(139, 92, 246, .12); }
.input.error { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: 12.5px; margin-top: 6px; }
.pw-toggle { position: absolute; right: 8px; width: 38px; height: 38px; display: grid; place-items: center; color: #a59fbd; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-btn { background: #fff; border: 1px solid var(--border); color: var(--fg); }
.auth-foot { text-align: center; margin-top: 22px; font-size: 14.5px; color: var(--muted); }
.link { color: var(--primary-600); font-weight: 600; }
.demo-note { margin-top: auto; padding-top: 22px; text-align: center; font-size: 12px; color: #a59fbd; }

/* ---------- Home ---------- */
.hero {
  position: relative;
  margin: 0 0 4px;
  padding: calc(26px + var(--safe-t)) 22px 30px;
  background: url("../assets/header.jpg") center/cover, var(--grad);
  border-radius: 0 0 34px 34px;
  overflow: hidden;
}
.hero h1 { font-size: 32px; font-weight: 700; color: var(--primary-600); display: flex; align-items: center; gap: 6px; }
.hero p { color: #6b58a8; margin-top: 8px; font-size: 15.5px; }
.hero .avatar-btn { z-index: 2; position: absolute; right: 18px; top: calc(22px + var(--safe-t)); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.45); color: #fff; font-weight: 700; font-family: var(--font-head); font-size: 19px;
  border: 2px solid rgba(255,255,255,.7); backdrop-filter: blur(4px);
}
.wave { display: inline-block; animation: wave 2.2s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100% { transform: rotate(0); } 10%,30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.home-body { padding: 18px 18px 6px; }
.home-body > * + * { margin-top: 16px; }
.step-card { display: flex; align-items: center; gap: 18px; width: 100%; text-align: left; padding: 20px 18px; }
.step-card:active { transform: scale(.99); }
.step-num {
  width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 18px; flex: 0 0 auto;
  box-shadow: 0 8px 18px -8px rgba(124, 58, 237, .8);
}
.step-card h3 { font-size: 19px; font-weight: 500; color: #4a5568; }
.step-card p { color: #6b7280; font-size: 14px; margin-top: 4px; line-height: 1.45; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  border-radius: 20px; padding: 16px; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between;
  border: 1.5px solid; text-align: left;
}
.stat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.stat-val { font-family: var(--font-head); font-size: 34px; font-weight: 600; line-height: 1; margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.stat-val small { font-size: 13px; font-weight: 500; font-family: var(--font); }
.s-purple { background: #f1ebff; border-color: #ddd0fb; color: #6d4bd8; }
.s-cyan { background: #daf4f4; border-color: #b2e5e6; color: #1b7f86; }
.s-green { background: #e6f6ec; border-color: #c4e9d1; color: #1f8a4c; }
.s-orange { background: #fdf2df; border-color: #f7ddb1; color: #b0650b; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0,0,0,.08); }

.tip-card { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(135deg, #fff, #f6f0ff); }
.tip-card .li-icon { background: var(--grad); color: #fff; }

.chip-row { display: flex; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--primary-100); color: var(--primary-600); background: #fff; white-space: nowrap;
}
.chip.active { background: var(--primary-50); border-color: var(--primary-300); }

.chart { width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart text { font-family: var(--font); font-size: 11px; fill: #8a85a0; }

.habit-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.habit-row:last-child { border-bottom: 0; }
.habit-row > svg.lucide { color: var(--fg-2); width: 24px; height: 24px; }

.scan-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.scan-row:last-child { border-bottom: 0; }
.swatch-sm { width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(0,0,0,.06); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #6b5a3a; }
.conf { font-weight: 600; font-size: 14px; color: var(--fg-2); text-align: right; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 18px; margin: 0 -18px; padding: 2px 18px 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }
.hscroll::after { content: ""; flex: 0 0 6px; }
.article { width: 230px; padding: 0; overflow: hidden; text-align: left; }
.article-cover { height: 120px; background: var(--primary-100); overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.article:active .article-cover img { transform: scale(1.04); }
.article-body { padding: 14px; }
.article-body h4 { font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.article-body p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- Segmented ---------- */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 18px; background: rgba(139, 92, 246, .07); }
.seg {
  height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--fg-2); font-weight: 500; font-size: 15px;
}
.seg.active { background: #fff; color: var(--fg); font-weight: 600; box-shadow: 0 6px 18px -8px rgba(76, 42, 168, .35); }

/* ---------- Scan ---------- */
.dropzone {
  border: 2px dashed var(--primary-300); border-radius: 30px; background: rgba(255,255,255,.5);
  min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 28px 20px; position: relative; overflow: hidden; width: 100%;
  transition: background .2s, border-color .2s;
}
.dropzone.drag { background: var(--primary-50); border-color: var(--primary); }
.dz-icon {
  width: 92px; height: 92px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; margin-bottom: 22px; box-shadow: 0 16px 30px -12px rgba(124, 58, 237, .7);
}
.dz-icon svg.lucide { width: 38px; height: 38px; }
.dropzone h3 { font-size: 24px; font-weight: 600; }
.dropzone p { color: var(--muted); margin-top: 8px; font-size: 14.5px; line-height: 1.5; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.preview { position: relative; border-radius: 26px; overflow: hidden; background: #000; aspect-ratio: 4/3; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview .tag { position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.5); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; backdrop-filter: blur(6px); }
.preview .x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; }
.camera-frame {
  position: relative; border-radius: 30px; overflow: hidden; aspect-ratio: 3/4; max-height: 420px; width: 100%;
  background: radial-gradient(circle at 50% 45%, #3a2f5c, #14101f 75%);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.camera-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cf-guide { position: relative; width: 72%; aspect-ratio: 2/1; border-radius: 40% 40% 46% 46% / 50% 50% 50% 50%; border: 2.5px dashed rgba(255,255,255,.75); }
.cf-hint { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 13.5px; color: rgba(255,255,255,.85); padding: 0 16px; }
.cf-top { position: absolute; top: 16px; left: 0; right: 0; display: flex; justify-content: center; }
.cf-top span { background: rgba(255,255,255,.14); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; backdrop-filter: blur(6px); }
.shutter-row { display: flex; align-items: center; justify-content: center; gap: 28px; }
.shutter { width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 5px solid var(--primary-300); box-shadow: 0 0 0 4px #fff, var(--shadow-lg); position: relative; }
.shutter::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--grad); }
.shutter:active { transform: scale(.94); }
.shade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.shade-opt {
  aspect-ratio: 1; border-radius: 18px; border: 2px solid transparent; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-weight: 700; color: #5d4a2a; font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); transition: transform .12s;
}
.shade-opt small { font-size: 10px; font-weight: 500; opacity: .75; margin-top: 2px; }
.shade-opt.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139, 92, 246, .25); transform: scale(1.04); }
.disclaimer { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; color: var(--muted); line-height: 1.5; }
.disclaimer svg.lucide { color: var(--primary); width: 26px; height: 26px; }
.disclaimer b { color: var(--fg); }
.tips-list { display: grid; gap: 10px; margin-top: 12px; }
.tips-list div { display: flex; gap: 10px; font-size: 13.5px; color: var(--fg-2); align-items: flex-start; line-height: 1.45; }
.tips-list svg.lucide { color: var(--success); width: 18px; height: 18px; margin-top: 1px; }

/* Analyzing overlay */
.overlay {
  position: absolute; inset: 0; z-index: 60; background: rgba(246, 243, 254, .92); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.scanner { width: 130px; height: 130px; border-radius: 36px; background: var(--grad); display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.scanner svg.lucide { width: 60px; height: 60px; }
.scanner::after { content: ""; position: absolute; left: 0; right: 0; height: 36px; background: linear-gradient(180deg, transparent, rgba(255,255,255,.55), transparent); animation: scan 1.4s ease-in-out infinite; }
@keyframes scan { from { top: -36px; } to { top: 130px; } }
.overlay h3 { font-size: 21px; margin-top: 26px; }
.overlay p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.progress { width: 220px; height: 8px; border-radius: 99px; background: var(--primary-100); margin-top: 20px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .3s ease; }
.steps-mini { margin-top: 16px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.steps-mini .done { color: var(--success); }

/* Result */
.result-head { display: flex; gap: 18px; align-items: center; }
.swatch-lg { width: 108px; height: 108px; border-radius: 26px; border: 2px solid rgba(0,0,0,.06); flex: 0 0 auto; box-shadow: inset 0 -10px 24px rgba(0,0,0,.05); }
.shade-big { font-family: var(--font-head); font-size: 50px; font-weight: 600; line-height: 1; color: #4a5a6a; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.metric { background: var(--primary-50); border-radius: 16px; padding: 12px 10px; text-align: center; }
.metric b { display: block; font-family: var(--font-head); font-size: 18px; }
.metric span { font-size: 11.5px; color: var(--muted); }

/* ---------- Habit ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h3 { font-size: 21px; font-weight: 400; color: #4a5568; font-family: var(--font); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 18px; }
.day {
  border: 1.5px solid var(--border); border-radius: 999px; padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); position: relative; min-width: 0;
}
.day b { font-size: 19px; font-weight: 500; color: var(--fg-2); }
.day.active { background: var(--primary); border-color: var(--primary); color: #f1eaff; }
.day.active b { color: #fff; }
.day.logged::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.day.active.logged::after { background: #fff; }
.day.future { opacity: .55; }
.ach { width: 138px; padding: 16px 10px; text-align: center; border-radius: 20px; background: #fff; border: 1.5px solid var(--border); }
.ach svg.lucide { width: 30px; height: 30px; margin: 0 auto 10px; color: #c9c3da; }
.ach.on svg.lucide { color: #f08c1b; }
.ach b { display: block; font-size: 14px; font-weight: 500; color: var(--fg-2); }
.ach span { font-size: 12.5px; color: #a59fbd; }
.ach.on span { color: var(--primary-600); }
.toggle-card { padding: 0 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row span { font-size: 16px; color: var(--fg-2); }
.switch { position: relative; width: 60px; height: 34px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #e7defc; border: 2px solid #b9add6; transition: .2s; }
.switch i::after { content: ""; position: absolute; left: 4px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.switch input:checked + i { background: var(--primary); border-color: var(--primary); }
.switch input:checked + i::after { left: 30px; }
.counter-row { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.counter-row:last-child { border-bottom: 0; }
.counter-row > svg.lucide { color: var(--fg-2); width: 24px; height: 24px; }
.counter-row .lbl { flex: 1; min-width: 0; font-size: 15.5px; color: var(--fg-2); }
.counter { display: flex; align-items: center; gap: 6px; }
.counter button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #64748b; }
.counter button.plus { color: var(--primary); }
.counter button svg.lucide { width: 28px; height: 28px; stroke-width: 1.8; }
.counter output { min-width: 28px; text-align: center; font-size: 19px; font-weight: 500; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 150px; margin-top: 18px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 11.5px; color: var(--muted); }
.bar i { width: 100%; max-width: 30px; border-radius: 10px 10px 6px 6px; background: var(--primary-100); transition: height .4s ease; display: block; }
.bar i.hi { background: var(--grad); }
.bar em { font-style: normal; font-weight: 600; color: var(--fg-2); }
.insight-box { border: 1.5px solid #e2d6fb; background: linear-gradient(160deg, #f6f0ff, #fff); border-radius: var(--radius); padding: 20px; }
.insight-box h3 { color: var(--primary-600); font-weight: 500; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.insight-item { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--border); margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--fg-2); }
.insight-item svg.lucide { color: var(--primary); margin-top: 2px; }

/* ---------- Analysis ---------- */
.vita-scale { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 10px; scrollbar-width: none; }
.vita-scale::-webkit-scrollbar { display: none; }
.vita-dot { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; color: #6b5a3a; border: 1.5px solid rgba(0,0,0,.08); }
.vita-dot.active { border: 3.5px solid var(--primary); color: var(--primary-600); box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .6); }
.info-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--primary-50); border: 1px solid #e2d6fb; font-size: 14.5px; line-height: 1.5; color: var(--fg-2); }
.info-box svg.lucide { color: var(--primary); }
.gauge-wrap { display: flex; align-items: center; gap: 18px; }
.gauge { position: relative; width: 128px; height: 128px; flex: 0 0 auto; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .gv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge .gv b { font-family: var(--font-head); font-size: 36px; line-height: 1; }
.gauge .gv span { font-size: 12px; color: var(--muted); }
.risk-item { border: 1px solid var(--border); border-radius: 18px; padding: 14px; margin-top: 12px; background: #fff; }
.risk-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.risk-head h4 { font-size: 15.5px; font-weight: 600; font-family: var(--font); }
.meter { height: 8px; border-radius: 99px; background: #f0ecf8; overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; border-radius: 99px; }
.risk-body { margin-top: 14px; font-size: 13.5px; color: var(--fg-2); line-height: 1.55; }
.risk-body h5 { font-size: 11.5px; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; font-weight: 700; }
.crit { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.crit:last-child { border-bottom: 0; }
.crit .row { font-weight: 600; font-size: 13px; }
.crit p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.factor { display: flex; gap: 8px; margin-top: 6px; }
.factor::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary-300); margin-top: 7px; flex: 0 0 auto; }
.rot { transition: transform .2s; }
.open .rot { transform: rotate(180deg); }

/* ---------- Recommendations ---------- */
.filter { display: inline-flex; padding: 4px; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.filter button { padding: 9px 16px; border-radius: 999px; font-size: 14px; color: var(--fg-2); white-space: nowrap; }
.filter button.active { background: var(--fg); color: #fff; font-weight: 600; }
.prog-card { display: flex; align-items: center; gap: 14px; }
.rec { position: relative; }
.rec.done { opacity: .72; }
.rec-top { display: flex; gap: 14px; align-items: center; }
.rec-top .li-icon { width: 56px; height: 56px; border-radius: 18px; }
.rec h3 { font-size: 19px; font-weight: 500; color: #4a5568; font-family: var(--font); line-height: 1.3; }
.rec .desc { color: #6b7280; font-size: 14.5px; line-height: 1.55; margin-top: 8px; }
.ct { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; margin-top: 16px; padding-bottom: 16px; border-bottom: 1.5px solid var(--border); }
.ct small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.ct .cur { color: var(--danger); font-size: 14.5px; line-height: 1.4; }
.ct .tgt { color: var(--success); font-size: 14.5px; line-height: 1.4; }
.diff { display: flex; gap: 5px; margin-top: 4px; }
.diff i { width: 12px; height: 12px; border-radius: 50%; background: #e5ddfb; }
.diff i.on { background: var(--primary); }
.steps-box { background: #faf8ff; border-radius: 18px; padding: 16px; margin-top: 16px; }
.steps-box h5 { font-size: 15px; font-weight: 500; color: var(--fg-2); margin: 0 0 6px; }
.step-li { display: flex; gap: 12px; margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--fg-2); }
.step-li i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12.5px; flex: 0 0 auto; margin-top: 1px; }
.why { font-style: italic; color: var(--muted); font-size: 13px; margin-top: 14px; line-height: 1.5; }
.rec-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- Profile ---------- */
.profile-hero { text-align: center; padding: 6px 0 4px; }
.profile-hero .avatar { width: 96px; height: 96px; font-size: 34px; margin: 0 auto; background: var(--grad); border: 4px solid #fff; box-shadow: var(--shadow-lg); }
.profile-hero h2 { font-size: 24px; margin-top: 14px; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pstat { background: #fff; border-radius: 18px; padding: 14px 8px; text-align: center; border: 1px solid var(--border); }
.pstat b { display: block; font-family: var(--font-head); font-size: 24px; color: var(--primary-600); }
.pstat span { font-size: 11.5px; color: var(--muted); }
.settings .list-item { padding: 15px 0; }
.settings .li-icon { width: 40px; height: 40px; border-radius: 13px; }
.settings .li-icon svg.lucide { width: 19px; height: 19px; }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 14, 40, .45); z-index: 80; animation: fade .2s ease both; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 81;
  background: #fff; border-radius: 28px 28px 0 0; max-height: 88%;
  display: flex; flex-direction: column; animation: sheet-up .28s cubic-bezier(.2,.9,.3,1) both;
  padding-bottom: var(--safe-b);
}
.sheet.closing { animation: sheet-down .22s ease forwards; }
.sheet-backdrop.closing { animation: fade .22s ease reverse forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
.sheet-grip { width: 44px; height: 5px; border-radius: 99px; background: #ddd6ee; margin: 10px auto 4px; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 10px; flex: 0 0 auto; }
.sheet-head h3 { font-size: 20px; }
.sheet-body { padding: 4px 20px 22px; overflow-y: auto; }
.sheet-body > * + * { margin-top: 14px; }
.article-sheet-cover { aspect-ratio: 16/10; border-radius: 20px; overflow: hidden; background: var(--primary-100); }
.article-sheet-cover img { width: 100%; height: 100%; object-fit: cover; }
.prose { font-size: 15px; line-height: 1.65; color: var(--fg-2); }
.prose p + p { margin-top: 12px; }
.recap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.recap-grid > div { border-radius: 16px; padding: 14px; background: var(--primary-50); }
.recap-grid b { display: block; font-family: var(--font-head); font-size: 24px; }
.recap-grid span { font-size: 12px; color: var(--muted); }
.lang-opt { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px; border-radius: 16px; border: 1.5px solid var(--border); font-weight: 500; }
.lang-opt.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }

/* ---------- Toast ---------- */
.toast-root { position: absolute; top: calc(14px + var(--safe-t)); left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: center; max-width: 100%;
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 13px 16px; font-size: 14px; font-weight: 500;
  box-shadow: 0 14px 44px -10px rgba(76, 42, 168, .38); animation: toast-in .3s cubic-bezier(.21,1.02,.73,1) both;
}
.toast svg.lucide { width: 20px; height: 20px; }
.toast.success svg.lucide { color: var(--success); }
.toast.info svg.lucide { color: var(--primary); }
.toast.error svg.lucide { color: var(--danger); }
.toast.out { animation: toast-out .22s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px) scale(.96); } }

.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.empty svg.lucide { width: 44px; height: 44px; color: var(--primary-300); margin: 0 auto 10px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Small phones ---------- */
@media (max-width: 360px) {
  .page { padding-left: 14px; padding-right: 14px; }
  .home-body { padding-left: 14px; padding-right: 14px; }
  .hscroll { margin: 0 -14px; padding-left: 14px; padding-right: 14px; scroll-padding: 0 14px; }
  .rec-top .li-icon { width: 46px; height: 46px; }
  .rec h3 { font-size: 17px; }
  .page-title { font-size: 26px; }
  .hero h1 { font-size: 27px; }
  .stat-val { font-size: 28px; }
  .stat { padding: 13px; min-height: 100px; }
  .stat-head { font-size: 10.5px; }
  .step-card { gap: 14px; padding: 16px 14px; }
  .step-card h3 { font-size: 17px; }
  .seg { font-size: 13.5px; gap: 5px; }
  .seg svg.lucide { width: 17px; height: 17px; }
  .day { padding: 10px 0; font-size: 11px; }
  .day b { font-size: 16px; }
  .ct { grid-template-columns: 1fr 1fr; }
  .ct > :last-child { grid-column: 1 / -1; }
  .tab { font-size: 10px; }
  .tab svg.lucide { width: 20px; height: 20px; }
  .tab .tab-ic { width: 44px; }
  .shade-grid { gap: 8px; }
  .gauge { width: 108px; height: 108px; }
  .gauge .gv b { font-size: 30px; }
  .swatch-lg { width: 88px; height: 88px; }
  .shade-big { font-size: 42px; }
  .filter button { padding: 8px 12px; font-size: 13px; }
}
/* ---------- Splash ---------- */
.splash {
  position: absolute; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 80% at 50% 30%, #f3ebff 0%, #e4d4fd 55%, #cdb4fb 100%);
  transition: opacity .45s ease, transform .45s ease;
}
.splash.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash-logo { width: 132px; height: 132px; border-radius: 38px; overflow: hidden; box-shadow: 0 24px 60px -18px rgba(91, 52, 191, .6); animation: splash-pop .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.splash-logo img { width: 100%; height: 100%; object-fit: cover; }
.splash-name { font-family: var(--font-head); font-weight: 700; font-size: 34px; color: var(--primary-700); margin-top: 22px; letter-spacing: .02em; animation: fade-up .5s .25s ease both; }
.splash-tag { color: #7a69b8; font-size: 14px; margin-top: 4px; animation: fade-up .5s .4s ease both; }
.splash-dots { display: flex; gap: 7px; margin-top: 34px; }
.splash-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: .3; animation: dot 1s ease-in-out infinite; }
.splash-dots i:nth-child(2) { animation-delay: .15s; }
.splash-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes splash-pop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes dot { 0%, 100% { opacity: .25; transform: none; } 50% { opacity: 1; transform: translateY(-4px); } }

/* ---------- Onboarding ---------- */
.onb { height: 100%; display: flex; flex-direction: column; padding: calc(16px + var(--safe-t)) 0 calc(20px + var(--safe-b)); }
.onb-top { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.onb-mini { width: 40px; height: 40px; border-radius: 12px; }
.onb-track { flex: 1 1 auto; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; min-height: 0; }
.onb-track::-webkit-scrollbar { display: none; }
.onb-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px 28px 0; min-height: 0; }
.onb-photo { position: relative; width: min(100%, 300px); aspect-ratio: 36 / 41; max-height: 46vh; isolation: isolate; }
.onb-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 36px; box-shadow: 0 24px 50px -22px rgba(76, 42, 168, .55); }
.onb-photo::before { content: ""; position: absolute; inset: 14px -12px -12px 14px; border-radius: 40px; background: var(--primary-100); z-index: -1; transform: rotate(3deg); }
.onb-badge { position: absolute; right: -10px; bottom: 22px; width: 62px; height: 62px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(124, 58, 237, .8); }
.onb-badge svg.lucide { width: 30px; height: 30px; }
.onb-slide h1 { font-size: 28px; font-weight: 700; margin-top: 30px; line-height: 1.15; }
.onb-slide p { color: var(--muted); font-size: 15.5px; line-height: 1.55; margin-top: 10px; max-width: 320px; }
.onb-foot { padding: 0 22px; }
.onb-dots { display: flex; justify-content: center; gap: 8px; margin: 18px 0 20px; }
.onb-dots i { width: 8px; height: 8px; border-radius: 99px; background: #d9cff3; transition: width .3s, background .3s; }
.onb-dots i.on { width: 26px; background: var(--primary); }
.onb .btn-ghost { padding: 0 18px; }
@media (max-height: 640px) { .onb-photo { max-height: 36vh; } .onb-slide h1 { font-size: 23px; margin-top: 20px; } .onb-slide p { font-size: 14px; } }

/* ---------- Kartu scan & instal di beranda ---------- */
.scan-cta {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; overflow: hidden;
  padding: 20px; border-radius: 26px; color: #fff; background: var(--grad);
  box-shadow: 0 20px 40px -18px rgba(109, 40, 217, .75);
}
.scan-cta:active { transform: scale(.99); }
.scan-cta::after { content: ""; position: absolute; width: 240px; height: 240px; right: -90px; top: -110px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.cta-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .03em; background: rgba(255, 255, 255, .18); padding: 5px 10px; border-radius: 999px; }
.cta-kicker svg.lucide { width: 14px; height: 14px; }
.scan-cta h2 { font-size: 22px; font-weight: 700; margin-top: 12px; line-height: 1.2; }
.scan-cta p { font-size: 13.5px; opacity: .9; margin-top: 6px; }
.cta-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; background: #fff; color: var(--primary-700); font-weight: 700; font-size: 14.5px; padding: 10px 16px; border-radius: 14px; }
.cta-btn svg.lucide { width: 18px; height: 18px; }
.cta-art { position: relative; width: 92px; height: 92px; flex: 0 0 auto; display: grid; place-items: center; z-index: 1; }
.cta-icon { width: 64px; height: 64px; border-radius: 22px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.cta-icon svg.lucide { width: 34px; height: 34px; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); animation: ring 2.4s ease-out infinite; }
.ring.r2 { animation-delay: 1.2s; }
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }
.install-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 40px 14px 14px; border-radius: 20px; background: #fff; border: 1.5px dashed var(--primary-300); }
.install-card .li-sub { font-size: 12.5px; }
@media (max-width: 400px) { .install-card { flex-wrap: wrap; } .install-card .grow { flex: 1 1 calc(100% - 60px); } .install-card .btn { width: 100%; } }
.install-x { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #a59fbd; }
.install-x svg.lucide { width: 16px; height: 16px; }
.ios-steps .step-li svg.lucide { width: 16px; height: 16px; vertical-align: -3px; color: var(--primary); }
@media (max-width: 360px) { .cta-art { width: 70px; height: 70px; } .cta-icon { width: 52px; height: 52px; } .scan-cta h2 { font-size: 19px; } }

/* ---------- Animasi ---------- */
.a-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 1.1s .1s ease-out both; }
@keyframes draw { from { stroke-dashoffset: 1; } }
.a-fade { animation: fade .8s .5s ease both; }
.a-pop { animation: pop .35s ease-out both; }
@keyframes pop { from { opacity: 0; transform: scale(0); } }
.a-arc { animation: arc 1.1s .15s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes arc { from { stroke-dashoffset: var(--len); } }
.bar i { transform-origin: bottom; animation: grow-y .7s cubic-bezier(.3, .7, .2, 1) both; }
.bar:nth-child(2) i { animation-delay: .05s; } .bar:nth-child(3) i { animation-delay: .1s; } .bar:nth-child(4) i { animation-delay: .15s; }
.bar:nth-child(5) i { animation-delay: .2s; } .bar:nth-child(6) i { animation-delay: .25s; } .bar:nth-child(7) i { animation-delay: .3s; }
@keyframes grow-y { from { transform: scaleY(0); } }
.meter > i { transform-origin: left; animation: grow-x .9s .1s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes grow-x { from { transform: scaleX(0); } }
.page { animation: none; }
.home-body > *, .page > * { animation: fade-up .45s ease both; }
.home-body > :nth-child(2), .page > :nth-child(2) { animation-delay: .05s; }
.home-body > :nth-child(3), .page > :nth-child(3) { animation-delay: .1s; }
.home-body > :nth-child(4), .page > :nth-child(4) { animation-delay: .15s; }
.home-body > :nth-child(5), .page > :nth-child(5) { animation-delay: .2s; }
.home-body > :nth-child(n+6), .page > :nth-child(n+6) { animation-delay: .25s; }
.still *:not(.ring), .still *::before, .still *::after { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
