.exchange-page {
    min-height: calc(100vh - 72px);
    background:
            radial-gradient(circle at 12% 8%, rgba(125, 211, 252, 0.26), transparent 30%),
            radial-gradient(circle at 88% 12%, rgba(191, 219, 254, 0.7), transparent 34%),
            linear-gradient(180deg, #ffffff 0%, #f3f9ff 48%, #f8fbff 100%);
    color: #111827;
}

.exchange-page .container {
    max-width: 1180px;
}

/* =========================
   Exchange Main Page
========================= */

.exchange-hero-section {
    position: relative;
    overflow: hidden;
    padding: 64px 0 72px;
    background:
            radial-gradient(circle at 12% 8%, rgba(125, 211, 252, 0.26), transparent 30%),
            radial-gradient(circle at 88% 12%, rgba(191, 219, 254, 0.7), transparent 34%),
            linear-gradient(180deg, #ffffff 0%, #f3f9ff 48%, #f8fbff 100%);
    color: #111827;
}

.exchange-hero-section .tm-eyebrow {
    color: #2563eb;
}

.exchange-page-title {
    margin: 10px 0 16px;
    color: #0f172a;
    font-size: clamp(38px, 4.2vw, 56px);
    line-height: 1.08;
    letter-spacing: -0.07em;
    font-weight: 900;
    word-break: keep-all;
}

.exchange-page-description {
    max-width: 680px;
    margin: 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 700;
}

.exchange-content-section {
    padding: 26px 0 88px;
    background: #ffffff;
}

.exchange-converter-card,
.exchange-panel {
    margin-bottom: 28px;
    padding: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 26px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.06);
}

.hero-converter-card {
    margin-bottom: 0;
    padding: 28px;
    border-color: #dbeafe;
    border-radius: 28px;
    background:
            radial-gradient(circle at 100% 0%, rgba(219, 234, 254, 0.42), transparent 34%),
            #ffffff;
    box-shadow: 0 24px 58px rgba(37, 99, 235, 0.12);
}

.exchange-card-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.hero-converter-card .exchange-card-header {
    margin-bottom: 18px;
}

.exchange-card-header h2 {
    margin: 8px 0 8px;
    color: #111827;
    font-size: 25px;
    letter-spacing: -0.04em;
    font-weight: 900;
}

.hero-converter-card .exchange-card-header h2 {
    font-size: 28px;
}

.exchange-card-header p:last-child,
#rateInfoText {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.hero-converter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.hero-swap-wrap {
    display: flex;
    justify-content: center;
    margin: -2px 0;
}

.exchange-form-label {
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.currency-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    min-height: 62px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
}

.hero-converter-card .currency-box {
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) 136px;
    border-color: #dbeafe;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.05);
}

.currency-input {
    width: 100%;
    min-width: 0;
    padding: 0 18px;
    border: 0;
    outline: none;
    background: #ffffff;
    color: #111827;
    font-size: 24px;
    font-weight: 900;
}

.hero-converter-card .currency-input {
    font-size: 24px;
}

.currency-input::placeholder {
    color: #cbd5e1;
}

.currency-select {
    padding: 0 14px;
    border: 0;
    border-left: 1px solid #e5e7eb;
    outline: none;
    background: #f8fafc;
    color: #111827;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.hero-converter-card .currency-select {
    background: #f8fbff;
}

.swap-btn {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.hero-swap-wrap .swap-btn {
    width: 46px;
    height: 46px;
    font-size: 22px;
}

.swap-btn:hover {
    background: #1d4ed8;
}

.rate-list-section {
    margin-top: 0;
}

.rate-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 16px;
}

.rate-list-header h2 {
    margin: 8px 0;
    color: #111827;
    font-size: 30px;
    letter-spacing: -0.04em;
    font-weight: 900;
}

#rateSummary {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.rate-filter-area {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    padding-top: 4px;
}

.region-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.region-filter-btn {
    height: 34px;
    padding: 0 13px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.region-filter-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.region-filter-btn.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.rate-search-box {
    width: 340px;
    max-width: 100%;
}

.rate-search-input {
    width: 100%;
    height: 42px;
    padding: 0 17px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    outline: none;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.rate-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.rate-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(219, 234, 254, 0.58), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.075);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.rate-card:hover {
    transform: translateY(-3px);
    border-color: #bfdbfe;
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.11);
}

.rate-card-good {
    border-color: #93c5fd;
}

