@import url("https://fonts.googleapis.com/icon?family=Material+Icons");
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
    --color-bg: #f4f6f5;
    --color-surface: #ffffff;
    --color-ink: #191f28;
    --color-ink-soft: #8b95a1;
    --color-primary: #14975e;
    --color-primary-dark: #0b3d2e;
    --color-primary-light: #e6f6ee;
    --color-ember: #f04452;
    --color-line: #eceef0;
    --shadow-soft: 0 4px 24px rgba(20, 40, 30, 0.06);
    --shadow-elevated: 0 12px 40px rgba(20, 40, 30, 0.14);
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overscroll-behavior: none;
}

body {
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--color-bg);
    position: relative;
    overflow: hidden;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 90px;
}

/* ===== 하단 네비게이션 ===== */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--color-ink-soft);
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
    flex: 1;
    padding: 0.3rem 0;
    transition: color 0.25s var(--ease-spring), transform 0.25s var(--ease-spring);
}

.nav-item .material-icons { font-size: 1.4rem; transition: transform 0.3s var(--ease-spring); }
.nav-item.active { color: var(--color-primary); font-weight: 600; }
.nav-item.active .material-icons { transform: translateY(-2px) scale(1.08); }
.nav-item:active { transform: scale(0.9); }

/* ===== 애니메이션 키프레임 ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.5s var(--ease-spring) both; }

@keyframes slideUpIn {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.slide-up-in { animation: slideUpIn 0.38s var(--ease-spring) both; }

@keyframes breathe {
    0%, 100% { transform: scale(1) rotate(-1deg); }
    50% { transform: scale(1.06) rotate(1deg); }
}
.breathe { animation: breathe 3.6s ease-in-out infinite; }

@keyframes bounceHappy {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-14px) scale(1.08); }
    50% { transform: translateY(0) scale(0.98); }
    70% { transform: translateY(-6px) scale(1.03); }
}
.bounce-happy { animation: bounceHappy 1.6s var(--ease-spring) infinite; }

@keyframes glowPulse {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease; border-color: var(--color-ember) !important; }

/* ===== 나무 홈 히어로 ===== */
.tree-hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem 4rem;
    transform-origin: top center;
    transition: transform 0.1s linear, opacity 0.1s linear;
    overflow: hidden;
}

.tree-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 15%, #e9f7ee 0%, #f4f6f5 55%, #f4f6f5 100%);
    z-index: 0;
}

.tree-hero.is-verified .tree-hero-bg {
    background: radial-gradient(circle at 50% 15%, #dcf3e5 0%, #f4f6f5 60%, #f4f6f5 100%);
}

.tree-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.tree-emoji-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.tree-emoji {
    font-size: 6.4rem;
    line-height: 1;
    filter: drop-shadow(0 10px 24px rgba(20, 100, 60, 0.25));
    user-select: none;
    z-index: 1;
}

.tree-glow {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 151, 94, 0.25) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
    z-index: 0;
}

.tree-heading {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--color-ink);
    letter-spacing: -0.02em;
}

.tree-sub {
    font-size: 0.94rem;
    color: var(--color-ink-soft);
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.reading-pill, .count-pill {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    background-color: var(--color-surface);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.count-pill { color: var(--color-ink-soft); font-weight: 500; background-color: rgba(255,255,255,0.7); }

.reading-pill .material-icons, .count-pill .material-icons { font-size: 1.05rem; }

/* 오늘의 말씀 = 북마크 색상 강조 */
.bookmark-pill {
    background-color: #fff4d6;
    color: #8a5a00;
    box-shadow: 0 4px 16px rgba(224, 168, 0, 0.25);
    position: relative;
    padding-left: 1.3rem;
}
.bookmark-pill .material-icons { color: #e0a800; }
.bookmark-pill::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background-color: #e0a800;
    border-radius: 999px 0 0 999px;
}

.pull-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 0; right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    color: var(--color-ink-soft);
    font-size: 0.72rem;
    font-weight: 500;
    animation: bobDown 1.8s ease-in-out infinite;
    z-index: 1;
}

@keyframes bobDown {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ===== 오늘의 인증 섹션 ===== */
.today-section {
    background-color: var(--color-bg);
    border-radius: 28px 28px 0 0;
    margin-top: -24px;
    position: relative;
    z-index: 2;
    padding: 1.5rem 1.25rem 1rem;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.03);
}

.today-section-header { margin-bottom: 1rem; }

.date-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    background-color: var(--color-surface);
    padding: 0.4rem;
    border-radius: 16px;
    border: 1px solid var(--color-line);
    box-shadow: var(--shadow-soft);
}

