:root {
  --green-900: #173c2a;
  --green-800: #245f34;
  --green-700: #347d40;
  --green-600: #43964b;
  --green-500: #63ad4c;
  --lime: #91cb4e;
  --mint: #dff1d3;
  --cream: #fff7e5;
  --paper: #ffffff;
  --surface: #f5f8f2;
  --ink: #1d3024;
  --muted: #728078;
  --line: #e2e9df;
  --danger: #d55252;
  --purple: #7668b3;
  --shadow: 0 12px 35px rgba(34, 78, 47, 0.1);
  --shadow-soft: 0 5px 18px rgba(36, 83, 50, 0.08);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #dce9dd;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 13% 8%, rgba(143, 202, 85, .28), transparent 28%),
    radial-gradient(circle at 90% 85%, rgba(69, 145, 84, .22), transparent 30%),
    linear-gradient(145deg, #eff6eb 0%, #d9e9dc 100%);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }

.ambient { position: fixed; border-radius: 50%; filter: blur(4px); pointer-events: none; }
.ambient-one { width: 320px; height: 320px; left: -100px; top: 12vh; background: rgba(146, 202, 80, .15); }
.ambient-two { width: 380px; height: 380px; right: -130px; bottom: 4vh; background: rgba(49, 125, 65, .13); }

.phone-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  overflow-x: hidden;
  box-shadow: 0 0 70px rgba(31, 66, 43, .18);
}

#app { min-height: 100vh; }
.screen { min-height: 100vh; }
.app-screen { padding-bottom: calc(102px + env(safe-area-inset-bottom)); }
.content { padding: 18px 18px 4px; }
.safe-top { padding-top: max(18px, env(safe-area-inset-top)); }

.splash {
  display: grid;
  place-items: center;
  background: linear-gradient(158deg, #f7fbf3 10%, #e0f2d2 100%);
  text-align: center;
}
.splash-inner { width: 75%; animation: fade-up .7s ease both; }
.splash-logo { width: 185px; }
.splash-kalo { width: 170px; margin: -5px auto -8px; filter: drop-shadow(0 18px 18px rgba(45, 98, 48, .18)); animation: kalo-breathe 3s ease-in-out infinite; }
.splash p { color: var(--green-800); font-weight: 700; }
.loader-dots { display: flex; gap: 7px; justify-content: center; margin-top: 26px; }
.loader-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); animation: pulse 1.1s infinite alternate; }
.loader-dots i:nth-child(2) { animation-delay: .2s; }
.loader-dots i:nth-child(3) { animation-delay: .4s; }

