/* ===== SuTakip — Su İçme Hatırlatıcısı ===== */

:root {
  --bg: #eef6fb;
  --bg-grad-1: #e6f3fb;
  --bg-grad-2: #f7fbfd;
  --surface: #ffffff;
  --surface-2: #f2f8fc;
  --text: #0e2433;
  --text-muted: #5c7a8a;
  --primary: #0f8fd1;
  --primary-dark: #0a6fa8;
  --primary-light: #5fc4ee;
  --accent: #18c29c;
  --danger: #e2554a;
  --ring-bg: #d9ecf6;
  --border: #dceaf2;
  --shadow: 0 10px 30px rgba(15, 111, 168, 0.13);
  --shadow-sm: 0 2px 10px rgba(15, 111, 168, 0.09);
  --surface-glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --radius: 20px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg: #0b1722;
  --bg-grad-1: #0c1b28;
  --bg-grad-2: #0a141d;
  --surface: #122433;
  --surface-2: #16293a;
  --text: #eaf4fa;
  --text-muted: #82a2b3;
  --primary: #34b3ed;
  --primary-dark: #1f8dc2;
  --primary-light: #7fd4f5;
  --accent: #2fe0b4;
  --danger: #ff6b61;
  --ring-bg: #1b3247;
  --border: #1d3344;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
  --surface-glass: rgba(18, 36, 51, 0.72);
  --glass-border: rgba(255, 255, 255, 0.07);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2));
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
  overflow-x: hidden;
}
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
body::before {
  width: 340px; height: 340px;
  top: -110px; right: -100px;
  background: radial-gradient(circle, var(--primary-light), transparent 70%);
  opacity: 0.65;
}
body::after {
  width: 380px; height: 380px;
  bottom: -150px; left: -130px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  opacity: 0.3;
}
[data-theme="dark"] body::before { opacity: 0.26; }
[data-theme="dark"] body::after { opacity: 0.17; }
.onboarding, .app { position: relative; z-index: 1; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

/* ===== Buttons ===== */
.btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 18px rgba(15, 143, 209, 0.35);
}
.btn.ghost {
  background: var(--surface-2);
  color: var(--text);
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  margin-top: 28px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 20px; height: 20px; fill: var(--text); }

/* ===== Onboarding ===== */
.onboarding {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px;
  padding-top: calc(32px + var(--safe-top));
  padding-bottom: calc(32px + var(--safe-bottom));
}
.onboarding-wrap {
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.onboarding-logo {
  width: 88px; height: 88px;
  margin: 0 auto 18px;
}
.drop-anim { width: 100%; height: 100%; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(15,143,209,0.35)); }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.progress-dots { display: flex; justify-content: center; gap: 7px; margin-bottom: 26px; }
.progress-dots .dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--ring-bg);
  transition: all 0.25s ease;
}
.progress-dots .dot.active { width: 20px; background: linear-gradient(90deg, var(--primary-light), var(--primary)); }
.progress-dots .dot.done { background: var(--primary-light); }

.onboarding-step { animation: stepIn 0.35s cubic-bezier(.4,0,.2,1); }
@keyframes stepIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
.onboarding-step h1 { font-size: 26px; margin-bottom: 12px; }
.onboarding-step h2 { font-size: 22px; margin-bottom: 6px; }
.muted { color: var(--text-muted); font-size: 14.5px; line-height: 1.5; margin-bottom: 24px; }
.onboarding-step .btn { margin-top: 28px; }