.date-picker {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-size: 0.92rem;
    font-weight: 500;
    outline: none;
}

.icon-button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background-color: var(--color-bg);
    color: var(--color-ink);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s var(--ease-spring);
}
.icon-button:active { background-color: var(--color-line); transform: scale(0.9); }

.current-date {
    font-size: 0.85rem;
    color: var(--color-ink-soft);
    margin: 0.6rem 0.2rem 0;
    font-weight: 500;
}

/* ===== 인증 리스트 ===== */
.entry-list-compact { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }

.entry-item-compact {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background-color: var(--color-surface);
    padding: 0.75rem;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform 0.18s var(--ease-spring), box-shadow 0.18s ease;
}
.entry-item-compact:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

.compact-thumbnail {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--color-bg);
}
.compact-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.thumb-badge {
    position: absolute;
    bottom: 3px; right: 3px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 999px;
}

.compact-info { flex: 1; min-width: 0; }
.compact-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.2rem; }
.compact-info h3 { font-size: 0.98rem; font-weight: 700; color: var(--color-ink); }
.compact-msg { font-size: 0.85rem; color: var(--color-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.like-button {
    display: flex; align-items: center; gap: 0.2rem;
    border: none; background: var(--color-bg); cursor: pointer;
    color: var(--color-ink-soft); padding: 0.3rem 0.6rem; border-radius: 20px;
    transition: all 0.2s var(--ease-spring);
}
.like-button:active { transform: scale(0.88); }
.like-button .material-icons { font-size: 1rem; }
.like-button .like-count { font-size: 0.78rem; font-weight: 700; }
.like-button.liked { background-color: rgba(240, 68, 82, 0.12); color: var(--color-ember); }

.delete-button {
    display: flex; align-items: center; justify-content: center;
    border: none; background: rgba(240,68,82,0.1); color: var(--color-ember);
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    transition: transform 0.15s var(--ease-spring);
}
.delete-button:active { transform: scale(0.85); }

/* ===== 페이지 공통 ===== */
.page-header { margin-bottom: 1rem; padding: 1.25rem 1.25rem 0; }
.page-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--color-ink); letter-spacing: -0.02em; }
.people-page, .settings-page { padding-bottom: 1rem; }

/* ===== 사람들 탭 ===== */
.search-container { padding: 0 1.25rem; margin-bottom: 1rem; }
.search-bar {
    display: flex; align-items: center; gap: 0.5rem;
    background-color: var(--color-surface); padding: 0.75rem 1rem;
    border-radius: 16px; box-shadow: var(--shadow-soft); color: var(--color-ink-soft);
}
.search-bar input { flex: 1; min-width: 0; border: none; font-size: 0.94rem; outline: none; background: none; color: var(--color-ink); }

.people-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 0 1.25rem;
}

.person-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    cursor: pointer; transition: transform 0.18s var(--ease-spring);
}
.person-card:active { transform: scale(0.93); }

.person-avatar {
    position: relative;
    width: 72px; height: 72px; border-radius: 50%;
    overflow: hidden; background-color: var(--color-surface);
    box-shadow: var(--shadow-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-ink-soft);
    border: 2px solid transparent;
}
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }

.person-today-dot {
    position: absolute; bottom: 2px; right: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background-color: var(--color-primary);
    border: 2px solid var(--color-surface);
}

.person-name { font-size: 0.85rem; font-weight: 700; color: var(--color-ink); text-align: center; }
.person-count { font-size: 0.72rem; color: var(--color-ink-soft); }

/* ===== 내 화면 (프로필) ===== */
.settings-card {
    background-color: var(--color-surface);
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    margin: 0 1.25rem 1rem;
}
.setting-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.setting-item.column { flex-direction: column; align-items: stretch; gap: 0.75rem; }
.setting-info h3 { font-size: 0.98rem; font-weight: 700; color: var(--color-ink); margin-bottom: 0.15rem; }
.setting-info p { font-size: 0.82rem; color: var(--color-ink-soft); }

