/* 달빛여시 — "새벽 달빛이 비치는 조용한 방" */

/* ===== 폰트 ===== */
@import url('https://cdn.jsdelivr.net/gh/sun-typeface/SUIT@2/fonts/variable/woff2/SUIT-Variable.css');
@import url('https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&display=swap');

/* ===== CSS 변수 ===== */
:root {
    --bg-primary: #0F0A1A;
    --bg-secondary: #1A1228;
    --bg-card: #241A35;
    --color-lavender: #B8A0D8;
    --color-orange: #E8A87C;
    --color-gold: #D4AF37;
    --color-text: #E8E0F0;
    --color-text-dim: #AEA3C4;
    --color-danger: #E87C7C;
    --color-success: #7CE8A8;
    --color-kakao: #FEE500;
    --font-body: 'SUIT Variable', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-title: 'Gowun Batang', serif;
    --radius: 12px;
    --radius-lg: 20px;
    --nav-height: 60px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* ===== 리셋 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    touch-action: pan-x pan-y;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--color-text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: -0.02em;
    -webkit-font-smoothing: antialiased;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar,
.finance-panel::-webkit-scrollbar {
    display: none;
}

/* ===== 레이아웃 ===== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    padding: 20px 0 16px;
    text-align: center;
    border-bottom: 1px solid rgba(184, 160, 216, 0.1);
}

.page-header h1 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: var(--color-lavender);
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* 대화/달빛점 — 상단 고정 헤더 */
.chat-header,
.fortune-header {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-primary);
}

.chat-header h1,
.fortune-header h1 {
    flex: 1;
    text-align: center;
}

.chat-header-left,
.chat-header-right {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-font {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(184, 160, 216, 0.3);
    background: transparent;
    color: var(--color-lavender);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-font:active {
    background: rgba(184, 160, 216, 0.15);
}

.page-content {
    flex: 1;
    padding: 20px 0;
    padding-bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom, 0px));
}

.page-content.has-input {
    padding-bottom: calc(var(--nav-height) + 88px + env(safe-area-inset-bottom, 0px));
}

/* ===== 타이포그래피 ===== */
h1, h2, h3 {
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* ===== 버튼 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    min-width: 44px;
    letter-spacing: -0.02em;
}

.btn-primary {
    background: var(--color-lavender);
    color: var(--bg-primary);
}

.btn-primary:active {
    background: #9B84C0;
    transform: scale(0.98);
}

.btn-kakao {
    background: var(--color-kakao);
    color: #191919;
    font-weight: 600;
    width: 100%;
    min-height: 52px;
    font-size: 1.05rem;
    gap: 8px;
}

.btn-kakao:active {
    background: #E5CE00;
    transform: scale(0.97);
}

.btn-kakao:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-lavender);
    color: var(--color-lavender);
}

.btn-outline:active {
    background: rgba(184, 160, 216, 0.1);
    transform: scale(0.98);
}

.btn-gold {
    background: var(--color-gold);
    color: var(--bg-primary);
    font-weight: 600;
}

.btn-gold:active {
    background: #C4A030;
    transform: scale(0.98);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 0.875rem;
    min-height: 44px;
}

/* ===== 카드 ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.card-menu:active {
    transform: scale(0.98);
}

.card-menu .card-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.card-menu .card-title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--color-text);
}

.card-menu .card-desc {
    font-size: 13px;
    color: var(--color-text-dim);
}

/* ===== 채팅 ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    padding-bottom: 20px;
}

.chat-row {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.chat-row.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-row.user {
    align-self: flex-end;
    align-items: flex-end;
    margin-top: 8px;
}

.chat-row.user + .chat-row.user {
    margin-top: 0;
}

.chat-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.7;
    font-size: inherit;
    word-break: keep-all;
    white-space: pre-wrap;
    letter-spacing: -0.02em;
}

.chat-bubble.assistant {
    background: var(--bg-card);
    border-bottom-left-radius: 4px;
    color: var(--color-text);
    font-family: var(--font-title);
    font-weight: 400;
}

.chat-bubble.user {
    background: var(--color-lavender);
    color: var(--bg-primary);
    border-bottom-right-radius: 4px;
}

.chat-time {
    font-size: 12px;
    color: var(--color-text-dim);
    margin-top: 4px;
    padding: 0 4px;
}

.chat-sender {
    font-size: 16px;
    color: var(--color-text-dim);
    margin-top: 12px;
}

.chat-sender:first-child {
    margin-top: 0;
}

/* ===== 입력 ===== */
.input-area {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(184, 160, 216, 0.1);
    z-index: 50;
}