/* ===== Auth gate ===== */
.auth-wrap .onboarding-logo { margin-bottom: 14px; }
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  text-align: left;
}
.auth-input-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 14px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease;
}
.auth-input-row:focus-within { border-color: var(--primary); }
.auth-input-row.invalid { border-color: var(--danger); }
.auth-input-icon { width: 19px; height: 19px; fill: none; stroke: var(--text-muted); flex-shrink: 0; }
.auth-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15.5px;
  font-weight: 500;
  text-align: left;
  padding: 13px 0;
  color: var(--text);
}
.auth-pass-toggle {
  background: none; border: none; padding: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.auth-pass-toggle svg { width: 19px; height: 19px; fill: none; stroke: var(--text-muted); }
.auth-card .field-error { margin-top: -2px; margin-bottom: 10px; }
.auth-card .btn.primary { margin-top: 4px; }
.auth-links-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.auth-links-row .link-btn { font-size: 13px; padding: 2px; }
.auth-links-sep { color: var(--border); font-size: 12px; }
.auth-card .app-version { margin: 10px 0 0; padding: 0; }
.auth-secure-note {
  display: flex; align-items: center; gap: 7px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 16px;
  text-align: left;
}
.auth-secure-note svg { width: 16px; height: 16px; fill: none; stroke: var(--primary); flex-shrink: 0; }
.auth-credit {
  text-align: center;
  color: var(--text-muted);
  font-size: 11.5px;
  margin-top: 22px;
  opacity: 0.75;
}
.auth-eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0 auto 14px;
  width: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
  animation: fadein 0.4s ease;
}
.auth-eyebrow svg { width: 13px; height: 13px; fill: var(--primary); }
.auth-card { animation: chatPanelIn 0.3s cubic-bezier(.22,1,.36,1); }
.auth-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.auth-feature {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  padding: 12px 6px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.auth-feature svg { width: 20px; height: 20px; fill: var(--primary); stroke: var(--primary); }
.auth-feature span { font-size: 10.5px; font-weight: 600; color: var(--text-muted); line-height: 1.3; }

.field-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  text-align: left;
  animation: fadein 0.2s ease;
}
.shake { animation: shake 0.4s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.input-row.invalid, .choice-group.invalid .choice-btn { border-color: var(--danger) !important; }

.input-row {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 18px;
  box-shadow: var(--shadow-sm);
}
.input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  padding: 14px 0;
  color: var(--text);
  text-align: center;
}
.input-row .suffix { color: var(--text-muted); font-weight: 600; font-size: 15px; }

.choice-group { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.choice-btn {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 44px 16px 18px;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.choice-btn span {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-muted);
}
.choice-btn::after {
  content: "";
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%) scale(0);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  transition: transform 0.2s cubic-bezier(.4,0,.2,1);
}
.choice-btn::before {
  content: "";
  position: absolute;
  right: 23.5px; top: 50%;
  width: 8px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-65%) rotate(-45deg) scale(0);
  transform-origin: center;
  z-index: 1;
  transition: transform 0.2s cubic-bezier(.4,0,.2,1) 0.05s;
}
.choice-btn.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(15,143,209,0.10), rgba(15,143,209,0.02));
}
.choice-btn.selected::after { transform: translateY(-50%) scale(1); }
.choice-btn.selected::before { transform: translateY(-65%) rotate(-45deg) scale(1); }
.choice-btn:active { transform: scale(0.98); }

.time-row { display: flex; gap: 12px; margin-top: 8px; }
.time-field { flex: 1; text-align: left; }
.time-field label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.time-field input {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ===== App Shell ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  padding-top: calc(14px + var(--safe-top));
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
}
.topbar-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.logo-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 0 0 4px rgba(15,143,209,0.15);
}
.icon-sun, .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: block; }