.profile-card {
    background-color: var(--color-surface);
    border-radius: 24px;
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: var(--shadow-soft);
    margin: 0 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
}

.profile-avatar-wrap {
    position: relative;
    width: 96px; height: 96px;
    cursor: pointer;
}
.profile-avatar {
    width: 100%; height: 100%; border-radius: 50%;
    background-color: var(--color-primary-light); color: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; box-shadow: var(--shadow-soft);
    border: 3px solid var(--color-surface);
    transition: transform 0.2s var(--ease-spring), opacity 0.2s ease;
}
.profile-avatar .material-icons { font-size: 2.6rem; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar.is-uploading { opacity: 0.5; animation: breathe 1s ease-in-out infinite; }
.profile-avatar-wrap:active .profile-avatar { transform: scale(0.93); }
.profile-avatar-edit {
    position: absolute; bottom: -2px; right: -2px;
    width: 32px; height: 32px; border-radius: 50%;
    background-color: var(--color-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid var(--color-surface);
}
.profile-avatar-edit .material-icons { font-size: 1rem; }

.profile-login-box { width: 100%; text-align: center; }
.profile-login-label {
    display: block; font-size: 0.8rem; font-weight: 700; color: var(--color-ink-soft);
    margin-bottom: 0.55rem; letter-spacing: -0.01em;
}
.profile-login-hint { font-size: 0.78rem; color: var(--color-ink-soft); margin-top: 0.6rem; line-height: 1.4; }

.profile-stat-row {
    display: flex; align-items: center; gap: 0.4rem;
    background-color: var(--color-primary-light); color: var(--color-primary-dark);
    padding: 0.65rem 1rem; border-radius: 14px; font-size: 0.85rem; font-weight: 600;
    width: 100%; justify-content: center;
}
.profile-stat-row .material-icons { font-size: 1.1rem; color: var(--color-primary); }
.profile-stat-row b { font-weight: 800; }

.name-edit-row { display: flex; gap: 0.5rem; }
.name-edit-row input {
    flex: 1; padding: 0.75rem 0.9rem; border: 1px solid var(--color-line);
    border-radius: 12px; font-family: inherit; background-color: var(--color-bg);
    color: var(--color-ink); font-size: 0.92rem; outline: none;
    transition: border-color 0.2s ease;
}
.name-edit-row input:focus { border-color: var(--color-primary); background-color: var(--color-surface); }
.name-save-btn {
    padding: 0 1.1rem; border: none; border-radius: 12px;
    background-color: var(--color-primary); color: #fff; font-weight: 700; font-size: 0.88rem;
    cursor: pointer; transition: transform 0.15s var(--ease-spring);
}
.name-save-btn:active { transform: scale(0.93); }

/* ===== 빈 상태 ===== */
.no-content {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 3rem 1rem; background-color: var(--color-surface); border-radius: 20px;
    text-align: center; margin: 0 1.25rem;
}
.no-content .material-icons { font-size: 2.2rem; color: var(--color-ink-soft); margin-bottom: 0.5rem; }
.no-content p { color: var(--color-ink-soft); font-size: 0.9rem; }

/* ===== 토스트 ===== */
#toastContainer {
    position: fixed;
    bottom: 100px;
    left: 50%;
    z-index: 3000;
    width: calc(100% - 2.5rem);
    max-width: 420px;
    pointer-events: none;
}
.toast {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 16px);
    opacity: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background-color: rgba(25, 31, 40, 0.92);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    box-shadow: var(--shadow-elevated);
    font-size: 0.86rem;
    font-weight: 600;
    transition: all 0.3s var(--ease-spring);
    pointer-events: auto;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-action {
    flex-shrink: 0;
    background-color: var(--color-primary);
    color: #fff; border: none; padding: 0.4rem 0.8rem;
    border-radius: 10px; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}

/* ===== 모달 공통 (상세 보기) ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background-color: rgba(10, 15, 12, 0.6);
    backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: flex-end;
    z-index: 2000;
    animation: fadeInBg 0.25s ease;
}
@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background-color: var(--color-surface);
    border-radius: 26px 26px 0 0;
    width: 100%; max-width: 480px; max-height: 88vh;
    overflow-y: auto; position: relative;
    display: flex; flex-direction: column;
}

.modal-image-wrap { position: relative; }
.modal-content img { width: 100%; max-height: 340px; object-fit: cover; display: block; }

.carousel-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(0,0,0,0.4); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.carousel-nav.prev { left: 0.6rem; }
.carousel-nav.next { right: 0.6rem; }
.carousel-nav:disabled { opacity: 0.25; cursor: default; }
.carousel-nav:active:not(:disabled) { transform: translateY(-50%) scale(0.88); }

.carousel-counter {
    position: absolute; top: 0.6rem; right: 0.6rem;
    background: rgba(0,0,0,0.5); color: #fff;
    font-size: 0.72rem; font-weight: 700;
    padding: 0.2rem 0.55rem; border-radius: 999px;
}

.carousel-dots {
    position: absolute; bottom: 0.6rem; left: 0; right: 0;
    display: flex; justify-content: center; gap: 5px;
}
.carousel-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); }
.carousel-dots .dot.active { background: #fff; width: 16px; border-radius: 3px; }

.edit-button {
    display: flex; align-items: center; justify-content: center;
    border: none; background: var(--color-primary-light); color: var(--color-primary);
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    transition: transform 0.15s var(--ease-spring);
}
.edit-button:active { transform: scale(0.85); }

.entry-edit-textarea {
    width: 100%; min-height: 80px; padding: 0.7rem 0.85rem; border: 1px solid var(--color-line);
    border-radius: 12px; font-family: inherit; background-color: var(--color-bg);
    color: var(--color-ink); font-size: 0.9rem; outline: none; resize: none;
    transition: border-color 0.2s ease;
}
.entry-edit-textarea:focus { border-color: var(--color-primary); background-color: var(--color-surface); }
.entry-edit-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.6rem; }
.edit-cancel-btn, .edit-save-btn {
    padding: 0.5rem 1rem; border: none; border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer;
    transition: transform 0.15s var(--ease-spring);
}
.edit-cancel-btn { background-color: var(--color-bg); color: var(--color-ink-soft); }
.edit-save-btn { background-color: var(--color-primary); color: #fff; }
.edit-cancel-btn:active, .edit-save-btn:active { transform: scale(0.94); }

.modal-close {
    position: absolute; top: 0.8rem; right: 0.8rem;
    background: rgba(0,0,0,0.5); border: none; border-radius: 50%;
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #fff; z-index: 10;
}

.modal-info { padding: 1.15rem 1.25rem 1.5rem; }
.modal-info-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; gap: 0.5rem; }
.modal-info-actions { display: flex; align-items: center; gap: 0.5rem; }
.modal-info h3 { font-size: 1.08rem; font-weight: 800; color: var(--color-ink); }
.modal-info p { color: var(--color-ink-soft); font-size: 0.9rem; }

/* ===== 바텀시트형 모달 (업로드/프로필) ===== */
.modal-sheet {
    background-color: var(--color-surface);
    border-radius: 28px 28px 0 0;
    width: 100%; max-width: 480px; max-height: 90vh;
    overflow-y: auto;
    padding: 0.6rem 1.25rem 2rem;
    position: relative;
}
.modal-handle { width: 40px; height: 5px; border-radius: 3px; background-color: var(--color-line); margin: 0.4rem auto 1rem; }
.modal-sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.modal-sheet-header h2 { font-size: 1.2rem; font-weight: 800; }
.modal-close-x {
    width: 30px; height: 30px; border-radius: 50%; border: none;
    background-color: var(--color-bg); color: var(--color-ink-soft);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ===== 업로드 폼 ===== */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 700; font-size: 0.86rem; color: var(--color-ink); }
.form-group input, .form-group textarea {
    width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--color-line);
    border-radius: 12px; font-family: inherit; background-color: var(--color-bg);
    color: var(--color-ink); font-size: 0.92rem; outline: none;
    transition: border-color 0.2s ease;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--color-primary); background-color: var(--color-surface); }
