html,
body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

a,
.btn-link {
    color: #175cd3;
}

.rate-dashboard {
    display: grid;
    gap: 22px;
}

.dashboard-heading {
    align-items: end;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.eyebrow {
    color: #027a48;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

h1 {
    color: #101828;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.04;
    margin: 0;
    max-width: 800px;
}

.lead {
    color: #475467;
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 16px 0 0;
    max-width: 720px;
}

.refresh-panel {
    align-items: center;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
    min-width: 300px;
    padding: 14px;
}

.history-controls {
    align-items: end;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    padding: 14px;
}

.history-controls label {
    color: #344054;
    display: grid;
    font-size: 0.86rem;
    font-weight: 800;
    gap: 6px;
}

.history-controls select {
    background: #f9fafb;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    color: #101828;
    height: 44px;
    min-width: 116px;
    padding: 0 12px;
    width: 100%;
}

.refresh-panel label {
    color: #344054;
    font-size: 0.86rem;
    font-weight: 700;
    grid-column: 1 / -1;
}

.refresh-control {
    align-items: center;
    background: #f9fafb;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    display: flex;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
}

.refresh-control input {
    background: transparent;
    border: 0;
    color: #101828;
    font-weight: 800;
    min-width: 72px;
    outline: 0;
}

.refresh-button {
    background: #175cd3;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-weight: 800;
    height: 44px;
    padding: 0 16px;
    white-space: nowrap;
}

.refresh-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.history-dashboard {
    display: grid;
    gap: 22px;
}

.p2p-dashboard {
    display: grid;
    gap: 22px;
}

.transaction-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transaction-column {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
}

.transaction-list {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.transaction-card {
    border: 1px solid #eaecf0;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.transaction-card.eligible {
    border-left: 5px solid #17b26a;
}

.transaction-card.limited {
    border-left: 5px solid #f79009;
}

.transaction-card-head {
    align-items: start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.transaction-card-head strong {
    color: #101828;
    display: block;
    font-size: 1.04rem;
}

.quality {
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 10px;
}

.quality.high {
    background: #dcfae6;
    color: #067647;
}

.quality.medium {
    background: #fef0c7;
    color: #93370d;
}

.quality.review {
    background: #fee4e2;
    color: #b42318;
}

.transaction-card dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.transaction-card dl div {
    display: grid;
    gap: 2px;
}

.transaction-card dt {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.transaction-card dd {
    color: #344054;
    margin: 0;
}

.transaction-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.ad-link {
    background: #101828;
    border-radius: 8px;
    color: #fff;
    font-weight: 800;
    padding: 9px 12px;
    text-decoration: none;
}

.ad-link:hover {
    color: #fff;
}

.p2p-notes {
    background: #101828;
    border-radius: 8px;
    color: #e5e7eb;
    display: grid;
    gap: 6px;
    padding: 18px 20px;
}

.p2p-notes strong {
    color: #fff;
}

.chart-panel {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
}

.chart-toolbar {
    align-items: center;
    border-bottom: 1px solid #eaecf0;
    display: flex;
    justify-content: space-between;
    padding: 18px 20px;
}

.chart-toolbar h2 {
    color: #101828;
    font-size: 1.1rem;
    margin: 0 0 4px;
}

.chart-toolbar p {
    color: #667085;
    margin: 0;
}

.candle-canvas {
    display: block;
    height: 440px;
    max-width: 100%;
    touch-action: pan-y;
    width: 100%;
}

.empty-state {
    color: #667085;
    padding: 44px 20px;
    text-align: center;
}

.status-row {
    color: #475467;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status {
    border-radius: 999px;
    display: inline-flex;
    font-weight: 800;
    padding: 8px 12px;
}

.status.ok {
    background: #dcfae6;
    color: #067647;
}

.status.warning,
.status.loading {
    background: #fef0c7;
    color: #93370d;
}

.status.error {
    background: #fee4e2;
    border-radius: 8px;
    color: #b42318;
}

.quote-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-panel {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    min-height: 186px;
    padding: 22px;
}

.quote-panel.buy {
    border-top: 5px solid #17b26a;
}

.quote-panel.sell {
    border-top: 5px solid #f79009;
}

.quote-panel.spread {
    border-top: 5px solid #175cd3;
}

.quote-label {
    color: #475467;
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
}

.quote-panel strong {
    color: #101828;
    font-size: 2.6rem;
    line-height: 1;
}

.quote-panel small {
    color: #667085;
    display: block;
    font-size: 0.95rem;
}

.ad-section {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
}

.section-title {
    border-bottom: 1px solid #eaecf0;
    padding: 20px 22px;
}

.section-title h2 {
    color: #101828;
    font-size: 1.2rem;
    margin: 0 0 6px;
}

.section-title p {
    color: #667085;
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    border-collapse: collapse;
    min-width: 860px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #eaecf0;
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
    color: #475467;
    font-size: 0.78rem;
    text-transform: uppercase;
}

td {
    color: #344054;
    overflow-wrap: anywhere;
}

td small,
.merchant {
    display: block;
}

.strong,
.merchant {
    color: #101828;
    font-weight: 800;
}

.sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.blazor-error-boundary {
    background: #b42318;
    color: #fff;
    padding: 1rem;
}

@media (max-width: 900px) {
    .dashboard-heading,
    .quote-grid,
    .transaction-grid {
        grid-template-columns: 1fr;
    }

    .refresh-panel,
    .history-controls {
        min-width: 0;
        width: 100%;
    }

    h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 640px) {
    .dashboard-heading {
        gap: 18px;
    }

    h1 {
        font-size: 2rem;
        line-height: 1.08;
    }

    .lead {
        font-size: 0.98rem;
        line-height: 1.45;
        margin-top: 12px;
    }

    .refresh-panel {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .refresh-control,
    .refresh-button {
        width: 100%;
    }

    .history-controls {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 12px;
    }

    .history-controls .refresh-button {
        grid-column: 1 / -1;
    }

    .status-row {
        display: grid;
        gap: 8px;
    }

    .status {
        justify-content: center;
        text-align: center;
    }

    .quote-panel {
        min-height: 0;
        padding: 18px;
    }

    .quote-panel strong {
        font-size: 2rem;
        overflow-wrap: anywhere;
    }

    .chart-toolbar {
        align-items: flex-start;
        display: grid;
        gap: 12px;
        padding: 16px;
    }

    .candle-canvas {
        height: 320px;
    }

    .section-title {
        padding: 16px;
    }

    .ad-section {
        background: transparent;
        border: 0;
        overflow: visible;
    }

    .ad-section .section-title {
        background: #fff;
        border: 1px solid #d0d5dd;
        border-radius: 8px;
        margin-bottom: 12px;
    }

    .table-wrap {
        overflow-x: visible;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    thead {
        height: 1px;
        overflow: hidden;
        position: absolute;
        width: 1px;
    }

    tr {
        background: #fff;
        border: 1px solid #d0d5dd;
        border-radius: 8px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    td {
        align-items: flex-start;
        border-bottom: 1px solid #eaecf0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
        padding: 12px 14px;
    }

    td:last-child {
        border-bottom: 0;
    }

    td::before {
        color: #667085;
        content: attr(data-label);
        font-size: 0.76rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .transaction-card {
        padding: 14px;
    }

    .transaction-card-head,
    .transaction-actions {
        align-items: stretch;
        display: grid;
    }

    .ad-link {
        text-align: center;
    }
}

@media (max-width: 420px) {
    .history-controls {
        grid-template-columns: 1fr;
    }
}