.input-area .input-wrap {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.input-area textarea {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(184, 160, 216, 0.2);
    border-radius: 20px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: -0.02em;
    outline: none;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s ease;
}

.input-area textarea:focus {
    border-color: var(--color-lavender);
}

.input-area textarea::placeholder {
    color: var(--color-text-dim);
}

.input-area .btn-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--color-lavender);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
}

.input-area .btn-send svg {
    width: 20px;
    height: 20px;
    fill: var(--bg-primary);
}

.input-area .btn-send:active {
    background: #9B84C0;
    transform: scale(0.93);
}

.input-area .btn-send.disabled {
    opacity: 0.35;
    cursor: default;
}

/* ===== 하단 네비게이션 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(184, 160, 216, 0.15);
    display: flex;
    justify-content: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav .nav-inner {
    max-width: 480px;
    width: 100%;
    display: flex;
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    color: var(--color-text-dim);
    text-decoration: none;
    font-size: 12px;
    gap: 2px;
    transition: var(--transition);
    height: var(--nav-height);
}

.bottom-nav a.active {
    color: var(--color-lavender);
}

.bottom-nav a .nav-icon {
    font-size: 1.3rem;
}

/* ===== 가계부 — 탭 레이아웃 ===== */
.finance-body {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

.finance-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
}

.finance-layout .page-header {
    flex-shrink: 0;
    padding: 14px 20px 10px;
}

.finance-summary-bar {
    flex-shrink: 0;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(184, 160, 216, 0.1);
}

.finance-summary-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 16px;
}

.summary-left {
    flex: 1;
    min-width: 0;
}

.summary-left .goal-amount {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 2px;
}

.summary-right {
    flex-shrink: 0;
}

.goal-ring {
    position: relative;
    width: 44px;
    height: 44px;
}

.goal-ring svg {
    width: 100%;
    height: 100%;
}

.goal-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-lavender);
}

.finance-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(184, 160, 216, 0.1);
    background: var(--bg-primary);
}

.finance-tab {
    flex: 1;
    min-height: 44px;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-dim);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.finance-tab.active {
    color: var(--color-lavender);
    border-bottom-color: var(--color-lavender);
}

.summary-period-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.period-tab {
    padding: 6px 20px;
    border-radius: 20px;
    border: 1px solid rgba(184, 160, 216, 0.2);
    background: none;
    color: var(--color-text-dim);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.period-tab.active {
    background: rgba(184, 160, 216, 0.15);
    border-color: var(--color-lavender);
    color: var(--color-lavender);
}

.upgrade-notice {
    text-align: center;
    padding: 32px 20px;
    color: var(--color-text-dim);
    font-size: 14px;
    line-height: 1.8;
}

.upgrade-notice .btn {
    margin-top: 16px;
}

.finance-panel {
    flex: 1;
    overflow-y: auto;
    display: none;
    padding: 16px 20px;
    padding-bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom, 0px));
    -ms-overflow-style: none;
    scrollbar-width: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.finance-panel.active {
    display: flex;
    flex-direction: column;
}

#panel-chat {
    padding: 12px 20px 0;
    padding-bottom: calc(var(--nav-height) + 88px + env(safe-area-inset-bottom, 0px));
}

#panel-chat .chat-container {
    padding-bottom: 0;
}

.finance-summary-bar .finance-stats {
    margin-top: 4px;
    font-size: 13px;
    gap: 12px;
    justify-content: flex-start;
}

.finance-stats {
    display: flex;
    gap: 12px;
    font-size: 15px;
}

.finance-stats .stat-income {
    color: var(--color-lavender);
}

.finance-stats .stat-expense {
    color: var(--color-orange);
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(184, 160, 216, 0.05);
    min-height: 56px;
}

