/* ═══════════════════════════════════════════
   실시간 경비 계산기 — Light European Theme
   ═══════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #fdf6ee;
    --bg-card: #ffffff;
    --bg-warm: #f7ede0;
    --bg-section: #faf3ea;

    --gold: #c08830;
    --gold-light: #e8b860;
    --gold-dim: #a07020;
    --gold-pale: #f5e8c8;

    --text-primary: #2c1f0e;
    --text-secondary: #7a6040;
    --text-muted: #b0956a;

    --border: rgba(180, 140, 80, 0.18);
    --shadow-sm: 0 2px 12px rgba(140, 100, 40, 0.08);
    --shadow-md: 0 6px 32px rgba(140, 100, 40, 0.12);
    --shadow-lg: 0 12px 50px rgba(140, 100, 40, 0.15);

    --success: #2a8a4a;
    --warning: #d08020;
    --danger: #c03030;

    --paris-c: #6050c0;
    --swiss-c: #2870b0;
    --italy-c: #c05030;
    --flor-c: #7a9030;
    --rome-c: #b04020;
    --milan-c: #c06020;

    --font-serif: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* No starfield */
.stars {
    display: none;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 32px;
    background: rgba(253, 246, 238, 0.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 20px rgba(140, 100, 40, 0.07);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: .04em;
    padding: 7px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.back-btn:hover {
    color: var(--gold-dim);
    background: var(--gold-pale);
    border-color: rgba(192, 136, 48, .35);
}

.logo {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: .04em;
    font-weight: 600;
}

.rate-badge {
    font-size: .72rem;
    letter-spacing: .07em;
    color: var(--gold-dim);
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid rgba(192, 136, 48, .3);
    background: var(--gold-pale);
}

/* ── Page Hero ── */
.page-hero {
    text-align: center;
    padding: 60px 24px 44px;
    background: linear-gradient(180deg, #e8f4ff 0%, #f7f0e0 60%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
    font-size: .74rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold-dim);
    font-weight: 600;
    margin-bottom: 14px;
}

.page-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--gold-dim), var(--gold), #e8a830);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: .9rem;
    color: var(--text-muted);
    letter-spacing: .04em;
}

/* ── Main Layout ── */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

/* ── Card Base ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    animation: fadeUp .5s ease both;
    position: relative;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Full-width */
.rate-section,
.itinerary-section,
.expenses-section {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 12px;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    font-size: 1.1rem;
}

/* ── Exchange Rates ── */
.rates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 12px;
}

.rate-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-section);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.rate-card:hover {
    border-color: rgba(192, 136, 48, .35);
    box-shadow: var(--shadow-sm);
}