.screens { flex: 1; overflow-y: auto; padding: 4px 20px 110px; }
.screen { display: none; }
.screen.active { display: block; animation: screenIn 0.32s cubic-bezier(.22,1,.36,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Greeting ===== */
.greeting { text-align: center; margin: 10px 0 6px; }
.greeting-text { font-size: 19px; font-weight: 800; letter-spacing: -0.2px; }
.greeting-date {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-top: 6px;
  text-transform: capitalize;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px 12px;
}
[data-theme="dark"] .greeting-date { color: var(--primary-light); }

/* ===== Home background water (doluluk oranina gore yukselen arka plan) ===== */
.home-content {
  position: relative;
  z-index: 1;
}
.home-water-bg {
  position: fixed;
  left: 0; right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.home-water-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 4%;
  background: linear-gradient(180deg, #bdf1ff 0%, var(--primary-light) 16%, var(--primary) 52%, var(--primary-dark) 86%, #06304a 100%);
  opacity: 0.9;
  transition: height 0.7s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -1px 16px rgba(255,255,255,0.3) inset;
}
.home-water-bg.goal-met .home-water-fill {
  background: linear-gradient(180deg, #fff8d6 0%, var(--accent) 16%, var(--primary) 55%, var(--primary-dark) 88%, #06304a 100%);
}
.water-shine {
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.22) 45%, rgba(255,255,255,0.05) 60%, transparent 100%);
  animation: waterShineSweep 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes waterShineSweep {
  0%, 100% { left: -60%; }
  50% { left: 115%; }
}
.water-bubbles { position: absolute; inset: 0; overflow: hidden; }
.water-bubble {
  position: absolute;
  bottom: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  animation: bubbleRise linear infinite;
}
.water-bubble:nth-child(1) { left: 12%; width: 4px; height: 4px; animation-duration: 5.2s; animation-delay: 0s; }
.water-bubble:nth-child(2) { left: 28%; width: 6px; height: 6px; animation-duration: 6.8s; animation-delay: 1.1s; }
.water-bubble:nth-child(3) { left: 47%; width: 3px; height: 3px; animation-duration: 4.6s; animation-delay: 2.3s; }
.water-bubble:nth-child(4) { left: 64%; width: 5px; height: 5px; animation-duration: 6.1s; animation-delay: 0.6s; }
.water-bubble:nth-child(5) { left: 80%; width: 4px; height: 4px; animation-duration: 5.6s; animation-delay: 3s; }
.water-bubble:nth-child(6) { left: 92%; width: 3px; height: 3px; animation-duration: 7.4s; animation-delay: 1.8s; }
@keyframes bubbleRise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  12% { opacity: 0.75; }
  92% { opacity: 0.35; }
  100% { transform: translateY(-100%) scale(1); opacity: 0; }
}
.hero-wave {
  position: absolute;
  left: 0; right: 0;
  background-repeat: repeat-x;
}
.hero-wave-1 {
  top: -11px;
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='22' viewBox='0 0 120 22'%3E%3Cpath d='M0 12 C15 19 45 19 60 12 C75 5 105 5 120 12 V22 H0 Z' fill='%237fd4f5' fill-opacity='0.7'/%3E%3C/svg%3E");
  background-size: 120px 22px;
  animation: waveScroll1 4.2s linear infinite;
}
.hero-wave-2 {
  top: -8px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='16' viewBox='0 0 170 16'%3E%3Cpath d='M0 9 C22 15 65 15 85 9 C105 3 148 3 170 9 V16 H0 Z' fill='white' fill-opacity='0.4'/%3E%3C/svg%3E");
  background-size: 170px 16px;
  animation: waveScroll2 6.4s linear infinite reverse;
}
@keyframes waveScroll1 { from { background-position-x: 0; } to { background-position-x: 120px; } }
@keyframes waveScroll2 { from { background-position-x: 0; } to { background-position-x: 170px; } }

/* ===== Hero tree (her bardakla sulanan agac) ===== */
.hero-tree {
  position: relative;
  margin: 6px auto 0;
  width: 150px; height: 210px;
  transform: scale(0.62);
  transform-origin: bottom center;
  transition: transform 0.7s cubic-bezier(.34,1.1,.64,1);
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.18));
}
.hero-tree-svg { width: 100%; height: 100%; display: block; }
.hero-tree-shadow {
  position: absolute;
  bottom: -6px; left: 50%;
  width: 70%; height: 16px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,0,0,0.22), transparent 75%);
  z-index: -1;
}
.tree-trunk { fill: #8a5a3a; stroke: rgba(0,0,0,0.2); stroke-width: 1.5; }
.tree-leaf { fill: #b9a27a; stroke: rgba(0,0,0,0.18); stroke-width: 2; transition: fill 0.6s ease; }
.hero-tree.stage-0 { transform: scale(0.62); }
.hero-tree.stage-1 { transform: scale(0.8); }
.hero-tree.stage-1 .tree-leaf { fill: #c7b46a; }
.hero-tree.stage-2 { transform: scale(1); }
.hero-tree.stage-2 .tree-leaf { fill: #8fc98a; }
.hero-tree.stage-3 { transform: scale(1.18); }
.hero-tree.stage-3 .tree-leaf { fill: #4fae5e; }
.hero-tree.stage-4 { transform: scale(1.36); }
.hero-tree.stage-4 .tree-leaf { fill: #2f9e4f; }
.hero-tree.stage-2 .hero-tree-svg,
.hero-tree.stage-3 .hero-tree-svg,
.hero-tree.stage-4 .hero-tree-svg {
  animation: treeSway 4.5s ease-in-out infinite;
}
@keyframes treeSway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.hero-tree.tree-flash .tree-leaf { animation: treeFlash 0.5s ease; }
@keyframes treeFlash { 0%, 100% { filter: brightness(1); } 40% { filter: brightness(1.4); } }
.tree-water-drop {
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  animation: treeDropFall 0.9s ease-in forwards;
  pointer-events: none;
}
@keyframes treeDropFall {
  0% { top: -6px; opacity: 1; }
  75% { opacity: 1; }
  100% { top: 62%; opacity: 0; }
}

.ring-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 18px 0 10px;
}
#ring-amount {
  font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -0.5px;
  transition: transform 0.2s ease;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 1px 3px rgba(255,255,255,0.95)) drop-shadow(0 2px 8px rgba(255,255,255,0.7));
}
[data-theme="dark"] #ring-amount {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6)) drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.ring-unit { font-size: 13px; color: var(--text-muted); font-weight: 700; margin-top: 2px; text-shadow: 0 1px 4px rgba(255,255,255,0.9); }
.ring-goal-text { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-top: 6px; text-shadow: 0 1px 4px rgba(255,255,255,0.9); }
[data-theme="dark"] .ring-unit, [data-theme="dark"] .ring-goal-text { text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.pulse-pop { animation: pulsePop 0.35s ease; }
@keyframes pulsePop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.next-reminder {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface);
  border-radius: 999px;
  padding: 15px 24px;
  margin: 0 auto 20px;
  width: fit-content;
  max-width: 100%;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.next-reminder svg { width: 19px; height: 19px; fill: var(--primary); flex-shrink: 0; }

.home-stats-row {
  display: flex;
  gap: 10px;
  margin: 0 -20px 18px;
  padding: 2px 20px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.home-stats-row::-webkit-scrollbar { display: none; }
.home-stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 14px 8px 12px;
  text-align: center;
  flex: 0 0 100px;
  scroll-snap-align: start;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.home-stat-chip:active { transform: scale(0.95); }
.home-stat-chip-icon {
  width: 32px; height: 32px;
  margin: 0 auto 6px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.home-stat-chip-icon.icon-blue   { background: linear-gradient(135deg, rgba(15,143,209,0.22), rgba(15,143,209,0.06)); }
.home-stat-chip-icon.icon-orange { background: linear-gradient(135deg, rgba(255,159,67,0.26), rgba(255,159,67,0.07)); }
.home-stat-chip-icon.icon-green  { background: linear-gradient(135deg, rgba(24,194,156,0.26), rgba(24,194,156,0.07)); }
.home-stat-chip-icon.icon-cyan   { background: linear-gradient(135deg, rgba(95,196,238,0.28), rgba(95,196,238,0.08)); }
.home-stat-chip-icon.icon-purple { background: linear-gradient(135deg, rgba(155,107,238,0.26), rgba(155,107,238,0.07)); }
.home-stat-value { font-size: 15px; font-weight: 800; color: var(--primary-dark); }
[data-theme="dark"] .home-stat-value { color: var(--primary-light); }
.home-stat-label { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-top: 3px; line-height: 1.25; }

.daily-challenge-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(155,107,238,0.12), rgba(155,107,238,0.03));
  border: 1px solid rgba(155,107,238,0.24);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 14px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.daily-challenge-icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: linear-gradient(135deg, rgba(155,107,238,0.24), rgba(155,107,238,0.08));
}
.daily-challenge-body { flex: 1; min-width: 0; }
.daily-challenge-label { font-size: 10.5px; font-weight: 700; color: #9b6bee; text-transform: uppercase; letter-spacing: 0.4px; }
[data-theme="dark"] .daily-challenge-label { color: #c3a3f5; }
.daily-challenge-card p { font-size: 12.5px; line-height: 1.4; color: var(--text); margin: 3px 0 0; font-weight: 600; }
.daily-challenge-check {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.5;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.34,1.56,.64,1);
}
.daily-challenge-card.done {
  background: linear-gradient(135deg, rgba(24,194,156,0.14), rgba(24,194,156,0.03));
  border-color: rgba(24,194,156,0.26);
}
.daily-challenge-card.done .daily-challenge-icon { background: linear-gradient(135deg, rgba(24,194,156,0.26), rgba(24,194,156,0.08)); }
.daily-challenge-card.done .daily-challenge-check { opacity: 1; transform: scale(1); }

.tip-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: linear-gradient(135deg, rgba(15,143,209,0.1), rgba(15,143,209,0.03));
  border: 1px solid rgba(15,143,209,0.18);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 18px;
}
.tip-card svg { width: 18px; height: 18px; fill: var(--primary); flex-shrink: 0; margin-top: 1px; }
.tip-card p { font-size: 12.5px; line-height: 1.45; color: var(--text); margin: 0; }

.tips-list { display: flex; flex-direction: column; gap: 12px; }
.tip-article {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.tip-article-icon {
  font-size: 24px;
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(95,196,238,0.20), rgba(15,143,209,0.10));
  border-radius: 50%;
}
.tip-article-body h4 { font-size: 14.5px; font-weight: 700; margin: 4px 0 5px; }
.tip-article-body p { font-size: 12.5px; line-height: 1.5; color: var(--text-muted); margin: 0; }

/* ===== Quick Add ===== */
.quick-add {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.qa-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.qa-btn:active { transform: scale(0.94); border-color: var(--primary); }
.qa-icon { width: 24px; height: 24px; color: var(--primary); }
.qa-custom .qa-icon { color: var(--text-muted); }
.qa-custom { background: var(--surface-2); }

/* ===== Confetti ===== */
.confetti-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  font-size: 20px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.2; }
}

/* ===== Today Log ===== */
.today-log-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.today-log-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.log-count {
  background: var(--ring-bg);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
}
[data-theme="dark"] .log-count { color: var(--primary-light); }

.today-log-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  max-height: 304px;
  overflow-y: auto;
}
.today-log-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 6px 10px;
  font-size: 13.5px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: logIn 0.25s ease;
}
@keyframes logIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

.log-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(95,196,238,0.22), rgba(15,143,209,0.12));
  display: flex; align-items: center; justify-content: center;
}
.log-icon svg { width: 15px; height: 15px; color: var(--primary); }
.log-main { display: flex; flex-direction: column; align-items: center; }
.log-amount { display: block; }
.log-time { color: var(--text-muted); font-weight: 500; font-size: 11px; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-weight: 500 !important;
  justify-content: center !important;
  padding: 28px 16px !important;
  flex-direction: column;
  gap: 6px;
  background: transparent !important;
  border: none !important;
}
.empty-state .empty-icon { font-size: 26px; }

