* { -webkit-tap-highlight-color: transparent; }
body { font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
.app-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f8fafc; position: relative; box-shadow: 0 0 30px rgba(0,0,0,.06); }
.page { padding: 16px 16px 96px; }
.card { background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.06); margin-bottom: 14px; }
.card-title { font-weight: 700; color: #0f172a; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.input { width: 100%; border: 1px solid #e2e8f0; border-radius: 12px; padding: 11px 14px; font-size: 15px; outline: none; background: #fff; }
.input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.label { display: block; font-size: 13px; color: #64748b; margin: 10px 0 4px; }
.btn { border-radius: 12px; padding: 11px 16px; font-weight: 600; transition: .15s; }
.btn-primary { background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; width: 100%; }
.btn-primary:active { transform: scale(.98); }
.btn-ghost { background: #eef2ff; color: #4f46e5; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: #fff; border-top: 1px solid #e2e8f0; display: flex; z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; padding: 10px 0 8px; color: #94a3b8; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tabbar button i { font-size: 20px; }
.tabbar button.active { color: #6366f1; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-day { aspect-ratio: 1/1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; font-size: 14px; cursor: pointer; position: relative; }
.cal-day.other { color: #cbd5e1; }
.cal-day.today { color: #6366f1; font-weight: 800; }
.cal-day.selected { background: #6366f1; color: #fff; }
.cal-dots { display: flex; gap: 2px; height: 5px; margin-top: 2px; }
.cal-dots span { width: 5px; height: 5px; border-radius: 50%; }
.dot-s { background: #f59e0b; } .dot-w { background: #10b981; } .dot-z { background: #6366f1; } .dot-m { background: #ef4444; }
.cal-day.selected .cal-dots span { background: #fff; }
.seg { display: flex; background: #f1f5f9; border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 7px 2px; border-radius: 10px; font-size: 13px; color: #64748b; white-space: nowrap; letter-spacing: -0.3px; }
.seg button.active { background: #fff; color: #4f46e5; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid #e2e8f0; font-size: 13px; margin: 3px; cursor: pointer; background: #fff; }
.chip.on { background: #6366f1; color: #fff; border-color: #6366f1; }
.stat-box { background: #f8fafc; border-radius: 14px; padding: 12px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.list-item:last-child { border-bottom: none; }
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 20px; max-height: 88vh; overflow-y: auto; animation: up .2s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 60; font-size: 14px; }
.progress { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg,#6366f1,#a855f7); border-radius: 999px; }
.star { font-size: 28px; color: #e2e8f0; cursor: pointer; }
.star.on { color: #f59e0b; }
.header-grad { background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; }
.empty { color: #94a3b8; font-size: 13px; text-align: center; padding: 10px 0; }
.meal-thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; cursor: zoom-in; }
.ai-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: #ede9fe; color: #7c3aed; vertical-align: middle; }
.ai-photo-card { border: 1.5px dashed #c7d2fe; }
.ai-spinner { width: 42px; height: 42px; margin: 0 auto; border: 4px solid #e0e7ff; border-top-color: #6366f1; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn:disabled { opacity: .5; }

.install-fab { position: fixed; right: max(16px, calc(50% - 224px)); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 45; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; font-weight: 700; font-size: 13px; padding: 10px 14px; border-radius: 999px; box-shadow: 0 6px 18px rgba(99,102,241,.4); }
@media (display-mode: standalone) {
  .header-grad { padding-top: calc(2rem + env(safe-area-inset-top)); }
  .toast { top: calc(20px + env(safe-area-inset-top)); }
  body { overscroll-behavior-y: none; }
}
