/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Global */
:root {
    --primary: #111111;
    --accent: #2f6fed;
    --accent-soft: #eef3ff;
    --success: #10b981;
    --success-soft: #ecfdf5;
    --warning: #f59e0b;
    --danger: #ef4444;
    --secondary: #5f5f5f;
    --bg: #f7f7f7;
    --card: #ffffff;
    --border: #e5e5e5;
    --shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    background-color: #ffffff;
    transition: background-color 0.25s ease;
}

body {
    font-family: 'Google Sans';
    background: linear-gradient(160deg, #ffffff 0%, #f5f5f5 60%, #efefef 100%);
    margin: 0;
    padding: 24px;
    color: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    touch-action: manipulation;
}

button {
    touch-action: manipulation;
}

/* App Container */
.app-container {
    max-width: 900px;
    width: 100%;
    background: var(--card);
    padding: 36px;
    border-radius: 26px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* Page Wrapper - sidebar + main */
.page-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    max-width: 1260px;
    width: 100%;
}

/* Calculator Sidebar */
.calc-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 24px;
}

.calc-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.calc-sidebar-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calc-sidebar-icon svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.calc-display {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.calc-display-top {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--secondary);
    text-align: right;
    min-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calc-display-bottom {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-calc-copy {
    align-self: flex-end;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--secondary);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
}

.btn-calc-copy:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #bfdbfe;
}

.btn-calc-copy.copied {
    background: var(--success-soft);
    color: var(--success);
    border-color: #a7f3d0;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.calc-btn {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.calc-btn:hover {
    background: #f5f5f5;
}

.calc-btn:active {
    background: #eee;
    transform: scale(0.96);
}

.calc-fn {
    background: #f5f5f5;
    color: var(--secondary);
    border-color: #e0e0e0;
}

.calc-fn:hover {
    background: #eee;
}

.calc-op {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #bfdbfe;
}

.calc-op:hover {
    background: #dbeafe;
    border-color: var(--accent);
}

.calc-eq {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.calc-eq:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.calc-zero {
    grid-column: span 2;
}

/* Calculator Toggle Button (mobile only) */
.calc-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    color: var(--primary);
    transition: all 0.2s ease;
}

.calc-toggle:hover {
    background: #f5f5f5;
}

.calc-toggle svg {
    width: 24px;
    height: 24px;
}

/* Calculator Overlay (mobile) */
.calc-overlay {
    display: none; 
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 998;
    visibility: hidden;
    transition: background-color 0.25s ease, backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease, visibility 0.25s;
}

.calc-overlay.active {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    visibility: visible;
}

/* Main Panel (Right) */
.main-panel {
    min-width: 0;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.header-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.header-text .kicker {
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 2px;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary);
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #e1e1e1;
    border-radius: 14px;
    background: #fafafa;
}

.form-group .title {
    font-weight: 600;
    display: block;
    margin-bottom: 12px;
    color: #202020;
    font-size: 1.05em;
}

.step-dot-1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    line-height: 1;
    border-radius: 50%;
    background: #2f6fed;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 8px;
    vertical-align: middle;
}

.step-dot-2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    line-height: 1;
    border-radius: 50%;
    background: #2f6fed;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 8px;
    vertical-align: middle;
}

/* Rate Input Row */
.rate-input-row {
    display: flex;
    gap: 8px;
}

.rate-input-row input {
    flex: 1;
}