.form-group textarea { height: 90px; resize: none; }

/* 날짜 입력 필드가 좁은 화면에서 잘리는 문제 방지 */
.form-group input[type="date"],
.date-picker {
    -webkit-appearance: none;
    appearance: none;
    font-size: 0.86rem;
    padding-left: 0.6rem;
    padding-right: 0.5rem;
    min-width: 0;
}
@media (max-width: 360px) {
    .form-group input[type="date"],
    .date-picker { font-size: 0.78rem; padding-left: 0.45rem; padding-right: 0.3rem; }
}

@keyframes popIn {
    0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
    60% { transform: scale(1.15) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}
.pop-in { animation: popIn 0.5s var(--ease-spring) both, bounceHappy 1.6s var(--ease-spring) 0.5s infinite; }

.error-message {
    background-color: rgba(240, 68, 82, 0.1); color: var(--color-ember);
    padding: 0.75rem; border-radius: 10px; margin-bottom: 1rem;
    font-size: 0.82rem; font-weight: 600;
}

.file-upload-container input[type="file"] { display: none; }
.file-upload-label {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.85rem; background-color: var(--color-bg); border: 1.5px dashed var(--color-line);
    border-radius: 14px; cursor: pointer; color: var(--color-primary);
    font-weight: 700; font-size: 0.9rem; transition: transform 0.15s var(--ease-spring);
}
.file-upload-label:active { transform: scale(0.97); }

.image-preview-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem;
    margin-top: 0.75rem;
}
.image-preview-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; animation: fadeInUp 0.3s var(--ease-spring); }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.remove-preview {
    position: absolute; top: 3px; right: 3px; width: 22px; height: 22px;
    border: none; border-radius: 50%; background-color: rgba(0,0,0,0.6);
    color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.remove-preview .material-icons { font-size: 0.9rem; }

.submit-button {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    width: 100%; padding: 0.95rem; border: none; border-radius: 16px;
    background-color: var(--color-primary); color: #fff; font-size: 0.96rem; font-weight: 700;
    cursor: pointer; transition: transform 0.15s var(--ease-spring), opacity 0.2s ease;
    box-shadow: 0 8px 20px rgba(20, 151, 94, 0.3);
}
.submit-button:active { transform: scale(0.97); }
.submit-button.is-loading { opacity: 0.7; pointer-events: none; }

/* ===== 사람 프로필 캘린더 ===== */
.person-profile-sheet { max-height: 88vh; }
.cal-month-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 0.9rem; }
.cal-month-label { font-weight: 700; font-size: 0.98rem; min-width: 100px; text-align: center; }