.auth-screen {
  background:
    radial-gradient(circle at 85% 5%, rgba(144, 204, 77, .26), transparent 30%),
    linear-gradient(180deg, #fbfdf9 0%, #eff7e9 100%);
  display: flex;
  flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) 24px 28px;
}
.auth-brand { text-align: center; }
.auth-brand .logo { width: 150px; }
.auth-character-wrap { height: 220px; display: grid; place-items: center; position: relative; }
.auth-character { width: 145px; z-index: 2; filter: drop-shadow(0 16px 18px rgba(55, 100, 50, .18)); animation: kalo-breathe 3.5s ease-in-out infinite; }
.character-halo { position: absolute; width: 210px; height: 105px; border-radius: 50%; background: radial-gradient(ellipse, rgba(143, 202, 83, .3), transparent 70%); bottom: 15px; }
.auth-card { background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.9); border-radius: 30px; padding: 24px; box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.auth-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.7px; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; background: #edf3e9; padding: 4px; border-radius: 14px; margin-bottom: 20px; }
.auth-switch button { border: 0; border-radius: 11px; padding: 10px; color: var(--muted); background: transparent; font-weight: 800; cursor: pointer; }
.auth-switch button.active { color: var(--green-800); background: white; box-shadow: 0 3px 12px rgba(41,86,49,.1); }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 800; color: var(--green-900); margin: 0 0 7px 3px; }
.field input, .field select, .field textarea,
.input {
  width: 100%;
  border: 1.5px solid #dfe8dc;
  background: #f9fbf7;
  border-radius: 15px;
  padding: 14px 15px;
  color: var(--ink);
  outline: 0;
  transition: .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--green-500); background: white; box-shadow: 0 0 0 4px rgba(88, 165, 78, .12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.icon-input-action { position: absolute; right: 8px; top: 7px; border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.check-row { display: flex; gap: 9px; align-items: flex-start; margin: 14px 2px 18px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.check-row input { accent-color: var(--green-600); margin-top: 2px; }
.link-button { border: 0; background: none; color: var(--green-700); font-weight: 800; padding: 0; cursor: pointer; }

.btn { border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 850; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 9px; transition: transform .15s, filter .15s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { width: 100%; color: white; background: linear-gradient(135deg, var(--green-700), var(--green-500)); box-shadow: 0 9px 20px rgba(55, 137, 69, .24); }
.btn-secondary { color: var(--green-800); background: var(--mint); }
.btn-ghost { color: var(--green-800); background: transparent; border: 1px solid var(--line); }
.btn-danger { color: white; background: var(--danger); }
.btn-small { padding: 9px 12px; border-radius: 12px; font-size: 12px; }
.btn-inline { width: auto; }

.code-screen { justify-content: center; }
.code-card { text-align: center; }
.mail-orb { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 23px; color: var(--green-800); background: linear-gradient(145deg, var(--mint), #f7fbea); box-shadow: var(--shadow-soft); }
.mail-orb svg { width: 34px; }
.code-input { text-align: center; font-size: 27px; letter-spacing: 12px; padding-left: 26px !important; font-weight: 900; }
.resend-note { font-size: 13px; color: var(--muted); margin-top: 17px; }
.back-link { position: absolute; top: max(20px, env(safe-area-inset-top)); left: 20px; width: 42px; height: 42px; border-radius: 14px; background: white; border: 1px solid var(--line); display: grid; place-items: center; color: var(--green-900); cursor: pointer; }

.onboarding { background: linear-gradient(180deg, #f8fbf5, #eef7e8); padding: max(24px, env(safe-area-inset-top)) 22px 34px; }
.progress-dots { display: flex; gap: 7px; margin: 12px 0 30px; }
.progress-dots i { height: 6px; flex: 1; border-radius: 9px; background: #dce7d8; }
.progress-dots i.active { background: linear-gradient(90deg, var(--green-700), var(--lime)); }
.onboard-head { display: flex; align-items: flex-end; min-height: 155px; position: relative; margin-bottom: 15px; }
.onboard-head img { width: 108px; filter: drop-shadow(0 10px 12px rgba(48,94,47,.15)); }
.onboard-bubble { flex: 1; background: white; padding: 15px 16px; border-radius: 19px 19px 19px 5px; box-shadow: var(--shadow-soft); margin: 0 0 18px 5px; font-weight: 750; line-height: 1.4; }
.onboard-card { background: white; border-radius: 26px; padding: 22px; box-shadow: var(--shadow-soft); }
.onboard-card h1 { font-size: 25px; margin: 0 0 7px; }
.onboard-card > p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.choice-grid { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 13px; text-align: left; border: 1.5px solid var(--line); background: #fbfcfa; border-radius: 17px; padding: 13px; cursor: pointer; }
.choice.selected { border-color: var(--green-500); background: #f0f8ea; box-shadow: 0 0 0 3px rgba(81,158,75,.1); }
.choice-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--mint); font-size: 20px; }
.choice strong { display: block; font-size: 14px; }
.choice small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.onboard-actions { display: flex; gap: 10px; margin-top: 20px; }
.onboard-actions .btn-primary { flex: 1; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: max(18px, env(safe-area-inset-top)) 19px 7px; }
.topbar-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar-logo { width: 82px; }
.avatar { width: 42px; height: 42px; border-radius: 15px; display: grid; place-items: center; color: white; font-weight: 900; background: linear-gradient(145deg, var(--green-700), var(--lime)); box-shadow: 0 6px 14px rgba(44,120,58,.2); overflow: hidden; }
.avatar.small { width: 34px; height: 34px; border-radius: 12px; font-size: 12px; }
.avatar.large { width: 74px; height: 74px; border-radius: 24px; font-size: 25px; }
.greeting small { display: block; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.greeting strong { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--green-900); display: grid; place-items: center; cursor: pointer; position: relative; }
.icon-btn svg { width: 21px; }
.badge-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #f07e62; top: 7px; right: 7px; border: 2px solid white; }

.hero-card { position: relative; min-height: 335px; border-radius: 30px; overflow: hidden; background: linear-gradient(145deg, #eaf6dc 0%, #cceab4 58%, #b7d99c 100%); box-shadow: var(--shadow); padding: 18px; }
.hero-card::before { content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%; background: rgba(255,255,255,.35); right: -58px; top: -68px; }
.hero-card::after { content: ""; position: absolute; height: 45px; left: 25px; right: 25px; bottom: 36px; border-radius: 50%; background: rgba(42,89,41,.1); filter: blur(7px); }
.hero-meta { position: relative; z-index: 4; display: flex; justify-content: space-between; align-items: center; }
.level-pill, .streak-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.7); border-radius: 14px; color: var(--green-900); font-size: 12px; font-weight: 850; backdrop-filter: blur(9px); }
.streak-pill { background: rgba(255,247,226,.9); color: #a55d2c; }
.hero-character { position: absolute; width: 225px; max-height: 320px; object-fit: contain; left: 50%; bottom: -8px; transform: translateX(-50%); z-index: 3; filter: drop-shadow(0 15px 14px rgba(58,102,46,.2)); animation: kalo-home 4s ease-in-out infinite; transform-origin: center bottom; }
.spark { position: absolute; z-index: 2; color: rgba(255,255,255,.85); font-size: 23px; animation: sparkle 2.3s ease-in-out infinite; }
.spark.s1 { left: 35px; top: 110px; }.spark.s2 { right: 38px; top: 125px; animation-delay: .8s; }.spark.s3 { right: 83px; top: 70px; font-size: 14px; animation-delay: 1.3s; }
.speech { position: absolute; z-index: 5; right: 16px; bottom: 80px; width: 126px; background: rgba(255,255,255,.94); border-radius: 17px 17px 5px 17px; padding: 11px; box-shadow: var(--shadow-soft); font-size: 11px; font-weight: 750; line-height: 1.35; animation: float 3.2s ease-in-out infinite; }
.xp-strip { position: absolute; z-index: 6; left: 18px; right: 18px; bottom: 14px; background: rgba(255,255,255,.88); border-radius: 14px; padding: 9px 11px; backdrop-filter: blur(8px); }
.xp-label { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; color: var(--green-800); margin-bottom: 5px; }
.progress { height: 7px; background: #deead8; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-600), var(--lime)); }

.status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.status-card { background: white; border: 1px solid var(--line); border-radius: 17px; padding: 11px 10px; box-shadow: var(--shadow-soft); }
.status-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 750; margin-bottom: 7px; }
.status-label i { width: 7px; height: 7px; border-radius: 50%; }
.status-card strong { font-size: 15px; }
.status-card .progress { height: 5px; margin-top: 6px; }

.section-head { display: flex; align-items: end; justify-content: space-between; margin: 24px 1px 11px; }
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -.35px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-link { color: var(--green-700); border: 0; background: none; font-size: 12px; font-weight: 800; cursor: pointer; }

.nutrition-card { background: white; border-radius: 24px; padding: 18px; box-shadow: var(--shadow-soft); border: 1px solid rgba(225,233,222,.8); }
.calorie-overview { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 16px; }
.calorie-ring { --value: 0deg; width: 105px; height: 105px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green-600) var(--value), #e8eee4 0); position: relative; }
.calorie-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: white; }
.ring-center { z-index: 1; text-align: center; }
.ring-center strong { display: block; font-size: 22px; line-height: 1; }
.ring-center small { color: var(--muted); font-size: 9px; }
.calorie-copy h3 { margin: 0 0 4px; font-size: 16px; }
.calorie-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.remaining { color: var(--green-700); font-weight: 850; }
.macro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.macro-item strong, .macro-item small { display: block; }
.macro-item strong { font-size: 13px; margin-bottom: 3px; }
.macro-item small { font-size: 9px; color: var(--muted); }
.macro-item .progress { margin-top: 7px; height: 5px; }
.macro-item.protein i { background: #8b7abe; }.macro-item.carbs i { background: #dda647; }.macro-item.fat i { background: #e47e68; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-action { border: 0; background: white; border-radius: 18px; padding: 13px 5px 10px; box-shadow: var(--shadow-soft); color: var(--ink); cursor: pointer; }
.quick-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 7px; font-size: 19px; background: #eef7e8; }
.quick-action:nth-child(2) .quick-icon { background: #eeeaf8; }.quick-action:nth-child(3) .quick-icon { background: #fff1df; }.quick-action:nth-child(4) .quick-icon { background: #e6f4f7; }
.quick-action span { font-size: 10px; font-weight: 800; }

.insight-card, .league-card { position: relative; overflow: hidden; border-radius: 22px; padding: 17px; background: linear-gradient(130deg, var(--green-800), #498d4b); color: white; box-shadow: var(--shadow); }
.insight-card { display: flex; gap: 13px; align-items: center; }
.insight-icon { width: 45px; height: 45px; flex: 0 0 auto; border-radius: 15px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 21px; }
.insight-card strong { display: block; font-size: 13px; margin-bottom: 4px; }
.insight-card p { margin: 0; font-size: 11px; line-height: 1.45; opacity: .88; }
.league-card { background: linear-gradient(130deg, #6d633d, #b29a4d); cursor: pointer; }
.league-card::after { content: "🏆"; position: absolute; font-size: 76px; opacity: .13; right: -5px; top: -5px; transform: rotate(13deg); }
.league-top { display: flex; justify-content: space-between; position: relative; z-index: 1; }
.league-top small { opacity: .8; display: block; font-size: 10px; }.league-top strong { display: block; font-size: 17px; margin-top: 3px; }
.league-rank { text-align: right; }.league-rank b { font-size: 21px; display: block; }.league-rank span { font-size: 9px; opacity: .85; }

.page-header { padding: max(22px, env(safe-area-inset-top)) 18px 10px; display: flex; align-items: center; justify-content: space-between; }
.page-header h1 { margin: 0; font-size: 27px; letter-spacing: -.7px; }
.page-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.date-nav { display: flex; align-items: center; justify-content: space-between; background: white; border-radius: 18px; padding: 10px 13px; box-shadow: var(--shadow-soft); margin-bottom: 13px; }
.date-nav button { border: 0; background: #f2f7ef; width: 36px; height: 36px; border-radius: 12px; color: var(--green-800); cursor: pointer; }
.date-copy { text-align: center; }.date-copy strong { display: block; font-size: 13px; }.date-copy small { color: var(--muted); font-size: 10px; }
.day-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: white; border-radius: 19px; padding: 14px 7px; box-shadow: var(--shadow-soft); margin-bottom: 20px; }
.summary-metric { text-align: center; border-right: 1px solid var(--line); }.summary-metric:last-child { border-right: 0; }.summary-metric strong { display: block; font-size: 14px; }.summary-metric small { display: block; color: var(--muted); font-size: 8px; margin-top: 3px; }
.meal-group { margin-bottom: 18px; }
.meal-group-head { display: flex; justify-content: space-between; align-items: center; margin: 0 3px 8px; }
.meal-group-head strong { font-size: 14px; }.meal-group-head span { color: var(--muted); font-size: 10px; }
.meal-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 18px; padding: 10px; margin-bottom: 8px; box-shadow: 0 3px 10px rgba(38,73,46,.04); }
.meal-thumb { width: 52px; height: 52px; border-radius: 15px; object-fit: cover; display: grid; place-items: center; font-size: 24px; background: linear-gradient(145deg, #f3efda, #dcecc7); overflow: hidden; }
.meal-info strong { font-size: 13px; display: block; margin-bottom: 4px; }.meal-info span { color: var(--muted); font-size: 10px; }
.meal-kcal { text-align: right; }.meal-kcal strong { font-size: 13px; display: block; }.meal-kcal small { color: var(--muted); font-size: 9px; }
.delete-meal { border: 0; background: transparent; color: #bd7979; font-size: 17px; cursor: pointer; padding: 5px; }
.empty-meal { border: 1.5px dashed #d8e4d3; border-radius: 18px; padding: 15px; color: var(--muted); font-size: 11px; text-align: center; background: rgba(255,255,255,.45); }
.fab-add { position: fixed; bottom: calc(100px + env(safe-area-inset-bottom)); right: max(18px, calc((100vw - 480px)/2 + 18px)); z-index: 25; width: 54px; height: 54px; border: 0; border-radius: 18px; color: white; background: linear-gradient(145deg, var(--green-700), var(--green-500)); box-shadow: 0 10px 22px rgba(50,124,61,.28); font-size: 27px; cursor: pointer; }

.scan-screen { background: #183324; color: white; min-height: 100vh; padding: max(20px, env(safe-area-inset-top)) 18px 120px; }
.scan-head { display: flex; align-items: center; justify-content: space-between; }.scan-head h1 { font-size: 22px; margin: 0; }.scan-head button { color: white; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.12); }
.camera-box { margin-top: 25px; aspect-ratio: 3 / 4; border-radius: 32px; background: linear-gradient(145deg, #2d5037, #0f2117); position: relative; overflow: hidden; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.1); }
.camera-box::before, .camera-box::after { content: ""; position: absolute; inset: 19px; border: 2px solid transparent; border-top-color: rgba(184,229,137,.85); border-left-color: rgba(184,229,137,.85); border-radius: 24px; width: 42px; height: 42px; }
.camera-box::after { left: auto; top: auto; transform: rotate(180deg); }
.camera-content { text-align: center; padding: 30px; z-index: 2; }.camera-content .camera-orb { width: 84px; height: 84px; margin: 0 auto 19px; border-radius: 28px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #c8e8ad; }.camera-orb svg { width: 40px; }.camera-content h2 { margin: 0 0 8px; font-size: 19px; }.camera-content p { color: rgba(255,255,255,.65); margin: 0; font-size: 12px; line-height: 1.5; }
.camera-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 17px; }.scan-actions .btn { background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.12); }.scan-actions .btn-primary { background: linear-gradient(135deg, #70b94e, #a0d455); }
.analysis-loader { text-align: center; }.analysis-loader img { width: 125px; filter: drop-shadow(0 12px 18px rgba(0,0,0,.2)); animation: kalo-breathe 1.3s ease-in-out infinite; }.analysis-loader h2 { margin: 8px 0; }.analysis-loader p { color: rgba(255,255,255,.65); font-size: 12px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 18px 11px; }.tabs::-webkit-scrollbar { display: none; }.tab { flex: 0 0 auto; border: 0; background: #e9f0e6; color: var(--muted); border-radius: 13px; padding: 9px 14px; font-weight: 800; font-size: 11px; cursor: pointer; }.tab.active { background: var(--green-800); color: white; }
.recipe-card { background: white; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid var(--line); margin-bottom: 16px; }
.recipe-author { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 10px; }.author-info { display: flex; gap: 9px; align-items: center; }.author-info strong { display: block; font-size: 12px; }.author-info small { color: var(--muted); font-size: 9px; }
.recipe-image { height: 210px; background: linear-gradient(145deg, #dccb9b, #86a868); position: relative; overflow: hidden; cursor: pointer; }.recipe-image img { width: 100%; height: 100%; object-fit: cover; }.recipe-food-art { position: absolute; inset: 0; display: grid; place-items: center; font-size: 74px; text-shadow: 0 12px 25px rgba(29,58,32,.2); }.recipe-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 60%, rgba(19,39,25,.3)); }.recipe-tag { position: absolute; z-index: 2; left: 12px; bottom: 12px; background: rgba(255,255,255,.9); color: var(--green-900); padding: 7px 9px; border-radius: 10px; font-size: 9px; font-weight: 850; backdrop-filter: blur(8px); }
.recipe-body { padding: 14px; }.recipe-body h3 { margin: 0 0 8px; font-size: 17px; }.recipe-stats { display: flex; gap: 12px; color: var(--muted); font-size: 10px; }.recipe-stats b { color: var(--ink); }.recipe-actions { display: flex; align-items: center; gap: 5px; padding: 0 10px 12px; }.social-btn { border: 0; background: transparent; min-width: 44px; height: 38px; border-radius: 12px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 10px; font-weight: 750; cursor: pointer; }.social-btn svg { width: 19px; }.social-btn.active { color: #d65b61; background: #fff0f0; }.social-btn.save.active { color: var(--green-700); background: #edf7e8; }.recipe-actions .diary-btn { margin-left: auto; border: 0; background: var(--mint); color: var(--green-800); border-radius: 12px; padding: 9px 10px; font-size: 10px; font-weight: 850; cursor: pointer; }
.community-post { background: white; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid var(--line); margin-bottom: 16px; }
.post-media { position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 520px; overflow: hidden; background: #14231a; }
.post-media img, .post-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-media video { object-fit: contain; background: #0d1711; }
.media-kind { position: absolute; top: 11px; right: 11px; padding: 6px 9px; border-radius: 10px; color: white; background: rgba(20,35,26,.72); backdrop-filter: blur(8px); font-size: 9px; font-weight: 850; pointer-events: none; }
.post-copy { padding: 14px 14px 8px; }.post-copy:empty { display: none; }.post-copy h3 { margin: 0 0 6px; font-size: 16px; }.post-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-nutrition { display: flex; gap: 12px; margin-top: 11px; color: var(--muted); font-size: 10px; }.post-nutrition b { color: var(--ink); }
.post-actions { display: flex; align-items: center; padding: 2px 10px 11px; }
.post-delete { border: 0; background: transparent; color: #a66c6c; font-size: 9px; font-weight: 800; padding: 8px; cursor: pointer; }
.eyebrow { color: var(--green-700); font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.field > span small { color: var(--muted); font-size: 9px; font-weight: 650; }
.post-upload { display: grid; place-items: center; text-align: center; min-height: 150px; margin-bottom: 14px; padding: 20px; border: 1.5px dashed #b9d3ad; border-radius: 22px; background: linear-gradient(145deg, #f7fbf3, #edf6e8); color: var(--green-900); cursor: pointer; }
.post-upload input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }.post-upload-icon { font-size: 32px; margin-bottom: 7px; }.post-upload strong { font-size: 13px; }.post-upload small { max-width: 260px; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.community-preview { height: 230px; margin-bottom: 14px; overflow: hidden; border-radius: 22px; background: #14231a; }.community-preview img, .community-preview video { display: block; width: 100%; height: 100%; object-fit: contain; }

.profile-hero { background: linear-gradient(155deg, #ddecce, #f7faef); padding: max(28px, env(safe-area-inset-top)) 20px 24px; border-radius: 0 0 32px 32px; box-shadow: var(--shadow-soft); }.profile-top { display: flex; align-items: center; gap: 15px; }.profile-name { flex: 1; min-width: 0; }.profile-name h1 { margin: 0 0 4px; font-size: 22px; }.profile-name p { margin: 0; color: var(--green-700); font-size: 12px; font-weight: 750; }.profile-bio { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }.profile-counts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; background: rgba(255,255,255,.72); border-radius: 17px; padding: 12px; }.profile-count { text-align: center; border-right: 1px solid rgba(91,122,83,.16); }.profile-count:last-child { border-right: 0; }.profile-count strong { display: block; font-size: 15px; }.profile-count small { color: var(--muted); font-size: 9px; }
.pet-mini-card { background: linear-gradient(145deg, #274f34, #428648); color: white; border-radius: 23px; min-height: 145px; overflow: hidden; position: relative; padding: 16px; cursor: pointer; }.pet-mini-card img { position: absolute; width: 115px; right: 5px; bottom: -38px; filter: drop-shadow(0 10px 10px rgba(0,0,0,.15)); }.pet-mini-card small { opacity: .75; font-size: 9px; }.pet-mini-card h3 { margin: 4px 0 5px; font-size: 19px; }.pet-mini-card p { width: 60%; margin: 0; font-size: 10px; line-height: 1.45; opacity: .85; }
.menu-card { background: white; border-radius: 22px; padding: 5px 14px; box-shadow: var(--shadow-soft); }.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 57px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: var(--ink); cursor: pointer; }.menu-row:last-child { border-bottom: 0; }.menu-icon { width: 37px; height: 37px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; background: #eff6eb; color: var(--green-700); }.menu-icon svg { width: 18px; }.menu-row strong { flex: 1; font-size: 13px; }.menu-row small { color: var(--muted); font-size: 10px; }.menu-row > svg { width: 17px; color: #a8b2aa; }

.bottom-nav { position: fixed; z-index: 30; left: max(0px, calc((100vw - 480px)/2)); right: max(0px, calc((100vw - 480px)/2)); bottom: 0; max-width: 480px; margin: 0 auto; min-height: calc(78px + env(safe-area-inset-bottom)); padding: 8px 11px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: rgba(255,255,255,.94); border-top: 1px solid rgba(216,226,213,.9); backdrop-filter: blur(18px); box-shadow: 0 -8px 28px rgba(34,68,41,.08); }
.nav-btn { border: 0; background: transparent; color: #8b968e; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 55px; font-size: 9px; font-weight: 750; cursor: pointer; }.nav-btn svg { width: 22px; height: 22px; }.nav-btn.active { color: var(--green-700); }.scan-nav { position: relative; top: -20px; }.scan-nav .scan-circle { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 20px; color: white; background: linear-gradient(145deg, var(--green-700), var(--lime)); border: 5px solid var(--surface); box-shadow: 0 8px 18px rgba(55,137,66,.28); }.scan-nav svg { width: 26px; }.scan-nav span { margin-top: -1px; }

.modal-backdrop { position: fixed; z-index: 80; inset: 0; max-width: 480px; margin: 0 auto; background: rgba(13,31,20,.5); backdrop-filter: blur(5px); display: flex; align-items: flex-end; animation: fade-in .2s ease; }
.modal { width: 100%; max-height: 91vh; overflow-y: auto; background: var(--surface); border-radius: 30px 30px 0 0; padding: 13px 20px calc(26px + env(safe-area-inset-bottom)); animation: sheet-up .3s cubic-bezier(.22,.8,.3,1); }
.modal-handle { width: 42px; height: 5px; border-radius: 8px; background: #ccd6ca; margin: 0 auto 17px; }.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }.modal-head h2 { margin: 0; font-size: 21px; }.close-btn { border: 0; width: 37px; height: 37px; border-radius: 13px; background: #e9efe6; color: var(--green-900); cursor: pointer; }
.analysis-photo { height: 185px; border-radius: 23px; object-fit: cover; width: 100%; margin-bottom: 15px; }.analysis-notice { border-radius: 15px; padding: 11px; background: #fff7e4; color: #826422; font-size: 10px; line-height: 1.45; margin-bottom: 15px; }.macro-edit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }.macro-edit-grid .field input { padding: 12px 7px; text-align: center; }.macro-edit-grid .field > span { text-align: center; font-size: 9px; }
.recipe-detail-hero { height: 220px; border-radius: 24px; background: linear-gradient(145deg, #dfca99, #78a168); display: grid; place-items: center; font-size: 78px; margin-bottom: 17px; overflow: hidden; }.recipe-detail-hero img { width: 100%; height: 100%; object-fit: cover; }.ingredient-list { list-style: none; padding: 0; margin: 12px 0 20px; }.ingredient-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 3px; border-bottom: 1px solid var(--line); font-size: 12px; }.ingredient-list li span:last-child { color: var(--muted); }.steps-list { margin: 12px 0 20px; padding-left: 24px; }.steps-list li { padding: 0 0 13px 5px; font-size: 12px; line-height: 1.5; }.ranking-list { display: grid; gap: 8px; }.rank-row { display: grid; grid-template-columns: 32px 40px 1fr auto; align-items: center; gap: 8px; padding: 10px; border-radius: 15px; background: white; }.rank-row.me { background: #eaf6df; border: 1px solid #b9dda4; }.rank-number { text-align: center; font-weight: 900; color: var(--muted); }.rank-user strong { display: block; font-size: 12px; }.rank-user small { color: var(--muted); font-size: 9px; }.rank-points { font-size: 12px; font-weight: 900; color: var(--green-800); }
.achievement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }.achievement { background: white; border-radius: 18px; padding: 13px; border: 1px solid var(--line); opacity: .55; }.achievement.unlocked { opacity: 1; border-color: #c9dfb9; background: #fbfff8; }.achievement-icon { font-size: 26px; margin-bottom: 7px; }.achievement strong { display: block; font-size: 11px; margin-bottom: 3px; }.achievement small { display: block; color: var(--muted); font-size: 9px; line-height: 1.35; }

.toast-root { position: fixed; z-index: 120; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 448px); pointer-events: none; }.toast { color: white; background: rgba(27,60,38,.95); padding: 13px 15px; border-radius: 15px; box-shadow: 0 10px 30px rgba(18,45,27,.25); margin-bottom: 8px; font-size: 12px; font-weight: 700; animation: toast-in .25s ease both; backdrop-filter: blur(8px); }.toast.error { background: rgba(154,59,59,.96); }.toast.info { background: rgba(67,74,113,.96); }
.empty-state { text-align: center; padding: 45px 25px; color: var(--muted); }.empty-state span { display: block; font-size: 48px; margin-bottom: 12px; }.empty-state strong { display: block; color: var(--ink); margin-bottom: 6px; }.empty-state p { margin: 0; font-size: 12px; line-height: 1.5; }
.skeleton { border-radius: 15px; background: linear-gradient(90deg,#e6ece3 25%,#f5f8f3 37%,#e6ece3 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; }
.loading-page { padding: 22px 18px; }.loading-page .skeleton { height: 80px; margin-bottom: 12px; }.loading-page .skeleton.hero { height: 330px; }
.hidden { display: none !important; }

@keyframes kalo-breathe { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.012,.99); } }
@keyframes kalo-home { 0%,100% { transform: translateX(-50%) translateY(0) scale(1); } 50% { transform: translateX(-50%) translateY(-4px) scale(1.01,.995); } }
@keyframes pulse { from { transform: translateY(0); opacity: .4; } to { transform: translateY(-5px); opacity: 1; } }
@keyframes sparkle { 0%,100% { transform: scale(.7) rotate(0); opacity: .25; } 50% { transform: scale(1.15) rotate(20deg); opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(60px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (min-width: 700px) {
  body { padding: 24px 0; }
  .phone-shell { min-height: calc(100vh - 48px); border-radius: 34px; overflow: hidden; border: 7px solid rgba(255,255,255,.75); }
  .screen { min-height: calc(100vh - 62px); }
  .bottom-nav { bottom: 31px; border-radius: 0 0 27px 27px; }
  .fab-add { bottom: 124px; }
  .modal-backdrop { top: 31px; bottom: 31px; border-radius: 27px; overflow: hidden; }
}

@media (max-width: 360px) {
  .content { padding-left: 13px; padding-right: 13px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .hero-card { min-height: 315px; }
  .hero-character { width: 205px; }
  .speech { width: 112px; }
  .quick-action span { font-size: 9px; }
  .calorie-overview { grid-template-columns: 94px 1fr; gap: 11px; }
  .calorie-ring { width: 91px; height: 91px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