.rate-flag {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.rate-info {
    flex: 1;
    min-width: 0;
}

.rate-label {
    font-size: .7rem;
    color: var(--text-muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.rate-value {
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--gold-dim);
    line-height: 1;
    margin-bottom: 2px;
}

.rate-sub {
    font-size: .73rem;
    color: var(--text-secondary);
}

.rate-trend {
    font-size: 1.1rem;
}

.rate-timestamp {
    font-size: .7rem;
    color: var(--text-muted);
    text-align: right;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    color: var(--text-secondary);
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.refresh-btn:hover {
    color: var(--gold-dim);
    border-color: rgba(192, 136, 48, .4);
    background: var(--gold-pale);
}

.refresh-btn.spinning svg {
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Converter ── */
.converter-grid {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.converter-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conv-divider {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 0 18px;
    gap: 8px;
    color: var(--text-muted);
    font-size: .78rem;
}

.conv-divider::before,
.conv-divider::after {
    content: '';
    display: block;
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.conv-label {
    font-size: .76rem;
    color: var(--text-secondary);
    letter-spacing: .06em;
    font-weight: 500;
}

.conv-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.conv-input-wrap:focus-within {
    border-color: rgba(192, 136, 48, .5);
    box-shadow: 0 0 0 3px rgba(192, 136, 48, .08);
}

.conv-prefix {
    padding: 10px 13px;
    font-size: .76rem;
    font-weight: 600;
    color: var(--gold-dim);
    background: var(--gold-pale);
    border-right: 1px solid var(--border);
    letter-spacing: .06em;
}

.conv-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: .98rem;
    font-family: var(--font-body);
    padding: 10px 13px;
}

.conv-input::placeholder {
    color: var(--text-muted);
}

.conv-arrow {
    text-align: center;
    color: var(--gold);
    font-size: .85rem;
}

.conv-result-wrap {
    display: flex;
    align-items: center;
    background: var(--gold-pale);
    border: 1px solid rgba(192, 136, 48, .2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    gap: 10px;
}

.conv-suffix {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: .06em;
}

.conv-result {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-dim);
}

.add-expense-btn {
    padding: 8px 14px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--gold-dim);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.add-expense-btn:hover {
    background: var(--gold-pale);
    border-color: rgba(192, 136, 48, .4);
}

/* ── Budget Section ── */
.budget-setup {
    margin-bottom: 22px;
    padding: 16px 18px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.setup-label {
    display: block;
    font-size: .76rem;
    color: var(--text-secondary);
    letter-spacing: .07em;
    margin-bottom: 10px;
    font-weight: 500;
}

.budget-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.budget-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: .92rem;
    font-family: var(--font-body);
    padding: 9px 13px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.budget-input:focus {
    border-color: rgba(192, 136, 48, .5);
    box-shadow: 0 0 0 3px rgba(192, 136, 48, .08);
}

.budget-unit {
    font-size: .84rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.set-budget-btn {
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: .04em;
}

.set-budget-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(192, 136, 48, .35);
}

/* Budget Visual */
.budget-visual {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.donut-wrap {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    height: 200px;
}

.donut-wrap canvas {
    width: 200px !important;
    height: 200px !important;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.donut-label {
    font-size: .68rem;
    color: var(--text-muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.donut-amount {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold-dim);
    line-height: 1.2;
    text-align: center;
}

.donut-pct {
    font-size: .72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.budget-stats {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-total .stat-dot {
    background: rgba(192, 136, 48, .5);
}

.stat-spent .stat-dot {
    background: var(--italy-c);
}

.stat-remaining .stat-dot {
    background: var(--success);
}

.stat-label {
    font-size: .7rem;
    color: var(--text-muted);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.stat-value {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.daily-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(42, 138, 74, .06);
    border: 1px solid rgba(42, 138, 74, .2);
    margin-top: 4px;
}

.hint-icon {
    font-size: 1.2rem;
}

.hint-label {
    font-size: .68rem;
    color: var(--text-muted);
    letter-spacing: .06em;
    margin-bottom: 2px;
}

.hint-value {
    font-size: .88rem;
    color: var(--success);
    font-weight: 600;
}

/* Progress Bar */
.progress-section {
    margin-top: 4px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: .76rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-track {
    position: relative;
    height: 10px;
    background: var(--bg-section);
    border-radius: 100px;
    overflow: visible;
    border: 1px solid var(--border);
    margin-bottom: 6px;
}

.progress-fill {
    height: 8px;
    margin: 1px;
    border-radius: 100px;
    background: linear-gradient(to right, var(--success), var(--warning), var(--danger));
    background-size: 200% 100%;
    background-position: 0% 50%;
    transition: width .8s cubic-bezier(0.23, 1, 0.32, 1), background-position .5s;
    min-width: 0;
}

.progress-fill.warn {
    background-position: 60% 50%;
}

.progress-fill.danger {
    background-position: 100% 50%;
}

.progress-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(192, 136, 48, .4);
    transition: left .8s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2;
}

.marker-tooltip {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold-dim);
    color: white;
    font-size: .64rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition);
}

.progress-marker:hover .marker-tooltip {
    opacity: 1;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: .68rem;
    color: var(--text-muted);
}

/* Reset */
.reset-btn {
    font-size: .72rem;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.reset-btn:hover {
    color: var(--danger);
    border-color: rgba(192, 48, 48, .4);
    background: rgba(192, 48, 48, .06);
}

/* ── Expense Form ── */
.expense-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}

.form-group-narrow {
    flex: 0 0 130px;
    min-width: 100px;
}

.form-label {
    font-size: .74rem;
    color: var(--text-secondary);
    letter-spacing: .06em;
    font-weight: 500;
}

.form-input,
.form-select {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: .88rem;
    font-family: var(--font-body);
    padding: 9px 12px;
    outline: none;
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus {
    border-color: rgba(192, 136, 48, .5);
    box-shadow: 0 0 0 3px rgba(192, 136, 48, .08);
}

.form-select option {
    background: #fff;
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    border: none;
    color: white;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: .04em;
    margin-top: 4px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(192, 136, 48, .4);
}

/* ── Itinerary Timeline ── */
.itinerary-total {
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--bg-section);
}

.timeline {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    position: relative;
    margin-bottom: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: linear-gradient(to right,
            var(--paris-c), var(--swiss-c), var(--milan-c), var(--italy-c), var(--flor-c), var(--rome-c));
    z-index: 0;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 4px;
    position: relative;
    z-index: 1;
}

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px var(--bg-card), 0 2px 10px rgba(0, 0, 0, 0.15);
}

.paris-dot {
    background: linear-gradient(135deg, #9080e0, var(--paris-c));
}

.swiss-dot {
    background: linear-gradient(135deg, #5090d0, var(--swiss-c));
}

.milan-dot {
    background: linear-gradient(135deg, #d08040, var(--milan-c));
}

.venice-dot {
    background: linear-gradient(135deg, #e080a0, #c04060);
}

.flor-dot {
    background: linear-gradient(135deg, #90b040, var(--flor-c));
}

.rome-dot {
    background: linear-gradient(135deg, #e06040, var(--rome-c));
}

.tl-dates {
    font-size: .6rem;
    color: var(--text-muted);
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.tl-city {
    font-size: .78rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 3px;
}

.tl-nights {
    font-size: .62rem;
    color: var(--text-muted);
    background: var(--bg-section);
    border-radius: 100px;
    padding: 1px 7px;
    margin-left: 3px;
    vertical-align: middle;
}

.tl-spend {
    font-size: .68rem;
    color: var(--gold-dim);
    font-weight: 500;
}

.city-chart-wrap {
    height: 90px;
}

/* ── Expenses List ── */
.filter-row {
    display: flex;
    gap: 8px;
}

.mini-select {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: .74rem;
    padding: 5px 12px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: border-color var(--transition);
}

.mini-select:focus {
    border-color: rgba(192, 136, 48, .45);
}

.expense-list {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    gap: 8px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2.2rem;
    opacity: .5;
}

.empty-state p {
    font-size: .86rem;
}

.empty-sub {
    font-size: .74rem !important;
    opacity: .7;
}

/* Expense Item */
.expense-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-section);
    border: 1px solid var(--border);
    transition: all var(--transition);
    animation: fadeUp .3s ease both;
}

.expense-item:hover {
    background: var(--bg-warm);
    border-color: rgba(192, 136, 48, .25);
    box-shadow: var(--shadow-sm);
}

.exp-city-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.exp-info {
    flex: 1;
    min-width: 0;
}

.exp-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.exp-desc {
    font-size: .88rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exp-badge {
    font-size: .63rem;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--gold-pale);
    border: 1px solid rgba(192, 136, 48, .25);
    color: var(--gold-dim);
    white-space: nowrap;
}

.exp-meta {
    font-size: .7rem;
    color: var(--text-muted);
}

.exp-amount {
    text-align: right;
    flex-shrink: 0;
}

.exp-krw {
    font-family: 'Playfair Display', serif;
    font-size: .93rem;
    font-weight: 700;
    color: var(--gold-dim);
}

.exp-orig {
    font-size: .7rem;
    color: var(--text-muted);
}

.exp-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 50%;
    transition: all var(--transition);
    flex-shrink: 0;
}

.exp-delete:hover {
    color: var(--danger);
    background: rgba(192, 48, 48, .08);
}

.expense-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: .82rem;
    color: var(--text-secondary);
}

.expense-summary strong {
    color: var(--gold-dim);
    font-size: .98rem;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 36px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-warm);
    font-size: .78rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-note a {
    color: var(--gold-dim);
    text-decoration: none;
}

.footer-note a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════════════════
   RESPONSIVE — 750px (tablet / large phone)
══════════════════════════════════════════ */
@media (max-width: 750px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 16px 14px 60px;
        gap: 14px;
    }

    /* 환율 카드 1열 */
    .rates-grid {
        grid-template-columns: 1fr;
    }

    /* 통화 변환기 세로 */
    .converter-grid {
        flex-direction: column;
    }

    .conv-divider {
        flex-direction: row;
        padding: 6px 0;
    }

    .conv-divider::before,
    .conv-divider::after {
        width: 40px;
        height: 1px;
    }

    /* 타임라인 2열 */
    .timeline {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .timeline::before {
        display: none;
    }

    /* 예산 비주얼 세로 */
    .budget-visual {
        flex-direction: column;
        align-items: center;
        /* 도넛 중앙 정렬 */
    }

    /* 카드 헤더 wrapping */
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-title {
        font-size: 1rem;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE — 480px (small phone)
══════════════════════════════════════════ */
@media (max-width: 480px) {
    .timeline {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════
   MOBILE TOUCH / IOS OPTIMIZATIONS — 500px
══════════════════════════════════════════ */
@media (max-width: 500px) {

    /* 헤더 */
    .site-header {
        padding: 10px 14px;
    }

    .header-inner {
        gap: 6px;
    }

    .logo {
        font-size: .85rem;
    }

    .rate-badge {
        font-size: .65rem;
        padding: 4px 9px;
    }

    .back-btn {
        font-size: .75rem;
        padding: 6px 10px;
    }

    /* 히어로 */
    .page-hero {
        padding: 28px 14px 20px;
    }

    .page-title {
        font-size: clamp(1.7rem, 8vw, 2.4rem);
    }

    .page-subtitle {
        font-size: .74rem;
        line-height: 1.7;
        word-break: keep-all;
        /* 한국어 단어 중간 줄바꿈 방지 */
    }

    /* 카드 */
    .card {
        padding: 18px 14px;
    }

    /* 예산 설정 행 → 세로 스택 */
    .budget-input-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .budget-input {
        min-width: 0;
        width: 100%;
    }

    .budget-unit {
        display: none;
    }

    /* "원" 라벨 숨김 – input에 placeholder로 대체 */
    .set-budget-btn {
        width: 100%;
        min-height: 44px;
    }

    /* 도넛 차트 */
    .donut-wrap,
    .donut-wrap canvas {
        width: 150px !important;
        height: 150px !important;
    }

    .budget-stats {
        width: 100%;
        min-width: 0;
    }

    /* 통화 변환기 입력 */
    .conv-input-wrap {
        border-radius: var(--radius-sm);
    }

    /* 지출 추가 폼 — 필드 세로 */
    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-group,
    .form-group-narrow {
        flex: unset;
        width: 100%;
        min-width: 0;
    }

    /* 지출 내역 헤더 — 필터 아래 줄 */
    .card-header:has(.filter-row) {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-row {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mini-select {
        flex: 1;
        min-width: 130px;
        min-height: 40px;
        font-size: 1rem;
    }

    /* 타임라인 카드 패딩 */
    .timeline-item {
        padding: 10px;
    }

    .tl-city {
        font-size: .82rem;
    }

    .tl-dates {
        font-size: .68rem;
    }

    .tl-spend {
        font-size: .72rem;
    }

    .tl-nights {
        font-size: .6rem;
        padding: 1px 6px;
    }

    /* iOS 자동 줌 방지: font-size ≥ 16px */
    .form-input,
    .form-select,
    .budget-input,
    .conv-input {
        font-size: 1rem !important;
    }

    /* 터치 타겟 최소 44px */
    .submit-btn,
    .set-budget-btn,
    .refresh-btn,
    .reset-btn,
    .add-expense-btn {
        min-height: 44px;
    }

    /* 지출 항목 */
    .expense-item {
        padding: 10px 12px;
        font-size: .82rem;
    }

    .expense-meta {
        font-size: .7rem;
    }

    .expense-amount {
        font-size: .88rem;
    }

    /* 메인 콘텐츠 */
    .main-content {
        padding: 12px 10px 60px;
        gap: 12px;
    }

    /* '새로고침' 버튼 텍스트 숨기고 아이콘만 */
    .refresh-btn span {
        display: none;
    }

    .refresh-btn {
        padding: 8px 12px;
    }
}