:root {
    --app-bg: #120f19;
    --app-bg-soft: #191528;
    --app-surface: rgba(20, 16, 31, 0.78);
    --app-border: rgba(255, 255, 255, 0.09);
    --app-border-strong: rgba(255, 255, 255, 0.16);
    --app-text: #f5f7fb;
    --app-muted: #a8adbe;
    --app-accent: #ff8a3d;
    --app-accent-strong: #ff5f6d;
    --app-accent-soft: rgba(255, 138, 61, 0.14);
    --app-success: #2ed8a3;
    --app-warning: #ffb454;
    --app-danger: #ff6b81;
    --app-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
    --app-radius: 28px;
}

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

body.app-body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-text);
    font-family: "DM Sans", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 95, 109, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(255, 138, 61, 0.18), transparent 26%),
        linear-gradient(145deg, var(--app-bg) 0%, #0d1018 100%);
}

code,
pre,
.payload-editor-field {
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

.app-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.app-background__orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.5;
}

.app-background__orb--one {
    top: -8rem;
    left: -5rem;
    width: 20rem;
    height: 20rem;
    background: rgba(255, 95, 109, 0.28);
}

.app-background__orb--two {
    right: -5rem;
    bottom: -8rem;
    width: 22rem;
    height: 22rem;
    background: rgba(255, 138, 61, 0.24);
}

.app-shell {
    position: relative;
    z-index: 1;
}

.glass-panel {
    background: linear-gradient(180deg, rgba(32, 27, 48, 0.88), rgba(16, 13, 28, 0.78));
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(18px);
}

.hero-panel,
.form-panel,
.side-panel {
    padding: 1.75rem;
}

.hero-panel__eyebrow,
.panel-label {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: var(--app-accent-soft);
    color: #ffd1b5;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-panel__title,
.panel-title {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.hero-panel__title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    max-width: 11ch;
}

.hero-panel__lead,
.panel-copy {
    color: var(--app-muted);
    line-height: 1.7;
}

.hero-stats {
    display: grid;
    gap: 1rem;
}

.hero-stat,
.transaction-card,
.advanced-summary {
    padding: 1rem 1.2rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--app-border);
}

.hero-stat strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
}

.hero-stat__label,
.advanced-summary__label,
.form-label-soft {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--app-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.panel-header--compact {
    margin-bottom: 1.2rem;
}

.panel-title {
    font-size: 1.85rem;
}

.panel-title--sm {
    font-size: 1.35rem;
}

.mode-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.4rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--app-border-strong);
    color: var(--app-text);
    font-size: 0.84rem;
    font-weight: 700;
}

.status-pill--success {
    color: #04281d;
    background: rgba(46, 216, 163, 0.92);
}

.status-pill--warning {
    color: #3f2400;
    background: rgba(255, 180, 84, 0.96);
}

.status-pill--error {
    color: #fff0f3;
    background: rgba(255, 107, 129, 0.88);
}

.status-pill--neutral {
    color: #e8efff;
    background: rgba(106, 142, 255, 0.28);
}

.form-control-premium,
.form-select.form-control-premium,
.form-control-premium--dark {
    min-height: 3.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--app-text);
    box-shadow: none;
}

.form-control-premium::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.form-control-premium:focus,
.form-select.form-control-premium:focus,
.form-control-premium--dark:focus {
    border-color: rgba(255, 138, 61, 0.75);
    box-shadow: 0 0 0 0.22rem rgba(255, 138, 61, 0.18);
    background: rgba(255, 255, 255, 0.09);
    color: var(--app-text);
}

.form-control-premium--xl {
    min-height: 4.45rem;
    font-size: 1.08rem;
    font-weight: 700;
}

.transaction-card__title {
    margin-top: 0.7rem;
    margin-bottom: 0.5rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.25rem;
}

.transaction-card__text,
.panel-meta,
.empty-state,
.hero-panel__lead {
    color: var(--app-muted);
}

.action-button {
    min-height: 3.7rem;
    border-radius: 18px;
    font-weight: 700;
    border-width: 1px;
}

.btn.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

.btn-primary.action-button {
    border: none;
    background: linear-gradient(135deg, var(--app-accent-strong), var(--app-accent));
    box-shadow: 0 18px 40px rgba(255, 95, 109, 0.28);
}

.action-button--secondary {
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--app-text);
    background: rgba(255, 255, 255, 0.04);
}

.soft-alert {
    border-radius: 22px;
    background: rgba(255, 107, 129, 0.15);
    color: #ffeef1;
}

.panel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

.code-block {
    max-height: 30rem;
    padding: 1.25rem;
    border-radius: 22px;
    background: rgba(8, 10, 18, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f4f7fb;
    overflow: auto;
    font-size: 0.87rem;
    line-height: 1.7;
}

.icon-button {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.empty-state__icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffd1b5;
    font-size: 1.5rem;
}

.response-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    color: #d7fef0;
}

.response-accordion .accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 1rem;
}

.response-accordion .accordion-button,
.response-accordion .accordion-button:not(.collapsed),
.advanced-modal {
    color: var(--app-text);
}

.response-accordion .accordion-button,
.response-accordion .accordion-button:not(.collapsed) {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

.response-accordion .accordion-button::after {
    filter: invert(1);
}

.advanced-modal {
    background:
        radial-gradient(circle at top right, rgba(255, 138, 61, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(24, 19, 39, 0.98), rgba(13, 11, 23, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 26px;
}

.modal-section,
.editor-shell {
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-section {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.04);
}

.payload-mode-group .btn {
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.02);
}

.payload-mode-group .btn.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 95, 109, 0.38), rgba(255, 138, 61, 0.42));
    border-color: transparent;
}

.editor-shell {
    display: flex;
    align-items: stretch;
    min-height: 27rem;
    padding: 0;
    overflow: hidden;
    background: rgba(6, 8, 15, 0.96);
}

textarea.payload-editor-field {
    display: block !important;
    flex: 1 1 auto;
    width: 100% !important;
    height: 100% !important;
    min-height: 27rem;
    margin: 0;
    padding: 1.35rem 1.4rem;
    resize: none;
    border: 0 !important;
    outline: 0;
    appearance: none;
    box-shadow: none !important;
    background: rgba(6, 8, 15, 0.96) !important;
    color: #f4f7fb !important;
    caret-color: #ffb454;
    line-height: 1.7;
    font-size: 0.92rem;
    overflow: auto;
    tab-size: 4;
}

textarea.payload-editor-field:focus {
    outline: 0;
    box-shadow: none !important;
}

textarea.payload-editor-field::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.editor-shell.is-invalid {
    border-color: rgba(255, 107, 129, 0.88);
}

.headers-textarea {
    min-height: 9rem;
}

#rawPayloadError {
    color: #ffc2cb;
}

.toast {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(21, 17, 33, 0.94);
    color: var(--app-text);
    backdrop-filter: blur(14px);
}

@media (max-width: 991.98px) {
    .hero-panel,
    .form-panel,
    .side-panel {
        padding: 1.4rem;
    }

    .hero-panel__title {
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .hero-panel__title {
        font-size: 2.2rem;
    }

    .panel-title {
        font-size: 1.55rem;
    }
}
