:root {
    color-scheme: dark;

    --bg: #090c11;
    --panel: #11151b;
    --panel-light: #171c24;
    --border: #292f3a;

    --text: #f4f6f8;
    --muted: #919aa9;

    --red: #ef3340;
    --red-light: #ff6771;
    --green: #63d9a5;

    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;

    background: var(--bg);
    color: var(--text);
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            ellipse at 50% -10%,
            rgba(239, 51, 64, 0.09),
            transparent 55%
        ),
        var(--bg);
}

[hidden] {
    display: none !important;
}

.page {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

.header {
    min-height: 90px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: var(--red);
    color: white;

    font-size: 25px;
    font-weight: 900;
}

.brand strong {
    display: block;

    font-size: 16px;
    letter-spacing: 1.5px;
}

.brand span {
    display: block;
    margin-top: 4px;

    color: var(--muted);
    font-size: 11px;
}

.header-label {
    border: 1px solid var(--border);
    border-radius: 50px;

    padding: 9px 14px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

main {
    flex: 1;
}

.hero {
    padding: 86px 0 55px;
    text-align: center;
}

.eyebrow {
    color: var(--red-light);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.hero h1 {
    max-width: 760px;
    margin: 20px auto;

    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.12;
    letter-spacing: -1.8px;
}

.hero h1 span {
    display: block;
    color: var(--red-light);
}

.hero p {
    max-width: 590px;
    margin: 0 auto;

    color: var(--muted);

    font-size: 15px;
    line-height: 1.8;
}

.search-panel,
.results {
    width: 100%;
    margin: 0 auto 30px;

    padding: 30px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--panel);
}

.search-panel {
    max-width: 790px;
}

.results {
    max-width: 930px;
}

.section-heading h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.section-heading p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}

form {
    display: flex;
    flex-direction: column;

    gap: 14px;
    margin-top: 28px;
}

label {
    font-size: 12px;
    font-weight: 700;
    color: #cbd2dc;
}

input {
    width: 100%;
    min-height: 54px;

    padding: 0 16px;

    border: 1px solid #343b47;
    border-radius: 9px;

    outline: none;

    background: #0b0f15;
    color: white;

    font-family: ui-monospace, monospace;
    font-size: 13px;

    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--red);
}

input::placeholder {
    color: #687281;
}

button {
    min-height: 52px;

    border: 0;
    border-radius: 9px;

    background: var(--red);
    color: white;

    font-size: 13px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.2s,
        transform 0.2s;
}

button:hover:not(:disabled) {
    background: #ff4350;
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.55;
    cursor: wait;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--red-light);
    outline-offset: 3px;
}

.status {
    margin: 18px 0 0;

    font-size: 13px;
    line-height: 1.6;
}

.status:empty {
    display: none;
}

.status.error {
    color: var(--red-light);
}

.status.success {
    color: var(--green);
}

/* Metric cards */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 16px;
    margin-top: 28px;
}

.metric-card {
    min-width: 0;
    min-height: 168px;

    padding: 24px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--panel-light);

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-primary {
    border-color: rgba(239, 51, 64, 0.45);

    background:
        linear-gradient(
            135deg,
            rgba(239, 51, 64, 0.14),
            rgba(239, 51, 64, 0.025)
        ),
        var(--panel-light);
}

.metric-label {
    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.metric-value {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;

    gap: 9px;
    margin: 18px 0 10px;

    min-width: 0;
}

.metric-value strong {
    color: var(--text);

    font-size: clamp(26px, 3.5vw, 37px);
    font-weight: 800;
    line-height: 1.15;

    letter-spacing: -1px;
    overflow-wrap: anywhere;
}

.metric-value span {
    color: var(--muted);

    font-size: 13px;
    font-weight: 700;
}

.metric-primary .metric-value strong {
    color: var(--red-light);
}

.metric-result strong {
    font-size: clamp(20px, 3vw, 29px);
    letter-spacing: 0;
}

.metric-card.is-success .metric-result strong {
    color: var(--green);
}

.metric-card.is-failed .metric-result strong {
    color: var(--red-light);
}

.metric-card.is-unknown .metric-result strong {
    color: var(--muted);
}

.metric-card p {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.6;
}

/* Fee breakdown */

.breakdown-panel {
    margin-top: 22px;
    padding: 26px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #0d1117;
}

.breakdown-panel h3 {
    margin: 0 0 24px;

    font-size: 16px;
    font-weight: 800;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;

    gap: 9px;
    min-width: 0;
}

.detail-item span {
    color: var(--muted);
    font-size: 12px;
}

.detail-item strong {
    color: var(--text);

    font-size: 15px;
    font-weight: 700;

    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

/* Technical JSON */

.technical-details {
    margin-top: 22px;

    border: 1px solid var(--border);
    border-radius: 12px;

    overflow: hidden;
}

.technical-details summary {
    padding: 19px 22px;

    color: #dce4ef;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
    user-select: none;
}

.technical-details summary:hover {
    background: var(--panel-light);
}

.result-panel {
    padding: 20px;

    border-top: 1px solid var(--border);

    background: #0b0f15;
    overflow-x: auto;
}

pre {
    margin: 0;

    color: #dce4ef;

    font-family: ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.75;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Footer */

.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    padding: 28px 0;

    border-top: 1px solid var(--border);

    color: #747e8c;
    font-size: 12px;
}

/* Responsive */

@media (max-width: 640px) {
    .page {
        width: calc(100% - 28px);
    }

    .header {
        min-height: 76px;
    }

    .header-label {
        font-size: 9px;
        padding: 8px;
    }

    .hero {
        padding: 60px 0 40px;
    }

    .hero h1 {
        letter-spacing: -1px;
    }

    .search-panel,
    .results {
        padding: 22px 18px;
    }

    .metrics-grid,
    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 140px;
        padding: 20px;
    }

    .breakdown-panel {
        padding: 20px;
    }

    .footer {
        flex-direction: column;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
