/* ── Fee Calculator ── */
#fee-calculator-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    max-width: 680px;
    margin: 0 auto 40px;
    padding: 0 16px;
    color: #1a1a2e;
}

/* Header */
.fee-calc-header { text-align: center; margin-bottom: 32px; }
.fee-calc-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.fee-calc-subtitle { color: #666; margin: 0; font-size: .95rem; }

/* Input Section */
.fee-calc-input-section {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: #f8f9ff;
    border: 2px solid #e8ecff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}
.fee-calc-input-group { flex: 1; }
.fee-calc-input-group label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: #444;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.fee-calc-input-row { display: flex; align-items: center; gap: 8px; }
.fee-calc-usage-input {
    flex: 1;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 12px 16px;
    border: 2px solid #c5cae9;
    border-radius: 10px;
    outline: none;
    transition: border-color .2s;
    background: #fff;
    color: #1a1a2e;
    width: 100%;
    box-sizing: border-box;
}
.fee-calc-usage-input:focus { border-color: #1a73e8; }
.fee-calc-unit {
    font-size: 1rem;
    font-weight: 700;
    color: #1a73e8;
    white-space: nowrap;
    min-width: 36px;
}

/* Buttons */
.fee-calc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform .15s, box-shadow .15s;
}
.fee-calc-btn:active { transform: scale(.97); }

.fee-calc-btn-primary {
    background: linear-gradient(135deg, #1a73e8, #1557b0);
    color: #fff;
    box-shadow: 0 4px 14px rgba(26,115,232,.35);
    white-space: nowrap;
    padding: 14px 26px;
    font-size: 1rem;
}
.fee-calc-btn-primary:hover { box-shadow: 0 6px 20px rgba(26,115,232,.45); }

/* Loading */
.fee-calc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: #666;
}
.fee-calc-spinner {
    width: 24px; height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
.fee-calc-result {
    background: #fff;
    border: 2px solid #e8ecff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(26,115,232,.1);
    animation: slideUp .3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fee-calc-tier-badge {
    text-align: center;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .05em;
}
.tier-normal { background: linear-gradient(135deg, #43a047, #2e7d32); }
.tier-tier1  { background: linear-gradient(135deg, #1e88e5, #1565c0); }
.tier-tier2  { background: linear-gradient(135deg, #fb8c00, #e65100); }
.tier-tier3  { background: linear-gradient(135deg, #e53935, #b71c1c); }

/* Breakdown */
.fee-calc-breakdown {
    background: #f8f9ff;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}
.fee-calc-breakdown h3 { margin: 0 0 12px; font-size: .9rem; color: #666; text-transform: uppercase; letter-spacing: .06em; }
.fee-calc-breakdown-list { display: flex; flex-direction: column; gap: 6px; }
.breakdown-item {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    padding: 6px 10px;
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid #1a73e8;
}
.breakdown-item span:last-child { font-weight: 700; color: #1a73e8; }

/* Summary */
.fee-calc-summary { padding: 20px 24px; }
.fee-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: .95rem;
}
.fee-calc-row:last-child { border-bottom: none; }
.fee-calc-row-sub { color: #555; font-style: italic; }
.fee-calc-row span:last-child { font-weight: 600; }
.fee-calc-row-total {
    margin-top: 6px;
    padding-top: 16px;
    border-top: 2px solid #1a73e8 !important;
    border-bottom: none;
    font-size: 1.15rem;
    font-weight: 800;
}
.fee-calc-row-total span:last-child {
    color: #1a73e8;
    font-size: 1.4rem;
}

/* Actions */
.fee-calc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 24px;
    background: #f8f9ff;
    border-top: 1px solid #eee;
}
.fee-calc-btn-export { background: #e8f5e9; color: #2e7d32; }
.fee-calc-btn-export:hover { background: #c8e6c9; }
.fee-calc-btn-pdf    { background: #fce4ec; color: #c62828; }
.fee-calc-btn-pdf:hover { background: #f8bbd9; }
.fee-calc-btn-save   { background: #e3f2fd; color: #1565c0; }
.fee-calc-btn-save:hover { background: #bbdefb; }

/* Error */
.fee-calc-error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
    padding: 14px 18px;
    border-radius: 10px;
    margin-top: 16px;
    font-weight: 600;
}

/* Info Table */
.fee-calc-info-table {
    margin-top: 32px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #e8ecff;
}
.fee-calc-info-table h3 {
    margin: 0;
    padding: 16px 20px;
    background: #f8f9ff;
    font-size: 1rem;
    border-bottom: 1px solid #e8ecff;
}
.fee-calc-info-table table { width: 100%; border-collapse: collapse; }
.fee-calc-info-table th, .fee-calc-info-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: .9rem;
}
.fee-calc-info-table th { background: #fff; font-weight: 700; color: #444; }
.tier-chip {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
}
.tier1 { background: #1e88e5; }
.tier2 { background: #fb8c00; }
.tier3 { background: #e53935; }

/* Print styles */
@media print {
    .fee-calc-actions,
    .fee-calc-input-section,
    .fee-calc-header,
    .fee-calc-info-table { display: none !important; }
    .fee-calc-result {
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .fee-calc-input-section { flex-direction: column; }
    .fee-calc-btn-primary { width: 100%; justify-content: center; }
    .fee-calc-actions { flex-direction: column; }
    .fee-calc-actions .fee-calc-btn { justify-content: center; }
}