.rate-card-normal {
    border-color: #dbeafe;
}

.rate-card-bad {
    border-color: #fed7aa;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 237, 213, 0.45), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #fffefd 100%);
}

.rate-card-none {
    border-color: #e5e7eb;
}

.rate-card .card-body {
    padding: 18px;
}

.rate-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.rate-country-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.rate-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
}

.rate-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rate-card .card-title {
    margin: 0 0 4px;
    color: #111827;
    font-size: 17px;
    font-weight: 900;
}

.currency-name {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.rate-card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    flex-shrink: 0;
}

.region-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
}

.rate-judgement-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.status-good {
    background: #eff6ff;
    color: #2563eb;
}

.status-normal {
    background: #f1f5f9;
    color: #475569;
}

.status-bad {
    background: #fff7ed;
    color: #ea580c;
}

.status-none {
    background: #f8fafc;
    color: #64748b;
}

.rate-main-value {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    background:
        linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.rate-main-value span {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.rate-main-value strong {
    display: block;
    color: #0f172a;
    font-size: 26px;
    line-height: 1.1;
    letter-spacing: -0.055em;
    font-weight: 900;
}

.rate-main-value small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
}

.rate-analysis-box {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #f8fafc;
}

.rate-analysis-box.status-good {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.rate-analysis-box.status-normal {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.rate-analysis-box.status-bad {
    border-color: #fed7aa;
    background: #fffaf5;
}

.rate-analysis-box.status-none {
    border-color: #e5e7eb;
    background: #f8fafc;
}

.rate-analysis-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rate-analysis-head strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
}

.rate-analysis-head span {
    color: #2563eb;
    font-size: 14px;
    font-weight: 900;
}

.rate-analysis-box.status-bad .rate-analysis-head span {
    color: #ea580c;
}

.rate-analysis-box p {
    max-width: 100%;
    word-break: keep-all;
    line-height: 1.55;
}

.rate-info-list {
    padding-top: 14px;
}

.rate-info-list.compact {
    padding-top: 14px;
}

.rate-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    font-size: 13px;
}

.rate-info-row span {
    color: #64748b;
}

.rate-info-row strong {
    color: #111827;
    font-weight: 800;
}

.calculated-box {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
}

.small-label {
    margin-bottom: 6px;
    color: #64748b;
    font-size: 12px;
}

.from-text {
    color: #111827;
    font-size: 13px;
    font-weight: 800;
}

.to-text {
    margin-top: 4px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
}

.history-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    margin-top: 14px;
    border: 1px solid #bfdbfe;
    border-radius: 11px;
    background: #ffffff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.history-link:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.no-rate-result {
    padding: 34px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #ffffff;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

input[type="number"] {
    -moz-appearance: textfield;
}

@media (max-width: 992px) {
    .exchange-hero-section {
        padding: 44px 0 34px;
    }

    .hero-converter-card {
        margin-top: 8px;
    }

    .currency-box,
    .hero-converter-card .currency-box {
        grid-template-columns: 1fr;
    }

    .currency-input {
        min-height: 62px;
    }

    .currency-select,
    .hero-converter-card .currency-select {
        min-height: 52px;
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }

    .rate-list-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .rate-filter-area {
        width: 100%;
        align-items: stretch;
    }

    .region-filter-buttons {
        justify-content: flex-start;
    }

    .rate-search-box {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .exchange-content-section {
        padding: 24px 0 64px;
    }

    .exchange-converter-card,
    .exchange-panel,
    .hero-converter-card {
        padding: 22px;
        border-radius: 22px;
    }

    .exchange-card-header h2,
    .hero-converter-card .exchange-card-header h2 {
        font-size: 26px;
    }

    .swap-btn {
        transform: rotate(90deg);
    }

    .rate-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .rate-card-badges {
        flex-direction: row;
        align-items: center;
    }

    .rate-main-value strong {
        font-size: 23px;
    }
}

.rate-period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.rate-period-btn {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.rate-period-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.rate-period-btn.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.rate-period-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}
.converter-result-message {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 900;
}

.converter-insight-card {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(219, 234, 254, 0.55), transparent 36%),
        #ffffff;
}

.converter-insight-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.converter-insight-head span:first-child {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.converter-insight-head strong {
    display: block;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-weight: 900;
}

.converter-insight-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.converter-insight-card p {
    margin: 12px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.65;
    font-weight: 800;
    white-space: pre-line;

}