* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
    background: #FAF6F2;
    min-height: 100vh;
}

.app {
    max-width: 430px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #3D2B2B 0%, #6B4A4A 100%);
    padding: 28px 20px 24px;
    position: relative;
    overflow: hidden;
}
.header-circle-1 {
    position: absolute; top: -20px; right: -20px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(196,149,106,0.15);
}
.header-circle-2 {
    position: absolute; bottom: -30px; left: 30px;
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(196,149,106,0.1);
}
.header-sub {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-bottom: 4px;
}
.header-title {
    font-family: 'Cormorant Garamond', serif;
    color: #FAF6F2;
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 16px;
}
.budget-box {
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 14px 18px;
    backdrop-filter: blur(10px);
}
.budget-label {
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    margin-bottom: 4px;
}
.budget-amount {
    color: #F2C98A;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.budget-unit {
    font-size: 14px;
    font-weight: 400;
    margin-left: 4px;
}

/* Upcoming Banner */
.upcoming-banner {
    margin: 12px 16px 0;
    background: linear-gradient(135deg, #C4956A, #E8B98A);
    border-radius: 12px;
    padding: 12px 16px;
}
.upcoming-label {
    color: white;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.upcoming-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}
.upcoming-item:first-of-type { margin-top: 0; }
.upcoming-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.upcoming-icon { font-size: 14px; }
.upcoming-title { color: white; font-size: 13px; font-weight: 600; }
.upcoming-date { color: rgba(255,255,255,0.8); font-size: 11px; }
.upcoming-dday {
    background: rgba(255,255,255,0.25);
    color: white;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}

/* Card */
.cards-container { padding: 16px 16px 0; }
.card {
    background: white;
    border-radius: 16px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(61,43,43,0.07);
}
.card-header {
    display: flex;
    align-items: center;
    padding: 15px 16px;
    cursor: pointer;
}
.card-icon-box {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: #FAF0E8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}
.card-info { flex: 1; }
.card-name { font-weight: 700; font-size: 15px; color: #2D2320; }
.card-vendor { font-size: 12px; color: #C9B5AC; margin-top: 1px; }
.card-vendor.has-vendor { color: #8B6F5E; }
.card-right { text-align: right; }
.card-total { font-weight: 700; font-size: 15px; color: #C9B5AC; }
.card-total.has-amount { color: #C4956A; }
.card-toggle { font-size: 12px; color: #C9B5AC; margin-top: 1px; }

/* Card Body */
.card-body {
    border-top: 1px solid #F5EDE6;
    padding: 14px 16px;
}

/* Fields */
.field { margin-bottom: 12px; }
.field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #8B6F5E;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.field-input {
    width: 100%;
    background: #FAF7F5;
    border: 1.5px solid #F0E6DE;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #2D2320;
    outline: none;
    font-family: 'Noto Sans KR', sans-serif;
    margin-bottom: 0;
}
.field-input:focus { border-color: #C4956A; }
.field-textarea { height: 60px; resize: none; }

/* Item Row */
.item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.item-label {
    font-size: 13px;
    color: #8B6F5E;
    width: 60px;
    flex-shrink: 0;
}
.item-input-wrap {
    flex: 1;
    position: relative;
}
.item-input-wrap.full { width: 100%; }
.item-input { padding-right: 30px; }
.input-unit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #C9B5AC;
}

/* Calc Type (식대비) */
.calc-row { flex-wrap: wrap; }
.calc-row .item-label { width: 100%; margin-bottom: 6px; }
.calc-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.calc-input-wrap {
    flex: 1;
    position: relative;
}
.calc-input-wrap.calc-qty { flex: 0.6; }
.calc-input { padding-right: 30px; font-size: 13px; }
.calc-x, .calc-eq {
    font-size: 13px;
    color: #C9B5AC;
    font-weight: 700;
    flex-shrink: 0;
}
.calc-result {
    font-size: 13px;
    color: #C4956A;
    font-weight: 700;
    white-space: nowrap;
}
.calc-result-unit {
    font-size: 11px;
    color: #C9B5AC;
    flex-shrink: 0;
}

/* Subtotal */
.subtotal-row {
    background: #FAF0E8;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
}
.subtotal-label { font-size: 13px; color: #8B6F5E; font-weight: 600; }
.subtotal-amount { font-size: 13px; color: #C4956A; font-weight: 700; }

/* SDME Toggle */
.sdme-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.sdme-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: 8px;
    border: none;
    background: #F5EDE6;
    color: #8B6F5E;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}
.sdme-btn.active { background: #3D2B2B; color: white; }
.sdme-package-price { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #E8DDD4; }
.sdme-item-row { align-items: flex-start; }
.sdme-item-fields { display: flex; gap: 6px; flex: 1; min-width: 0; }
.sdme-vendor-input { flex: 1; min-width: 0; }

/* Schedule */
.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.schedule-add-btn {
    background: #FAF0E8;
    border: none;
    color: #C4956A;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}
.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAF7F5;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.schedule-title { font-size: 13px; font-weight: 600; color: #2D2320; }
.schedule-date { font-size: 11px; color: #8B6F5E; }
.schedule-right { display: flex; align-items: center; gap: 8px; }
.schedule-dday {
    font-size: 11px;
    background: #F0E6DE;
    color: #C4956A;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}
.schedule-remove {
    background: none;
    border: none;
    color: #C9B5AC;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
}
.no-schedule { font-size: 12px; color: #C9B5AC; }

/* Add Category Button */
.add-category-btn {
    width: 100%;
    background: white;
    border: 2px dashed #E8D5CC;
    border-radius: 16px;
    padding: 16px;
    color: #C4956A;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    font-family: 'Noto Sans KR', sans-serif;
}

/* Bottom Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: white;
    border-top: 1px solid #F0E6DE;
    padding: 12px 16px;
    display: flex;
    gap: 10px;
}
.share-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px 0;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}
.share-link { background: #F5EDE6; color: #8B6F5E; }
.share-kakao { background: linear-gradient(135deg, #3D2B2B, #6B4A4A); color: white; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45,35,32,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 32px;
    width: 100%;
    max-width: 430px;
}
.modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 600;
    color: #2D2320;
    margin-bottom: 18px;
}
.modal-buttons { display: flex; gap: 8px; margin-top: 12px; }
.btn-cancel {
    flex: 1;
    background: #F5EDE6;
    border: none;
    border-radius: 12px;
    padding: 13px 0;
    color: #8B6F5E;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}
.btn-confirm {
    flex: 1;
    background: linear-gradient(135deg, #3D2B2B, #6B4A4A);
    border: none;
    border-radius: 12px;
    padding: 13px 0;
    color: white;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}

/* Emoji Grid */
.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.emoji-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 2px solid #F0E6DE;
    background: white;
    font-size: 20px;
    cursor: pointer;
}
.emoji-btn.selected { border-color: #C4956A; background: #FAF0E8; }

/* Share Preview */
.share-preview {
    background: #FAF7F5;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #2D2320;
    white-space: pre-wrap;
    line-height: 1.7;
}

/* Field input in modal */
.modal-box .field-input { margin-bottom: 12px; }

/* Auth Pages */
.auth-header {
    background: linear-gradient(135deg, #3D2B2B 0%, #6B4A4A 100%);
    padding: 40px 20px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.auth-container {
    padding: 24px 20px;
}
.auth-title {
    font-size: 20px;
    font-weight: 700;
    color: #2D2320;
    margin-bottom: 20px;
}
.remember-me-field { margin-top: 8px; margin-bottom: 4px; }
.remember-me-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #8B6F5E;
    cursor: pointer;
}
.remember-me-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #6B4A4A;
    cursor: pointer;
}
.auth-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
    margin-top: 8px;
}
.auth-error {
    background: #FFF0F0;
    color: #D32F2F;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}
.auth-success {
    background: #F0FFF4;
    color: #2E7D32;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}
.auth-links {
    text-align: center;
    margin-top: 20px;
}
.auth-link {
    color: #8B6F5E;
    font-size: 13px;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-divider {
    color: #E0D5CC;
    margin: 0 10px;
}
.auth-demo {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #F0E6DE;
}
.auth-demo-link {
    color: #C4956A;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
}
.auth-desc {
    font-size: 13px;
    color: #8B6F5E;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Recovery Key */
.recovery-box {
    background: #FFF8F0;
    border: 2px solid #F2C98A;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}
.recovery-label {
    font-size: 14px;
    font-weight: 700;
    color: #D4790E;
    margin-bottom: 8px;
}
.recovery-desc {
    font-size: 12px;
    color: #8B6F5E;
    line-height: 1.6;
    margin-bottom: 16px;
}
.recovery-key-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}
.recovery-key {
    font-size: 22px;
    font-weight: 700;
    color: #3D2B2B;
    letter-spacing: 2px;
    font-family: monospace;
}
.recovery-copy-btn {
    background: #3D2B2B;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}
.recovery-email {
    font-size: 12px;
    color: #8B6F5E;
}

/* Landing Page */
.landing-header {
    background: linear-gradient(135deg, #3D2B2B 0%, #6B4A4A 100%);
    padding: 60px 20px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.landing-title {
    font-family: 'Cormorant Garamond', serif;
    color: #FAF6F2;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 8px;
}
.landing-desc {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}
.landing-content {
    padding: 24px 20px;
}
.landing-features {
    margin-bottom: 32px;
}
.landing-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(61,43,43,0.07);
}
.landing-feature-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.landing-feature-title {
    font-weight: 700;
    font-size: 14px;
    color: #2D2320;
    margin-bottom: 2px;
}
.landing-feature-desc {
    font-size: 12px;
    color: #8B6F5E;
}
.landing-buttons {
    text-align: center;
}
.landing-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    margin-bottom: 10px;
}
.landing-demo-link {
    display: inline-block;
    margin-top: 8px;
    color: #8B6F5E;
    font-size: 13px;
    text-decoration: none;
}
.landing-demo-link:hover { text-decoration: underline; }

/* Demo Banner */
.demo-banner {
    background: linear-gradient(135deg, #F2C98A, #E8B98A);
    padding: 14px 16px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.demo-banner p {
    color: #3D2B2B;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}
.demo-banner a {
    color: #3D2B2B;
    font-weight: 700;
    text-decoration: underline;
}
.demo-bottom-banner {
    background: linear-gradient(135deg, #F2C98A, #E8B98A);
    padding: 14px 16px;
    text-align: center;
}
.demo-bottom-banner p {
    color: #3D2B2B;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}
.demo-bottom-banner a {
    color: #3D2B2B;
    font-weight: 700;
    text-decoration: underline;
}

/* Header Top Row */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    position: relative;
    z-index: 2;
}
.logout-form { margin: 0; }
.logout-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}
.logout-btn:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}
.bug-report-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}
.bug-report-btn:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}
.bug-report-desc {
    color: #8B6F5E;
    font-size: 13px;
    margin-bottom: 12px;
}
