:root {
    --bg: #07030f;
    --bg-soft: #0f0821;
    --panel: rgba(21, 13, 40, 0.78);
    --panel-border: rgba(222, 129, 255, 0.26);
    --text: #f8ebff;
    --muted: #baa1cc;
    --purple: #b830ff;
    --pink: #ff37ba;
    --cyan: #27f1ff;
    --danger: #ff7caa;
    --ok: #54ffbc;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at 5% 0%, #230c44 0%, transparent 35%),
                radial-gradient(circle at 95% 5%, #4f113f 0%, transparent 32%),
                linear-gradient(160deg, #06020d 0%, #0b0518 100%);
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
}

body {
    position: relative;
    overflow-x: hidden;
}

.glow {
    position: fixed;
    z-index: 0;
    width: 32rem;
    height: 32rem;
    filter: blur(90px);
    pointer-events: none;
    opacity: 0.35;
    animation: drift 13s ease-in-out infinite;
}

.glow-purple {
    background: #991eff;
    top: -8rem;
    left: -5rem;
}

.glow-pink {
    background: #ff2da8;
    bottom: -10rem;
    right: -6rem;
    animation-delay: -5s;
}

@keyframes drift {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, 25px, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.6rem;
    display: grid;
    gap: 1rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    backdrop-filter: blur(9px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 15px 45px rgba(0, 0, 0, 0.45);
    padding: 1rem;
}

.hero {
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    inset: auto -30% -60% -30%;
    height: 70%;
    background: radial-gradient(circle, rgba(255, 61, 186, 0.23), rgba(255, 61, 186, 0));
    pointer-events: none;
}

.chip {
    display: inline-block;
    margin: 0;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffd4ff;
    border: 1px solid rgba(255, 68, 207, 0.48);
    background: rgba(255, 63, 187, 0.15);
}

h1,
h2,
h3 {
    font-family: 'Orbitron', sans-serif;
    margin: 0;
}

h1 {
    margin-top: 0.65rem;
    font-size: clamp(1.35rem, 2.4vw, 2.15rem);
    letter-spacing: 0.02em;
}

h2 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.hero-subtitle,
.hint,
.status-message,
.value {
    color: var(--muted);
}

.hero-subtitle {
    margin: 0.7rem 0 0;
    max-width: 760px;
}

.hero-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.status-message {
    font-size: 0.88rem;
}

.intake-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.input-block textarea {
    width: 100%;
}

.drop-zone {
    min-height: 170px;
    border: 1px dashed rgba(195, 105, 255, 0.62);
    background: rgba(34, 19, 65, 0.48);
    border-radius: 14px;
    display: grid;
    place-items: center;
    gap: 0.7rem;
    text-align: center;
    padding: 1rem;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.drop-zone.dragover {
    border-color: var(--pink);
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(255, 71, 197, 0.35), 0 0 40px rgba(255, 55, 186, 0.2);
}

.control-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.control-card {
    background: rgba(16, 9, 33, 0.72);
    border: 1px solid rgba(168, 92, 255, 0.3);
    border-radius: 12px;
    padding: 0.75rem;
}

.label {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
}

.value {
    margin: 0.35rem 0 0;
}

.action-card {
    display: grid;
    place-items: center;
}

.api-panel {
    margin-top: 1rem;
    border: 1px solid rgba(255, 92, 207, 0.28);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(30, 11, 47, 0.88), rgba(24, 8, 40, 0.72));
    padding: 0.85rem;
}

.api-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.remember-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    color: #f7d8ff;
}

.api-grid {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(196, 128, 255, 0.28);
    border-radius: 10px;
    padding: 0.63rem 0.7rem;
    color: var(--text);
    background: rgba(11, 7, 20, 0.9);
    outline: none;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 71, 197, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 71, 197, 0.15), 0 0 20px rgba(184, 48, 255, 0.24);
}

.btn {
    border: 1px solid rgba(236, 151, 255, 0.4);
    border-radius: 11px;
    padding: 0.62rem 1rem;
    color: #ffe9ff;
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(171, 50, 255, 0.75), rgba(253, 63, 177, 0.75));
    box-shadow: 0 0 24px rgba(255, 55, 186, 0.2);
}

.btn-neon {
    width: 100%;
    background: linear-gradient(120deg, #8d2bff, #ff2fb7);
    border-color: rgba(255, 157, 237, 0.7);
    box-shadow: 0 0 0 1px rgba(255, 192, 246, 0.24), 0 0 32px rgba(255, 47, 183, 0.35);
}

.btn-ghost {
    background: rgba(32, 14, 55, 0.75);
}

.section-head {
    display: flex;
    gap: 0.8rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.source-grid {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.source-item,
.progress-item {
    border: 1px solid rgba(198, 123, 255, 0.32);
    border-radius: 10px;
    background: rgba(15, 8, 29, 0.8);
    padding: 0.65rem;
    font-size: 0.92rem;
}

.source-item strong,
.progress-item strong {
    color: #ffd9ff;
}

.progress-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.badge {
    border-radius: 999px;
    padding: 0.18rem 0.6rem;
    font-size: 0.74rem;
    border: 1px solid rgba(177, 110, 255, 0.5);
    background: rgba(91, 37, 132, 0.45);
}

.badge.done {
    border-color: rgba(84, 255, 188, 0.65);
    background: rgba(25, 120, 78, 0.28);
    color: #aaffd5;
}

.results-wrap {
    display: grid;
    gap: 0.8rem;
}

.result-card {
    border: 1px solid rgba(255, 101, 216, 0.3);
    border-radius: 12px;
    background: rgba(11, 7, 22, 0.8);
    overflow: hidden;
}

.result-summary {
    list-style: none;
    cursor: pointer;
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
}

.result-summary::-webkit-details-marker {
    display: none;
}

.result-meta {
    font-size: 0.84rem;
    color: var(--muted);
}

.result-actions {
    display: flex;
    gap: 0.45rem;
}

.result-body {
    padding: 0 0.8rem 0.85rem;
}

.tab-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.3rem 0 0.65rem;
}

.tab-btn {
    border: 1px solid rgba(175, 96, 255, 0.45);
    border-radius: 9px;
    background: rgba(25, 11, 44, 0.78);
    color: #efd9ff;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.tab-btn.active {
    border-color: rgba(255, 85, 203, 0.8);
    box-shadow: 0 0 18px rgba(255, 47, 183, 0.22);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

pre {
    margin: 0;
    border: 1px solid rgba(167, 98, 255, 0.35);
    background: rgba(9, 5, 17, 0.94);
    border-radius: 10px;
    padding: 0.62rem;
    max-height: 380px;
    overflow: auto;
    font-size: 0.79rem;
    line-height: 1.45;
}

.json-key {
    color: #ffa0f3;
}

.json-string {
    color: #95f6ff;
}

.json-number {
    color: #e8adff;
}

.json-boolean {
    color: #8cffcb;
}

.json-null {
    color: #ff9ba5;
}

@media (min-width: 760px) {
    .shell {
        padding: 1.7rem 1.5rem 2.8rem;
        gap: 1.2rem;
    }

    .panel {
        padding: 1.2rem;
    }

    .intake-grid {
        grid-template-columns: 1fr 1fr;
    }

    .control-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .api-grid {
        grid-template-columns: 1fr 1fr;
    }

    .source-grid {
        grid-template-columns: 1fr 1fr;
    }
}