.record-item .record-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.record-item .record-date {
    font-size: 12px;
    color: var(--color-text-dim);
}

.record-item .record-desc {
    font-size: 16px;
}

.record-item .record-amount.income {
    color: var(--color-lavender);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0;
}

.record-item .record-amount.expense {
    color: var(--color-orange);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0;
}

.record-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.record-delete {
    background: none;
    border: none;
    color: var(--color-text-dim);
    font-size: 18px;
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.record-delete:active {
    opacity: 1;
    color: var(--color-danger);
}

/* ===== 카테고리 분석 ===== */
.category-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.category-name {
    width: 48px;
    flex-shrink: 0;
    color: var(--color-text-dim);
}

.category-bar {
    flex: 1;
    height: 8px;
    background: rgba(184, 160, 216, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    background: var(--color-lavender);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-pct {
    width: 32px;
    text-align: right;
    color: var(--color-text-dim);
    font-size: 12px;
}

/* ===== 타로 카드 ===== */
.tarot-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 16px 0;
}

.tarot-card {
    aspect-ratio: 2/3;
    perspective: 800px;
    cursor: pointer;
}

.tarot-card.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.tarot-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.tarot-card.flipped .tarot-card-inner {
    transform: rotateY(180deg);
}

.tarot-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 2px solid rgba(184, 160, 216, 0.3);
    overflow: hidden;
}

.tarot-card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.tarot-card-front {
    background: linear-gradient(135deg, var(--bg-card), #2A1F40);
}

.tarot-card-back {
    background: linear-gradient(135deg, #2A1F40, var(--bg-card));
    border-color: var(--color-gold);
    transform: rotateY(180deg);
}

.tarot-card:active .tarot-card-face {
    border-color: var(--color-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.fortune-result-text {
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* 생년월일 입력 폼 */
.birth-form {
    padding: 0 4px;
}

.birth-label {
    display: block;
    font-size: 13px;
    color: var(--color-text-dim);
    margin-bottom: 6px;
}

.birth-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(184, 160, 216, 0.2);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
}

.birth-input:focus {
    border-color: var(--color-lavender);
}

.birth-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.birth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-dim);
    cursor: pointer;
}

.birth-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-lavender);
    cursor: pointer;
}

.tarot-result {
    text-align: center;
    padding: 30px 0;
}

.tarot-result .card-image {
    width: 280px;
    border: 2px solid var(--color-gold);
    border-radius: var(--radius);
    margin: 0 auto 20px;
    overflow: hidden;
}

.tarot-result .card-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
}

/* ===== 온보딩 ===== */
.onboarding-message {
    padding: 20px 0;
}

.onboarding-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
}

.onboarding-option {
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(184, 160, 216, 0.2);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.15rem;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.onboarding-option:active {
    background: rgba(184, 160, 216, 0.15);
    border-color: var(--color-lavender);
    transform: scale(0.97);
}

.onboarding-option.selected {
    background: rgba(184, 160, 216, 0.15);
    border-color: var(--color-lavender);
}

.onboarding-skip {
    display: block;
    margin: 16px 0 0 auto;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--color-text-dim);
    font-family: var(--font-body);
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition);
}

.onboarding-skip:active {
    color: var(--color-lavender);
}

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0 4px;
}

.onboarding-progress .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(184, 160, 216, 0.2);
    transition: all 0.3s ease;
}

.onboarding-progress .dot.active {
    background: var(--color-lavender);
    transform: scale(1.2);
}

.onboarding-progress .dot.done {
    background: rgba(184, 160, 216, 0.5);
}

.btn-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius);
    background: var(--color-lavender);
    color: var(--bg-primary);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 52px;
}

.btn-cta:active {
    background: #9B84C0;
    transform: scale(0.97);
}

.btn-cta:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.step-fade-in {
    animation: stepFadeIn 0.3s ease forwards;
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    height: 12px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-dim);
    animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.onboarding-input {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(184, 160, 216, 0.2);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.15rem;
    outline: none;
}

.onboarding-input:focus {
    border-color: var(--color-lavender);
}

/* ===== 멤버십 ===== */
.membership-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid rgba(184, 160, 216, 0.1);
    transition: var(--transition);
}

