:root {
    --bg-1: #eef4ff;
    --bg-2: #f8fbff;
    --panel-bg: rgba(255, 255, 255, 0.72);
    --panel-border: rgba(255, 255, 255, 0.7);
    --surface: #ffffff;
    --surface-soft: #f6f9ff;
    --text: #172033;
    --text-soft: #5f6f8d;
    --brand: #2457ff;
    --brand-2: #0ea5e9;
    --brand-dark: #1639b8;
    --left-dark-1: #152238;
    --left-dark-2: #1d2f4d;
    --left-border: rgba(255, 255, 255, 0.08);
    --left-text: #e9f1ff;
    --console-text: #dbeafe;
    --shadow-lg: 0 20px 50px rgba(27, 44, 94, 0.16);
    --shadow-md: 0 10px 25px rgba(27, 44, 94, 0.12);
    --shadow-sm: 0 4px 10px rgba(27, 44, 94, 0.08);
    --radius-xl: 22px;
    --radius-lg: 18px;
    --splitter: rgba(123, 146, 196, 0.35);
    --splitter-handle: rgba(255, 255, 255, 0.95);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Segoe UI", "Inter", Arial, sans-serif;
    color: var(--text);
}

body {
    overflow: hidden;
    background:
        radial-gradient(circle at top left, #dfeafe 0%, transparent 34%),
        radial-gradient(circle at bottom right, #dff7f4 0%, transparent 28%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.app-shell {
    width: 100vw;
    height: 100vh;
    padding: 16px;
}

.app {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    gap: 0;
}

.panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 10px;
}

.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-lg);
}

.section {
    min-height: 0;
    overflow: hidden;
}

.fixed {
    flex: 0 0 auto;
}

.fill {
    flex: 1 1 auto;
    min-height: 80px;
}

.section-surface,
.output-surface,
.app-bar {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.section-surface {
    background: linear-gradient(180deg, #ffffff, var(--surface-soft));
    border: 1px solid rgba(36, 87, 255, 0.08);
}

.app-bar {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand), var(--brand-2));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
}

.card-header {
    min-height: 56px;
    padding: 14px 16px 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(23, 32, 51, 0.08);
}

.light-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h2,
.section-title {
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
}

.card-header h2 {
    font-size: 1rem;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.82;
}

.section-title {
    font-size: 1.25rem;
}

.card-body {
    height: calc(100% - 56px);
    padding: 16px;
    overflow: auto;
    min-height: 0;
}

.scroll-body {
    overflow-y: auto;
    overflow-x: hidden;
}

#leftTitle,
#centerHeader {
    height: 87px;
}

.badge,
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge {
    background: rgba(36, 87, 255, 0.08);
    color: var(--brand-dark);
    border: 1px solid rgba(36, 87, 255, 0.12);
}

.badge-light {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.pill {
    background: rgba(36, 87, 255, 0.08);
    color: var(--brand-dark);
    border: 1px solid rgba(36, 87, 255, 0.12);
}

.action-btn {
    appearance: none;
    border: 1px solid rgba(36, 87, 255, 0.12);
    background: white;
    color: var(--text);
    border-radius: 12px;
    min-height: 36px;
    padding: 0 14px;
    font: inherit;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: white;
    border-color: transparent;
}

.splitter-v,
.splitter-h {
    position: relative;
    z-index: 5;
    flex: 0 0 auto;
    background: transparent;
}

.splitter-v {
    width: 10px;
    cursor: col-resize;
}

.splitter-h {
    height: 10px;
    cursor: row-resize;
    margin: 2px 0;
}

.splitter-v::before,
.splitter-h::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--splitter);
    transition: background 0.15s ease, transform 0.15s ease;
}

.splitter-v::after,
.splitter-h::after {
    content: "";
    position: absolute;
    background: var(--splitter-handle);
    box-shadow: var(--shadow-sm);
    opacity: 0.95;
}

.splitter-v::after {
    width: 4px;
    height: 44px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
}

.splitter-h::after {
    width: 44px;
    height: 4px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
}

.splitter-v:hover::before,
.splitter-h:hover::before {
    background: rgba(36, 87, 255, 0.22);
    transform: scale(1.02);
}

body.resizing,
body.resizing * {
    user-select: none;
    cursor: inherit !important;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(123, 146, 196, 0.45);
    border-radius: 999px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 1100px) {
    .app-shell {
        padding: 10px;
    }

    .section-title {
        font-size: 1.08rem;
    }

    .card-header h2 {
        font-size: 0.95rem;
    }
}