.cal-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    text-align: center; font-size: 0.75rem; color: var(--color-ink-soft); font-weight: 600;
    margin-bottom: 0.4rem;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
    aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px;
    background-color: var(--color-bg); font-size: 0.75rem; color: var(--color-ink-soft);
    transition: transform 0.15s var(--ease-spring);
}
.cal-cell.empty { background: none; }
.cal-cell[data-date] { cursor: default; }
.cal-cell .cal-icon .material-icons { font-size: 0.85rem; }

.cal-cell.cal-done {
    background-color: var(--color-primary); color: #fff; cursor: pointer;
}
.cal-cell.cal-done:active { transform: scale(0.88); }
.cal-cell.cal-missed { background-color: rgba(240, 68, 82, 0.1); color: var(--color-ember); }
.cal-cell.cal-rest { background-color: rgba(139, 149, 161, 0.1); color: var(--color-ink-soft); }
.cal-cell.cal-future { background-color: transparent; color: var(--color-line); }
.cal-cell.cal-today { box-shadow: 0 0 0 2px var(--color-primary-dark) inset; }

.cal-legend { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; font-size: 0.75rem; color: var(--color-ink-soft); }
.cal-legend span { display: flex; align-items: center; gap: 0.3rem; }
.dot-legend { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-legend.done { background-color: var(--color-primary); }
.dot-legend.missed { background-color: var(--color-ember); }
.dot-legend.rest { background-color: var(--color-ink-soft); }

/* ===== 첫 방문 환영 모달 ===== */
.welcome-sheet {
    text-align: center;
    padding-top: 0.6rem;
    padding-bottom: calc(1.6rem + env(safe-area-inset-bottom));
}
.welcome-close {
    position: absolute; top: 0.9rem; right: 1.1rem;
}
.welcome-emoji {
    font-size: 3.4rem;
    margin: 0.6rem 0 0.7rem;
    animation: breathe 3.6s ease-in-out infinite;
}
.welcome-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.welcome-desc { font-size: 0.86rem; color: var(--color-ink-soft); line-height: 1.5; margin-bottom: 1.3rem; }
.welcome-sheet .form-group { text-align: left; }