.btn-fetch-rate {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-fetch-rate:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-fetch-rate.loading {
    animation: spin 1s linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rate-source-hint {
    font-size: 0.72rem;
    color: var(--success);
    margin-top: 4px;
    min-height: 16px;
}

/* Custom Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-message {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all 0.15s ease;
}

.modal-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.modal-btn-cancel:hover {
    background: #e5e7eb;
}

.modal-btn-confirm {
    background: var(--accent);
    color: #fff;
}

.modal-btn-confirm:hover {
    background: #1d4ed8;
}

/* Target currency select in rate row */
.rate-input-row select {
    width: 105px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0 8px;
    background: #f5f5f5;
    color: var(--primary);
    cursor: pointer;
    text-transform: uppercase;
    flex-shrink: 0;
}

.rate-input-row select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Rate Row */
.rate-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.amount-with-currency {
    display: flex;
    gap: 8px;
}

.amount-with-currency input {
    flex: 1;
}

.amount-with-currency select {
    width: 90px;
    flex-shrink: 0;
}

/* Conversion Section */
.conversion-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.conversion-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

.conversion-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.conversion-hint {
    font-size: 0.8rem;
    color: #aaa;
}

.conversion-result {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--accent-soft);
    border: 1px solid #bfdbfe;
    flex-wrap: wrap;
}

.conversion-result .result-flag {
    font-size: 1.4rem;
}

.conversion-result .result-label {
    font-size: 0.9rem;
    color: var(--secondary);
}

.conversion-result .result-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-left: auto;
}

.btn-copy-result {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-copy-result:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #bfdbfe;
}

.btn-copy-result.copied {
    background: var(--success-soft);
    color: var(--success);
    border-color: #a7f3d0;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
}

.input-group input,
.input-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
}

.input-group select {
    cursor: pointer;
}

.hint {
    font-size: 0.78em;
    color: #7f8c8d;
    margin: 8px 0 0 0;
}

/* Add Card Form */
.add-card-form {
    background: #f7f7f7;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.add-card-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.add-card-row .input-group {
    min-width: 0;
}

.add-card-row .flex-2 input {
    text-transform: uppercase;
}

.add-card-row .flex-2 {
    min-width: 0;
}

.add-card-row .flex-1 {
    min-width: 0;
}

.btn-add-card {
    padding: 0 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    height: 42px;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-add-card:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-add-card:active {
    transform: translateY(0);
}

/* Card List */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    color: #999;
    font-size: 0.9rem;
}

.card-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    transition: all 0.2s ease;
}

.card-item .card-item-details {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.card-item:hover {
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-item .card-network-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    flex-shrink: 0;
}

.card-network-badge.visa {
    background: #eff6ff;
    color: #1d4ed8;
}

.card-network-badge.mastercard {
    background: #fef3c7;
    color: #92400e;
}

.card-network-badge.jcb {
    background: #fce7f3;
    color: #9d174d;
}

.card-network-badge.unionpay {
    background: #fef9c3;
    color: #854d0e;
}

.card-item .card-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    text-transform: uppercase;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-item .card-item-fee {
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    line-height: 1.4;
}

.card-item .card-item-fee.zero {
    color: #047857;
    background: #d1fae5;
}

.card-item .card-item-fee.low {
    color: #92400e;
    background: #fef3c7;
}

.card-item .card-item-fee.high {
    color: #991b1b;
    background: #fee2e2;
}

.card-item .card-item-cashback {
    font-size: 0.7rem;
    font-weight: 600;
    color: #047857;
    background: #d1fae5;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    line-height: 1.4;
    flex-shrink: 0;
    text-transform: uppercase;
}

.card-item .card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.card-item .btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    color: #888;
}

.card-item .btn-icon:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #444;
}

.card-item .btn-icon.btn-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: var(--danger);
}

.card-item .btn-icon svg {
    width: 14px;
    height: 14px;
}

/* Calculate Button */
.btn-calculate {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
    margin-top: 16px;
}

.btn-calculate:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.btn-calculate:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
    animation: fadeIn 0.3s ease-in-out;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.results-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.section-dot-green {
    color: #22a447;
    margin-right: 6px;
}

.results-summary {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
}

/* Best Deal Banner */
.best-deal {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.best-deal .trophy {
    width: 44px;
    height: 44px;
    background: #10b981;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
}

.best-deal .deal-info {
    flex: 1;
}

.best-deal .deal-label {
    font-size: 0.8rem;
    color: #047857;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.best-deal .deal-card {
    font-size: 1.1rem;
    font-weight: 700;
    color: #065f46;
    text-transform: uppercase;
    margin: 2px 0;
}

.best-deal .deal-amount {
    font-size: 0.9rem;
    color: #047857;
}

.best-deal .deal-savings {
    text-align: right;
}

.best-deal .savings-label {
    font-size: 0.75rem;
    color: #047857;
    font-weight: 500;
}

.best-deal .savings-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #059669;
}