/* ===== Stats ===== */
.stats-header { display: flex; gap: 10px; margin: 8px 0 24px; }
.streak-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.streak-num { font-size: 22px; font-weight: 800; color: var(--primary-dark); margin-top: 6px; }
[data-theme="dark"] .streak-num { color: var(--primary-light); }
.streak-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
.streak-card .home-stat-chip-icon { width: 30px; height: 30px; font-size: 14px; margin: 0 auto; }

.insight-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: linear-gradient(135deg, rgba(24,194,156,0.12), rgba(24,194,156,0.03));
  border: 1px solid rgba(24,194,156,0.22);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 22px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.insight-card.trend-down {
  background: linear-gradient(135deg, rgba(255,159,67,0.14), rgba(255,159,67,0.03));
  border-color: rgba(255,159,67,0.26);
}
.insight-card-emoji { font-size: 18px; line-height: 1.4; flex-shrink: 0; }
.insight-card p { font-size: 12.5px; line-height: 1.45; color: var(--text); margin: 0; font-weight: 600; }

.section-title { font-size: 15px; font-weight: 700; margin: 20px 0 12px; }

.week-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 12px 12px;
  box-shadow: var(--shadow-sm);
}
.week-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
  position: relative;
}
.week-bar {
  width: 70%;
  border-radius: 6px 6px 3px 3px;
  background: var(--ring-bg);
  position: relative;
  min-height: 4px;
  transition: height 0.4s ease;
}
.week-bar.met { background: linear-gradient(180deg, var(--primary-light), var(--primary)); }
.week-bar-value {
  position: absolute;
  top: -16px; left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.week-bar-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.badge-item {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 6px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  opacity: 0.35;
  filter: grayscale(1);
  overflow: hidden;
  transition: transform 0.15s ease;
}
.badge-item.earned { opacity: 1; filter: none; }
.badge-item.earned:active { transform: scale(0.95); }
.badge-item.earned::after {
  content: "";
  position: absolute;
  top: -50%; left: -150%;
  width: 60%; height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  animation: badgeShine 3.2s ease-in-out infinite;
}
@keyframes badgeShine {
  0% { left: -150%; }
  35% { left: 150%; }
  100% { left: 150%; }
}
.badge-icon { font-size: 26px; }
.badge-name { font-size: 10.5px; font-weight: 700; margin-top: 6px; line-height: 1.3; }
.badge-lock {
  position: absolute; top: 6px; right: 6px;
  width: 16px; height: 16px;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
}
.badge-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--ring-bg);
  border-radius: 999px;
  margin-top: 7px;
  overflow: hidden;
}
.badge-progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.4s ease; }