.membership-card.recommended {
    border-color: var(--color-gold);
}

.membership-card .plan-name {
    font-family: var(--font-title);
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.membership-card .plan-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 16px;
    letter-spacing: 0;
}

.membership-card .plan-features {
    list-style: none;
    font-size: 15px;
    line-height: 2;
    color: var(--color-text-dim);
}

.membership-card.active {
    border-color: var(--color-gold);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.15);
}

.membership-card.active .btn {
    opacity: 0.5;
    pointer-events: none;
}

.plan-status {
    font-size: 13px;
    color: var(--color-text-dim);
    margin-top: 8px;
    line-height: 1.6;
}

.plan-status-cancelled {
    color: var(--color-orange);
}

.btn-cancel {
    background: none;
    border: none;
    color: var(--color-text-dim);
    font-size: 13px;
    padding: 8px 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-cancel:active {
    color: var(--color-danger);
}

/* ===== 로그인 페이지 ===== */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px 20px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

.login-page .login-top {
    padding-top: 25vh;
}

.login-page .login-bottom {
    margin-top: auto;
    margin-bottom: 10vh;
    width: 100%;
    max-width: 480px;
}

.login-page .logo {
    font-size: 4rem;
    margin-bottom: 16px;
}

.login-page .title {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-lavender);
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.login-page .subtitle {
    color: var(--color-text-dim);
    font-size: 0.95rem;
    line-height: 1.8;
    letter-spacing: -0.02em;
}

.login-page .privacy-note {
    font-size: 13px;
    color: var(--color-text-dim);
    margin-top: 16px;
}

.login-page .login-error {
    font-size: 0.85rem;
    color: var(--color-lavender);
    margin-top: 16px;
    text-align: center;
}

/* ===== 모달 (alert/confirm 대체) ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 10, 26, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: stepFadeIn 0.3s ease;
}

.modal-message {
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 24px;
    white-space: pre-wrap;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn {
    flex: 1;
}

/* ===== 홈 ===== */
.home-greeting {
    font-family: var(--font-title);
    font-size: 18px;
    color: var(--color-lavender);
    margin-bottom: 20px;
    padding: 0 4px;
}

/* ===== 메뉴 그리드 ===== */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ===== 운세 로딩 ===== */
.fortune-loading {
    text-align: center;
    padding: 40px 20px;
}

.fortune-loading-text {
    font-family: var(--font-title);
    font-size: 1rem;
    color: var(--color-text-dim);
    margin-top: 16px;
}

.fortune-loading .star-animation {
    font-size: 2rem;
    animation: starPulse 1.5s infinite;
}

@keyframes starPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== 인라인 메시지 ===== */
.inline-message {
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--bg-card);
    text-align: center;
    font-family: var(--font-title);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 20px;
    animation: stepFadeIn 0.3s ease forwards;
}

/* ===== 유틸리티 ===== */
.text-center { text-align: center; }
.text-lavender { color: var(--color-lavender); }
.text-gold { color: var(--color-gold); }
.text-orange { color: var(--color-orange); }
.text-dim { color: var(--color-text-dim); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }


/* ===== 호버/포커스 상태 (데스크톱 + 접근성) ===== */
@media (hover: hover) {
    .btn-primary:hover { background: #C4B0E0; }
    .btn-outline:hover { background: rgba(184, 160, 216, 0.08); }
    .btn-gold:hover { background: #E0C050; }
    .btn-kakao:hover { background: #F0D800; }
    .card-menu:hover { background: rgba(184, 160, 216, 0.08); }
    .onboarding-option:hover { border-color: rgba(184, 160, 216, 0.5); }
    .record-delete:hover { opacity: 0.8; }
    .btn-font:hover { background: rgba(184, 160, 216, 0.1); }
}

:focus-visible {
    outline: 2px solid var(--color-lavender);
    outline-offset: 2px;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--color-lavender);
    outline-offset: 2px;
}

/* ===== 토스트 메시지 ===== */
.toast-message {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    color: var(--color-text);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-title);
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 150;
    pointer-events: none;
    white-space: nowrap;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ===== 반응형 ===== */
@media (min-width: 481px) {
    .container {
        padding: 0 24px;
    }
}

