:root {
    --bg-top: #eefcf8;
    --bg-bottom: #dff6f2;
    --ink-strong: #14363f;
    --ink-soft: #4b6972;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-border: rgba(111, 185, 182, 0.24);
    --accent: #169a87;
    --accent-deep: #0f7466;
    --accent-blue: #3f9fc7;
    --shadow: 0 26px 60px rgba(31, 96, 101, 0.16);
    --code-bg: rgba(18, 62, 73, 0.05);
    --success-bg: rgba(34, 181, 128, 0.14);
    --error-bg: rgba(231, 89, 89, 0.14);
    --error-ink: #a73636;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
    color: var(--ink-strong);
    background:
        radial-gradient(circle at top left, rgba(134, 225, 205, 0.75), transparent 35%),
        radial-gradient(circle at top right, rgba(134, 204, 241, 0.7), transparent 40%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.page-shell {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 48px 20px;
}

.aurora {
    position: absolute;
    z-index: 0;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.75;
}

.aurora-left {
    top: -140px;
    left: -100px;
    background: rgba(122, 234, 203, 0.48);
}

.aurora-right {
    right: -90px;
    bottom: -120px;
    background: rgba(119, 195, 235, 0.34);
}

.app-card {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 34px;
    border: 1px solid var(--panel-border);
    border-radius: 30px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero {
    max-width: 760px;
    margin-bottom: 28px;
}

.eyebrow,
.panel-kicker {
    margin: 0 0 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-deep);
}

.hero h1,
.panel-header h2 {
    margin: 0;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3.45rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.hero-copy {
    margin: 14px 0 0;
    max-width: 620px;
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.7;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 22px;
}

.panel {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    padding: 24px;
    border: 1px solid rgba(111, 185, 182, 0.18);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 255, 252, 0.74));
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-header h2 {
    font-size: 1.3rem;
}

.primary-button {
    border: 0;
    border-radius: 999px;
    padding: 14px 22px;
    font: inherit;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-blue));
    box-shadow: 0 14px 26px rgba(22, 154, 135, 0.26);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px rgba(22, 154, 135, 0.3);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

#sql-input,
.result-output {
    width: 100%;
    flex: 1;
    margin: 0;
    border: 1px solid rgba(20, 54, 63, 0.08);
    border-radius: 20px;
    background: var(--code-bg);
    color: var(--ink-strong);
    font-family: "JetBrains Mono", "SFMono-Regular", "Consolas", monospace;
    font-size: 0.96rem;
    line-height: 1.7;
}

#sql-input {
    resize: vertical;
    min-height: 320px;
    padding: 20px;
    outline: none;
}

#sql-input:focus {
    border-color: rgba(63, 159, 199, 0.38);
    box-shadow: 0 0 0 4px rgba(63, 159, 199, 0.12);
}

.result-header {
    align-items: flex-start;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(63, 159, 199, 0.12);
    color: var(--accent-deep);
    font-size: 0.82rem;
    font-weight: 700;
}

.status-badge.success {
    background: var(--success-bg);
}

.status-badge.error {
    background: var(--error-bg);
    color: var(--error-ink);
}

.result-message {
    margin: 0 0 14px;
    color: var(--ink-soft);
    line-height: 1.6;
}

.result-output {
    min-height: 320px;
    padding: 20px;
    white-space: pre-wrap;
    word-break: break-word;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 920px) {
    .page-shell {
        padding: 24px 16px;
    }

    .app-card {
        padding: 22px;
        border-radius: 24px;
    }

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

    .panel {
        min-height: 0;
    }

    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .primary-button {
        width: 100%;
    }
}