.badges-section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 12px; }
.badges-progress-label { font-size: 12px; font-weight: 700; color: var(--primary); }
.badge-category-block { margin-bottom: 16px; }
.badge-category-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.4px; }
.badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* ===== Settings ===== */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 16px;
  margin-bottom: 14px;
}
.settings-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.settings-card-head svg {
  width: 18px; height: 18px;
  fill: var(--primary); stroke: var(--primary);
  padding: 8px;
  background: rgba(15,143,209,0.12);
  border-radius: 10px;
  box-sizing: content-box;
  flex-shrink: 0;
}
.settings-card-head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.settings-sublabel {
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.settings-card-head + .settings-sublabel { margin-top: 14px; }
.settings-card .toggle-row:last-child { border-bottom: none; }
.settings-hint { font-size: 12px; color: var(--text-muted); line-height: 1.45; margin: 0 0 10px; }
.settings-card .btn { margin-bottom: 10px; }
.settings-card .btn:last-of-type { margin-bottom: 0; }
.settings-about { text-align: center; }
.settings-about .settings-card-head { justify-content: center; }
.settings-about .app-version { margin: 4px 0 2px; padding: 0; }
.settings-credit { font-size: 11.5px; color: var(--text-muted); opacity: 0.8; margin: 0; }

.setting-row { display: flex; align-items: center; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 4px 18px; box-shadow: var(--shadow-sm); }
.setting-input { flex: 1; border: none; outline: none; background: transparent; font-size: 18px; font-weight: 700; padding: 14px 0; color: var(--text); }
.setting-select {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.glass-editor {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.glass-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.glass-row:last-child { border-bottom: none; }
.glass-row-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(95,196,238,0.20), rgba(15,143,209,0.10));
  display: flex; align-items: center; justify-content: center;
}
.glass-row-icon svg { width: 16px; height: 16px; color: var(--primary); }
.glass-row-label { flex: 1; font-weight: 600; font-size: 14px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px;
  font-size: 14.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--ring-bg);
  border-radius: 999px;
  transition: 0.25s;
  cursor: pointer;
}
.slider::before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.app-version { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 18px; padding-bottom: 8px; }

