/* Don! app.css — v1.1.0 (1단계)
 * v1.0.14 디자인을 그대로 유지하고, 끝부분에 1단계 추가 스타일을 붙였다. */
@font-face {
    font-family: 'Pretendard';
    src: url('../vendor/fonts/PretendardVariable.woff2') format('woff2-variations');
    font-weight: 45 920; font-style: normal; font-display: swap;
}

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Pretendard', -apple-system, 'Noto Sans KR', sans-serif;
        }

        body {
            background-color: #121212;
            color: #ffffff;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            height: 100dvh;
            transition: background-color 0.3s, color 0.3s;
        }

        .app-container {
            width: 100%;
            height: 100%;
            background-color: #121212;
            display: flex;
            flex-direction: column;
            position: relative;
            overflow: hidden;
            transition: background-color 0.3s;
        }

        @media (min-width: 768px) {
            .app-container {
                max-width: 480px;
                height: 90vh;
                border-radius: 24px;
                box-shadow: 0 10px 30px rgba(0,0,0,0.5);
                border: 1px solid #2a2a30;
            }
        }

        .auth-screen {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 24px;
            background-color: #121212;
        }

        .auth-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 24px;
            text-align: center;
        }

        .auth-btn-row {
            display: flex;
            gap: 10px;
            margin-top: 10px;
        }

        .auth-btn {
            flex: 1;
            border: none;
            border-radius: 10px;
            padding: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }

        .app-bar {
            padding: 24px 20px 16px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 20px;
            font-weight: 700;
            background-color: #121212;
            display: none;
        }

        .content-area {
            flex: 1;
            overflow-y: auto;
            padding: 0 20px 20px 20px;
            display: none;
        }

        .content-area.active {
            display: block;
        }

        .card {
            background-color: #1E1E22;
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 12px;
            transition: background-color 0.3s, color 0.3s;
        }

        .card-title {
            color: #8c8c94;
            font-size: 13px;
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .card-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .main-price {
            font-size: 26px;
            font-weight: 700;
        }

        .highlight-text {
            color: #3182F6;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }

        .clickable-card {
            cursor: pointer;
            transition: background-color 0.2s;
        }
        .clickable-card:hover {
            background-color: #25252b;
        }

        .next-payment-card {
            background: linear-gradient(135deg, #1E1E22 0%, #1a2639 100%);
            border: 1px solid #283852;
        }
        .coupon-banner-card {
            background-color: #2c1a1a;
            border: 1px solid #4a2222;
        }

        .progress-bg {
            background-color: #2a2a30;
            height: 10px;
            border-radius: 5px;
            overflow: hidden;
            margin-top: 10px;
            display: flex;
        }
        .progress-bar-paid {
            background-color: #3182F6;
            height: 100%;
            transition: width 0.5s ease;
        }
        .progress-bar-upcoming {
            background-color: #63b3ed;
            height: 100%;
            transition: width 0.5s ease;
            opacity: 0.7;
        }

        .category-bar-container {
            display: flex;
            height: 12px;
            border-radius: 6px;
            overflow: hidden;
            margin-top: 10px;
            gap: 2px;
            background-color: #2a2a30;
        }
        .cat-segment {
            height: 100%;
            transition: width 0.3s ease;
        }
        .cat-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-top: 12px;
            font-size: 12px;
        }
        .legend-item {
            display: flex;
            align-items: center;
            gap: 5px;
            color: #aaa;
        }
        .legend-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }

        .quick-grid {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 8px;
            margin-top: 10px;
        }

        .quick-btn {
            background-color: #25252b;
            border: 1px solid #33333b;
            border-radius: 12px;
            padding: 10px 4px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            transition: transform 0.15s, background-color 0.15s;
        }
        .quick-btn:hover {
            background-color: #2e2e36;
            transform: translateY(-2px);
        }
        .quick-btn i { font-size: 20px; }
        .quick-btn span {
            font-size: 11px;
            color: #ccc;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

        .list-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 0;
            border-bottom: 1px solid #2a2a30;
        }
        .list-item:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .item-right { text-align: right; }
        .item-date { color: #8c8c94; font-size: 12px; margin-top: 2px; }

        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            margin-bottom: 16px;
            font-weight: 700;
            font-size: 16px;
        }
        .calendar-header .month-nav { display: flex; align-items: center; gap: 12px; }

        .weekdays {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            text-align: center;
            font-size: 13px;
            color: #8c8c94;
            margin-bottom: 8px;
        }

        .days-grid {
            display: grid;
            grid-template-columns: repeat(7, minmax(0, 1fr));
            gap: 5px;
            text-align: center;
        }
        .day-empty { min-height: 76px; }
        .day-cell {
            min-width: 0;
            min-height: 76px;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            gap: 3px;
            border-radius: 9px;
            padding: 5px 2px;
            font-size: 12px;
            cursor: pointer;
            background-color: #25252b;
            position: relative;
            overflow: hidden;
        }
        .day-cell.selected { outline: 1px solid #3182F6; background-color: #1d3556; }
        .day-number { font-size: 13px; font-weight: 600; }
        .day-payment { width: 100%; font-size: 9px; line-height: 1.2; color: #63b3ed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .day-payment-name { width: 100%; font-size: 9px; line-height: 1.2; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

        .list-item.paused { opacity: 0.5; }
        .paused-badge {
            background: rgba(237,137,54,0.15); color: #ed8936; font-size: 10px;
            padding: 2px 6px; border-radius: 4px; font-weight: 600; margin-left: 6px;
        }

        .switch {
            position: relative; display: inline-block; width: 50px; height: 28px;
        }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider {
            position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
            background-color: #33333b; transition: .3s; border-radius: 28px;
        }
        .slider:before {
            position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px;
            background-color: white; transition: .3s; border-radius: 50%;
        }
        input:checked + .slider { background-color: #3182F6; }
        input:checked + .slider:before { transform: translateX(22px); }

        .modal-overlay {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background-color: rgba(0, 0, 0, 0.75); display: flex;
            justify-content: center; align-items: center; z-index: 100; display: none;
        }
        .modal-card {
            background-color: #25252b; width: 88%; max-width: 360px;
            border-radius: 20px; padding: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
            max-height: 85vh; overflow-y: auto;
        }
        .modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; text-align: center; }
        .form-group { margin-bottom: 12px; text-align: left; }
        .form-label { display: block; font-size: 12px; color: #8c8c94; margin-bottom: 4px; }
        .form-input {
            width: 100%; background-color: #1e1e22; border: 1px solid #33333b;
            border-radius: 10px; padding: 10px 12px; color: white; font-size: 13px; outline: none;
        }
        .form-input:focus { border-color: #3182F6; }
        .modal-btn-row { display: flex; gap: 10px; margin-top: 16px; }
        .modal-btn { flex: 1; border: none; border-radius: 12px; padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
        .btn-cancel { background-color: #33333b; color: #ccc; }
        .btn-submit { background-color: #3182F6; color: white; }

        .bank-item {
            background-color: #1e1e22; border: 1px solid #33333b; border-radius: 12px;
            padding: 12px; margin-bottom: 10px; transition: border-color 0.2s;
        }
        .bank-item:hover { border-color: #3182F6; }

        .nav-bar {
            height: 70px; background-color: #121212; display: flex;
            justify-content: space-around; align-items: center; border-top: 1px solid #2a2a30;
            transition: background-color 0.3s; display: none;
        }
        .nav-item {
            background: none; border: none; color: #8c8c94; display: flex;
            flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font-size: 11px;
        }
        .nav-item i { font-size: 20px; }
        .nav-item.active { color: #ffffff; }

        .setting-section-title { font-size: 13px; font-weight: 700; color: #3182F6; margin: 16px 0 8px 4px; }
        .setting-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 0; border-bottom: 1px solid #2a2a30; font-size: 14px;
        }
        .setting-row:last-child { border-bottom: none; padding-bottom: 0; }
        .setting-sub-text { font-size: 11px; color: #8c8c94; margin-top: 2px; }
        .setting-select {
            background-color: #121212; color: white; border: 1px solid #33333b;
            border-radius: 8px; padding: 6px 10px; font-size: 13px; outline: none;
        }
        .setting-btn {
            background-color: #2c2c35; color: #fff; border: none;
            padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
        }
        .setting-btn:hover { background-color: #383844; }

        body.light-mode { background-color: #f4f5f7; color: #111111; }
        body.light-mode .app-container { background-color: #f4f5f7; border-color: #d1d5db; }
        body.light-mode .app-bar, body.light-mode .auth-screen { background-color: #f4f5f7; color: #111111; }
        body.light-mode .card { background-color: #ffffff; color: #111111; border: 1px solid #e5e7eb; }
        body.light-mode .card-title, body.light-mode .item-date, body.light-mode .setting-sub-text { color: #6b7280; }
        body.light-mode .list-item, body.light-mode .setting-row { border-bottom-color: #e5e7eb; }
        body.light-mode .nav-bar { background-color: #ffffff; border-top-color: #e5e7eb; }
        body.light-mode .nav-item { color: #9ca3af; }
        body.light-mode .nav-item.active { color: #111111; }
        body.light-mode .day-cell { background-color: #f3f4f6; color: #111111; }
        body.light-mode .day-payment-name { color: #374151; }
        body.light-mode .day-cell.selected { background-color: #dbeafe; }
        body.light-mode .day-payment { color: #1d4ed8; }
        body.light-mode .modal-card { background-color: #ffffff; color: #111111; }
        body.light-mode .form-input, body.light-mode .setting-select { background-color: #f9fafb; color: #111111; border-color: #d1d5db; }
        body.light-mode .btn-cancel, body.light-mode .setting-btn { background-color: #e5e7eb; color: #374151; }
    
/* ===================== 1단계 추가 스타일 ===================== */
.app-container { padding-top: env(safe-area-inset-top); }
.nav-bar { padding-bottom: env(safe-area-inset-bottom); height: calc(70px + env(safe-area-inset-bottom)); }
.modal-overlay.open { display: flex; }
.hidden { display: none !important; }
.muted { color: #8c8c94; }
.small { font-size: 11px; }
.empty { color: #8c8c94; font-size: 13px; text-align: center; padding: 16px 0; }
.err { color: #f56565; font-size: 12px; min-height: 16px; margin-top: 6px; }
.form-row { display: flex; gap: 8px; }
.form-row > .form-group { flex: 1; min-width: 0; }
.form-hint { font-size: 11px; color: #8c8c94; margin-top: 4px; }
.btn-sm {
    background: none; border: 1px solid #3182F6; color: #3182F6; border-radius: 6px;
    padding: 3px 8px; font-size: 11px; cursor: pointer; font-weight: 600;
}
.btn-sm.danger { border-color: #7f3434; color: #f56565; }
.btn-sm.solid { background: #3182F6; color: #fff; }
.btn-sm.solid.danger { background: #e53e3e; border-color: #e53e3e; color: #fff; }
.btn-google {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 10px;
    padding: 10px; font-size: 14px; font-weight: 600; cursor: not-allowed; opacity: .55; margin-bottom: 14px;
}
.divider { display: flex; align-items: center; gap: 10px; color: #8c8c94; font-size: 12px; margin: 4px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #2a2a30; }
.badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.badge.today { background: rgba(229,62,62,.15); color: #f56565; }
.badge.soon { background: rgba(237,137,54,.15); color: #ed8936; }
.badge.later { background: rgba(49,130,246,.15); color: #3182F6; }
.badge.trial { background: rgba(16,163,127,.15); color: #10a37f; }
.badge.usd { background: rgba(160,174,192,.15); color: #a0aec0; }
.day-cell.holiday .day-number, .day-cell.sunday .day-number { color: #f56565; }
.day-cell.saturday .day-number { color: #63b3ed; }
.day-cell.today { box-shadow: inset 0 0 0 1px #63b3ed; }
.day-shift { font-size: 9px; color: #ed8936; }
.csv-drop {
    display: block;
    border: 1.5px dashed #33333b; border-radius: 12px; padding: 18px; text-align: center;
    font-size: 13px; color: #8c8c94; cursor: pointer;
}
.csv-drop:hover { border-color: #3182F6; color: #ccc; }
.cand { background:#1e1e22; border:1px solid #33333b; border-radius:12px; padding:12px; margin-bottom:8px; }
.cand.added { opacity: .5; }
.toast {
    position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
    background: #33333b; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
    opacity: 0; pointer-events: none; transition: all .25s; z-index: 300; max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.confirm-text { font-size: 14px; line-height: 1.5; text-align: center; color: #ccc; white-space: pre-line; }
.budget-click { cursor: pointer; text-decoration: underline dotted; }
.coupon-dday { font-size: 12px; color: #f56565; }
.coupon-dday.ok { color: #8c8c94; }

body.light-mode .muted, body.light-mode .empty, body.light-mode .form-hint { color: #6b7280; }
body.light-mode .modal-card .form-input { color: #111; }
body.light-mode .cand, body.light-mode .csv-drop { background: #f9fafb; border-color: #d1d5db; }
body.light-mode .toast { background: #111827; }
body.light-mode .divider::before, body.light-mode .divider::after { background: #e5e7eb; }
body.light-mode .quick-btn { background: #f3f4f6; border-color: #e5e7eb; }
body.light-mode .quick-btn span { color: #374151; }
body.light-mode .next-payment-card { background: linear-gradient(135deg,#ffffff 0%,#eaf2ff 100%); border-color:#c7dcfb; }
body.light-mode .coupon-banner-card { background: #fff5f5; border-color: #fed7d7; }
body.light-mode .progress-bg, body.light-mode .category-bar-container { background: #e5e7eb; }
body.light-mode .bank-item { background: #f9fafb; border-color: #d1d5db; }
body.light-mode .sim-box { background: #f9fafb !important; border-color: #d1d5db !important; }
body.light-mode .app-bar .btn-ghost { background: #e5e7eb !important; color: #374151 !important; }
body.light-mode #budget-warning { background: #fff5f5 !important; border-color: #fc8181 !important; }
body.light-mode #budget-warning-text { color: #742a2a !important; }

/* ===================== 2단계 추가 스타일 ===================== */
.google-btn-slot { display: flex; justify-content: center; min-height: 0; margin-bottom: 14px; }
.google-btn-slot:empty { margin-bottom: 0; }
.link-btn { display: block; margin: 14px auto 0; background: none; border: none; color: #8c8c94; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px; }
.agree-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #ccc; margin: 4px 0 6px; cursor: pointer; line-height: 1.4; }
.agree-row input { margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; accent-color: #3182F6; }
.agree-row a { color: #3182F6; }
.server-note { margin-top: 18px; font-size: 11px; color: #6b6b73; text-align: center; overflow-wrap: anywhere; }
.sync-dot { background: none; border: none; padding: 4px; cursor: pointer; font-size: 13px; color: #4a8f6b; line-height: 1; }
.sync-dot.syncing { color: #63b3ed; animation: don-pulse 1s ease-in-out infinite; }
.sync-dot.pending { color: #ed8936; }
.sync-dot.offline, .sync-dot.error { color: #f56565; }
.sync-dot.offline i::before { content: "\f0c2"; }
@keyframes don-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sync-dot.syncing { animation: none; } }
.mig-item { background: #1e1e22; border: 1px solid #33333b; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }
.btn-submit:disabled, .modal-btn:disabled { opacity: .55; cursor: wait; }
body.light-mode .agree-row { color: #374151; }
body.light-mode .mig-item { background: #f9fafb; border-color: #d1d5db; }
body.light-mode .server-note { color: #9ca3af; }
.auth-screen { overflow-y: auto; }