/* Comparison Table */
.comparison-table {
    display: grid;
    gap: 8px;
}

.result-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    transition: all 0.2s ease;
}

.result-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #ccc;
}

.result-row.best {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.result-row.worst {
    background: #fef2f2;
    border-color: #fecaca;
}

.result-row-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.result-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--primary);
    text-transform: uppercase;
}

.result-network {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    font-weight: 600;
    width: fit-content;
    margin-top: 2px;
}

.result-network.visa {
    background: #eff6ff;
    color: #1d4ed8;
}

.result-network.mastercard {
    background: #fef3c7;
    color: #92400e;
}

.result-network.jcb {
    background: #fce7f3;
    color: #9d174d;
}

.result-network.unionpay {
    background: #fef9c3;
    color: #854d0e;
}

.result-fee {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.result-fee.zero {
    color: var(--success);
}

.result-fee.low {
    color: var(--warning);
}

.result-fee.high {
    color: var(--danger);
}

.result-cashback {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--success);
    text-transform: uppercase;
}

.result-total {
    text-align: right;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.result-row.best .result-total {
    color: #059669;
}

.result-diff {
    text-align: right;
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
}

.result-diff.positive {
    color: var(--danger);
}

.result-diff.negative {
    color: var(--success);
}

.result-diff.neutral {
    color: var(--secondary);
}

/* Savings Section */
.savings-section {
    margin-top: 20px;
    padding: 16px;
    border-radius: 14px;
    background: #f7f7f7;
    border: 1px solid var(--border);
}

.savings-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--primary);
}

.savings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.savings-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid var(--border);
}

.savings-card .label {
    font-size: 0.78rem;
    color: var(--secondary);
    font-weight: 500;
}

.savings-card .value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

.savings-card .value.green {
    color: var(--success);
}

/* Footer Info */
.footer-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    text-align: center;
}

.footer-info p {
    font-size: 0.75rem;
    color: #999;
    margin: 4px 0;
}

/* UI Icon */
.ui-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .page-wrapper {
        flex-direction: column;
    }

    .calc-sidebar {
        visibility: hidden;
        opacity: 0;
        width: 92%;
        position: fixed;
        top: 50%;
        left: 50%;
        bottom: auto;
        transform: translate(-50%, -50%) scale(0.9);
        max-width: 360px;
        z-index: 999;
        box-shadow: 0 12px 40px rgba(0,0,0,0.2);
        transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.25s;
    }

    .calc-btn {
        height: 52px;
        font-size: 1.15rem;
    }

    .calc-sidebar.active {
        visibility: visible;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .calc-toggle {
        display: flex;
    }

    .calc-overlay {
        display: block;
    }
}

@media (max-width: 700px) {
    html {
        font-size: 15px;
    }

    body {
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }

    .app-container {
        padding: 16px;
        border-radius: 18px;
    }

    .rate-row {
        grid-template-columns: 1fr;
    }

    .add-card-row {
        grid-template-columns: 1fr;
    }

    .add-card-row .flex-2,
    .add-card-row .flex-1 {
        min-width: 0;
    }

    .btn-add-card {
        width: 100%;
    }

    .result-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .result-row-header {
        display: none;
    }

    .result-fee,
    .result-total,
    .result-diff {
        text-align: left;
    }

    .result-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .best-deal {
        flex-direction: column;
        text-align: center;
    }

    .best-deal .deal-savings {
        text-align: center;
    }
}

/* Quick FX Fee Section */
.quick-fx-fee-section {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fdfdfd;
    border: 1px solid var(--border);
}

.quick-fx-label {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.quick-fx-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-fx-row input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.quick-fx-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.quick-fx-result {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-left: auto;
}