/* ===== Profile ===== */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 18px;
  text-align: center;
  margin-bottom: 18px;
}
.profile-avatar {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.profile-name-row { display: flex; gap: 8px; align-items: center; }
.profile-name-input {
  flex: 1;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  outline: none;
  text-align: center;
}
.profile-save-btn { padding: 10px 16px; font-size: 13px; flex-shrink: 0; }
.profile-email { font-size: 12.5px; color: var(--text-muted); margin: 12px 0 2px; font-weight: 600; }
.profile-joined { font-size: 11.5px; color: var(--text-muted); margin: 0; opacity: 0.85; }

/* ===== Community ===== */
.community-list { display: flex; flex-direction: column; gap: 8px; }
.community-status {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin: 4px 0 0;
}
.community-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
}
.community-row.you {
  background: linear-gradient(135deg, rgba(15,143,209,0.12), rgba(15,143,209,0.03));
  border: 1.5px solid rgba(15,143,209,0.3);
}
.community-rank { font-size: 15px; font-weight: 800; width: 26px; flex-shrink: 0; text-align: center; color: var(--primary-dark); }
[data-theme="dark"] .community-rank { color: var(--primary-light); }
.community-name { flex: 1; font-size: 13.5px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-streak { font-size: 12.5px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -4px 24px rgba(15,111,168,0.10);
  padding: 10px 12px calc(10px + var(--safe-bottom));
  z-index: 10;
}
.nav-btn {
  position: relative;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px 5px;
  color: var(--text-muted);
  font-size: 9.8px;
  font-weight: 600;
  border-radius: 14px;
  transition: color 0.2s ease;
}
.nav-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15,143,209,0.14), rgba(15,143,209,0.05));
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(.34,1.56,.64,1);
  z-index: -1;
}
.nav-btn.active::before { opacity: 1; transform: scale(1); }
.nav-btn svg { width: 19px; height: 19px; fill: var(--text-muted); transition: fill 0.2s ease, transform 0.2s cubic-bezier(.34,1.56,.64,1); }
.nav-btn.active { color: var(--primary); }
.nav-btn.active svg { fill: var(--primary); transform: translateY(-1px); }
.nav-btn:active svg { transform: scale(0.88); }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(8, 20, 30, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow);
}
.modal-card h3 { font-size: 17px; margin-bottom: 16px; text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { padding: 13px; }

/* ===== Badge Toast ===== */
.badge-toast {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 16px; right: 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
  z-index: 200;
  animation: slidedown 0.35s ease;
}
.badge-toast-icon { font-size: 28px; }
.badge-toast-title { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-toast-name { font-size: 15px; font-weight: 700; }
@keyframes slidedown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Verify Toast (photo proof) ===== */
.verify-toast {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 16px; right: 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
  z-index: 220;
  animation: slidedown 0.35s ease;
  border-left: 4px solid var(--accent);
}
.verify-toast.reject { border-left-color: var(--danger); }
.verify-toast-icon { font-size: 24px; }
.verify-toast-title { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.verify-toast-text { font-size: 14px; font-weight: 700; }
.verify-toast.reject .verify-toast-text { color: var(--danger); }

/* ===== Lock screen ===== */
.lock-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(15,111,179,0.5), rgba(5,12,20,0.94) 75%);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 205;
  animation: camOverlayIn 0.25s ease;
}
.lock-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  text-align: center;
}
.lock-icon { font-size: 40px; margin-bottom: 6px; }
.lock-card h2 { font-size: 20px; font-weight: 800; margin: 4px 0 8px; }
.lock-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.45; margin: 0 0 16px; }
.lock-feedback { color: var(--danger) !important; font-weight: 700 !important; }
.lock-card .quick-add { margin-bottom: 16px; }
.lock-disable-btn { font-size: 12px; color: var(--text-muted); }

/* ===== Camera overlay ===== */
.camera-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 50% 38%, rgba(15,111,179,0.35), rgba(6,14,22,0.82) 70%);
  backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  z-index: 210;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  animation: camOverlayIn 0.25s ease;
}
@keyframes camOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.cam-scan-frame {
  position: relative;
  width: 168px; height: 168px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 12px 32px rgba(0,0,0,0.35);
  overflow: hidden;
}
.cam-corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 3px solid var(--accent, #4fd1ff);
  filter: drop-shadow(0 0 4px rgba(79,209,255,0.6));
}
.cam-corner-tl { top: 8px; left: 8px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.cam-corner-tr { top: 8px; right: 8px; border-left: none; border-bottom: none; border-radius: 0 8px 0 0; }
.cam-corner-bl { bottom: 8px; left: 8px; border-right: none; border-top: none; border-radius: 0 0 0 8px; }
.cam-corner-br { bottom: 8px; right: 8px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }

.cam-scan-line {
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, #4fd1ff), transparent);
  box-shadow: 0 0 10px 2px rgba(79,209,255,0.8);
  animation: camScanSweep 1.8s ease-in-out infinite;
}
@keyframes camScanSweep {
  0%, 100% { top: 14px; opacity: 0.9; }
  50% { top: 152px; opacity: 0.5; }
}

.camera-overlay-ring {
  position: relative;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.camera-overlay-icon {
  width: 26px; height: 26px;
  color: #fff;
  animation: float 2s ease-in-out infinite;
}
.camera-overlay-spinner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.22);
  border-top-color: var(--accent, #4fd1ff);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cam-result-icon {
  position: absolute;
  width: 52px; height: 52px;
  padding: 13px;
  box-sizing: border-box;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  transition: none;
}
.cam-result-icon.show {
  animation: camResultPop 0.45s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes camResultPop {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.cam-result-icon-ok { color: #fff; background: #3ddc84; box-shadow: 0 0 24px rgba(61,220,132,0.7); }
.cam-result-icon-fail { color: #fff; background: #ff5c5c; box-shadow: 0 0 24px rgba(255,92,92,0.7); }

.cam-scan-frame.cam-state-ok {
  box-shadow: 0 0 0 1px rgba(61,220,132,0.5) inset, 0 0 28px rgba(61,220,132,0.45);
}
.cam-scan-frame.cam-state-fail {
  animation: camShake 0.4s ease;
  box-shadow: 0 0 0 1px rgba(255,92,92,0.55) inset, 0 0 28px rgba(255,92,92,0.45);
}
@keyframes camShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.cam-secure-badge {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.2px;
}
.cam-secure-badge svg { width: 14px; height: 14px; fill: var(--accent, #4fd1ff); }

@media (min-width: 480px) {
  .screens, .onboarding-wrap { max-width: 420px; margin: 0 auto; }
  .bottom-nav { max-width: 420px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
}

/* ===== Tree FAB ===== */
.tree-fab {
  position: fixed;
  right: 14px;
  top: calc(var(--safe-top) + 66px);
  height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  border: none;
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #6fcf7a, #2f9e4f);
  box-shadow: 0 8px 18px rgba(47,158,79,0.4);
  color: #fff; font-weight: 700; font-size: 13.5px;
  z-index: 150;
  transition: transform 0.15s ease;
}
.tree-fab-icon { font-size: 17px; line-height: 1; }
.tree-fab:active { transform: scale(0.94); }

.tree-panel {
  position: fixed;
  right: 14px;
  top: calc(var(--safe-top) + 66px);
  width: min(300px, calc(100vw - 28px));
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 160;
  animation: chatPanelIn 0.25s cubic-bezier(.22,1,.36,1);
}
.tree-panel-body {
  padding: 8px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.tree-panel-text {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Chat Assistant ===== */
.chat-fab {
  position: fixed;
  right: 18px;
  bottom: calc(86px + var(--safe-bottom));
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  box-shadow: 0 8px 20px rgba(15,143,209,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 150;
  transition: transform 0.15s ease;
}
.chat-fab svg { width: 28px; height: 28px; fill: #fff; position: relative; z-index: 1; }
.chat-fab:active { transform: scale(0.92); }
.chat-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: chatFabPing 2.6s ease-out infinite;
  z-index: 0;
}
@keyframes chatFabPing {
  0% { transform: scale(1); opacity: 0.55; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

.chat-panel {
  position: fixed;
  right: 14px; left: 14px;
  bottom: calc(86px + var(--safe-bottom));
  max-width: 380px;
  margin: 0 auto;
  height: min(520px, 70vh);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 160;
  animation: chatPanelIn 0.25s cubic-bezier(.22,1,.36,1);
}
@keyframes chatPanelIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.chat-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.chat-panel-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.chat-panel-robot { width: 22px; height: 22px; fill: var(--primary); flex-shrink: 0; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  animation: fadein 0.2s ease;
}
.chat-msg-bot {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-typing { display: flex; gap: 4px; padding: 13px; }
.chat-msg-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.1s infinite ease-in-out;
}
.chat-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.chat-input-row input {
  flex: 1;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.chat-send-btn {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
}
.chat-send-btn svg { width: 17px; height: 17px; fill: #fff; }
.chat-send-btn:active { transform: scale(0.9); }

/* ===== Web launch splash (Unity-style intro) ===== */
.web-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1196d6 0%, #0a6fa8 45%, #063652 100%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.web-splash.web-splash-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.web-splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.web-splash-logo {
  width: 116px; height: 116px;
  border-radius: 28px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.12) inset;
  opacity: 0;
  transform: scale(0.6);
  animation: webSplashLogoIn 0.7s cubic-bezier(.2,.9,.25,1.1) 0.1s forwards;
}
.web-splash-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(8px);
  animation: webSplashTextIn 0.6s ease 0.45s forwards;
}
.web-splash-credit {
  position: absolute;
  bottom: calc(36px + var(--safe-bottom));
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: rgba(255,255,255,0.65);
  opacity: 0;
  animation: webSplashTextIn 0.6s ease 0.8s forwards;
}
@keyframes webSplashLogoIn {
  0% { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  60% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes webSplashTextIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
