:root {
    color-scheme: light;
    --bg: #0d1117;
    --bg-soft: #141b24;
    --surface: rgba(17, 24, 33, 0.92);
    --surface-strong: rgba(21, 30, 41, 0.98);
    --surface-soft: rgba(255, 255, 255, 0.04);
    --ink: #eef5ff;
    --muted: rgba(214, 225, 239, 0.72);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --accent: #63a4ff;
    --accent-strong: #2c6dcb;
    --accent-soft: rgba(99, 164, 255, 0.14);
    --ok: #51d2a8;
    --danger: #ff8b8b;
    --radius-2xl: 32px;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --shadow-xl: 0 28px 56px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.24);
    --shadow-sm: 0 10px 18px rgba(0, 0, 0, 0.18);
}

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

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

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 14% 18%, rgba(99, 164, 255, 0.16), transparent 22%),
        radial-gradient(circle at 82% 14%, rgba(81, 210, 168, 0.12), transparent 18%),
        linear-gradient(180deg, #0b1016 0%, #121922 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 88%);
}

.shell {
    width: min(1480px, calc(100% - 40px));
    margin: 24px auto 40px;
    position: relative;
    z-index: 1;
}

.console-banner,
.editor-window,
.console-card,
.monitor-card,
.sidebar-card,
.notice {
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(14px);
}

.eyebrow,
.card-kicker,
.window-tab,
.signal-grid span {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow,
.card-kicker,
.signal-grid span {
    color: rgba(214, 225, 239, 0.7);
}

h1,
h2,
strong {
    margin: 0;
    letter-spacing: -0.05em;
}

h1 {
    font-size: 30px;
    line-height: 0.96;
}

h2 {
    font-size: 1.75rem;
    line-height: 1;
}

.lead,
.panel-headline p,
.console-head p,
.monitor-card p,
.form-note,
.notice,
.muted {
    color: var(--muted);
}

.lead {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.78;
}

.console-banner {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) 260px;
    gap: 24px;
    padding: 30px 32px;
    margin-bottom: 24px;
}

.console-banner::before {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.console-banner::after {
    content: "";
    position: absolute;
    top: 22px;
    right: 22px;
    width: 220px;
    height: 220px;
    border-radius: 24px;
    background:
        linear-gradient(rgba(99, 164, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(81, 210, 168, 0.08) 1px, transparent 1px);
    background-size: 18px 18px;
    transform: rotate(8deg);
    opacity: 0.9;
}

.console-copy,
.console-signal,
.editor-panel,
.output-console,
.monitor-rail {
    display: grid;
    gap: 18px;
}

.console-signal {
    align-content: start;
    justify-items: end;
}

.signal-row {
    display: flex;
    gap: 10px;
}

.signal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.signal-dot-red {
    background: #ff6b6b;
}

.signal-dot-yellow {
    background: #ffd166;
}

.signal-dot-green {
    background: #51d2a8;
}

.signal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 180px;
}

.signal-grid span {
    display: grid;
    place-items: center;
    min-height: 56px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.workbench-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(420px, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.editor-window,
.console-card,
.monitor-card,
.sidebar-card {
    overflow: hidden;
}

.editor-window {
    display: grid;
    gap: 0;
}

.window-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.window-bar-compact {
    padding: 14px 16px;
}

.window-dots {
    display: flex;
    gap: 8px;
}

.window-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
}

.window-dots span:first-child {
    background: #ff6b6b;
}

.window-dots span:nth-child(2) {
    background: #ffd166;
}

.window-dots span:last-child {
    background: #51d2a8;
}

.window-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.window-tab {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: rgba(214, 225, 239, 0.62);
    border: 1px solid transparent;
    font-size: 0.68rem;
}

.window-tab.is-active {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.08);
}

.editor-panel,
.console-card,
.monitor-card,
.sidebar-card {
    padding: 22px;
}

.panel-headline,
.console-head {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.tool-form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 10px;
}

.field > span {
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--ink);
}

.field-lg textarea {
    min-height: 360px;
}

textarea,
select {
    width: 100%;
    min-height: 58px;
    padding: 16px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: rgba(5, 10, 16, 0.42);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

textarea {
    resize: vertical;
    line-height: 1.68;
}

textarea::placeholder {
    color: rgba(214, 225, 239, 0.46);
}

textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(99, 164, 255, 0.42);
    background: rgba(8, 14, 22, 0.56);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 4px rgba(99, 164, 255, 0.12);
    transform: translateY(-1px);
}

.toolbar-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

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

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button[type="submit"] {
    color: #fff;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: 0 14px 28px rgba(44, 109, 203, 0.24);
}

.ghost-button {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
}

.editor-actions {
    display: grid;
    gap: 14px;
}

.action-row,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.form-note {
    margin: 0;
    line-height: 1.65;
}

.notice {
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    line-height: 1.7;
}

.notice.success {
    color: var(--ok);
    background: rgba(81, 210, 168, 0.12);
}

.notice.error {
    color: var(--danger);
    background: rgba(255, 139, 139, 0.1);
}

.hidden {
    display: none !important;
}

.output-console {
    gap: 20px;
}

.console-card,
.monitor-card,
.sidebar-card {
    position: relative;
}

.console-card::before,
.monitor-card::before,
.sidebar-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%);
    pointer-events: none;
}

.code-block,
.diagnostic-box {
    margin: 0;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(4, 10, 16, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code-block {
    min-height: 420px;
    padding: 18px 20px;
    color: #d9f0ff;
    font: 500 0.95rem/1.7 "SFMono-Regular", "SF Mono", "Menlo", monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.diagnostic-box {
    padding: 18px;
    line-height: 1.72;
}

.diagnostic-box strong {
    display: block;
    margin-bottom: 8px;
}

.monitor-rail {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 24px;
}

.monitor-card strong,
.sidebar-card strong {
    display: block;
    margin: 8px 0 10px;
    font-size: 1.5rem;
    line-height: 1.02;
}

.monitor-card-accent {
    background:
        linear-gradient(180deg, rgba(99, 164, 255, 0.14), rgba(18, 28, 40, 0.96));
}

.monitor-list {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.75;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(99, 164, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 800;
}

.ad-shell {
    display: grid;
    gap: 18px;
}

.ad-slot,
.ad-placeholder {
    min-height: 340px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.ad-placeholder {
    padding: 16px;
}

.ad-mockup {
    position: relative;
    min-height: 306px;
    height: 100%;
    border-radius: 18px;
    background:
        linear-gradient(rgba(99, 164, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 164, 255, 0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    background-size: 18px 18px, 18px 18px, auto;
}

.ad-mockup::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 16px;
    border: 1px solid rgba(99, 164, 255, 0.12);
}

.ad-mockup-top,
.ad-mockup-media,
.ad-mockup-badge,
.ad-mockup-lines {
    position: absolute;
}

.ad-mockup-top {
    top: 26px;
    left: 26px;
    width: 110px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.ad-mockup-media {
    inset: 82px 26px 110px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(99, 164, 255, 0.18), rgba(81, 210, 168, 0.12));
}

.ad-mockup-lines {
    left: 26px;
    right: 26px;
    bottom: 30px;
    display: grid;
    gap: 12px;
}

.ad-mockup-lines span {
    display: block;
    height: 14px;
    border-radius: 999px;
    background: rgba(99, 164, 255, 0.14);
}

.ad-mockup-lines span:last-child {
    width: 58%;
}

.ad-mockup-badge {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 156px;
    height: 156px;
    border-radius: 50%;
    display: grid;
    place-content: center;
    gap: 2px;
    background: linear-gradient(135deg, var(--accent), #5a93c7);
    color: #fff;
    box-shadow: 0 16px 30px rgba(44, 109, 203, 0.18);
}

.ad-mockup-badge span {
    display: block;
    font-size: 1.52rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    letter-spacing: 0.04em;
}

@media (max-width: 1320px) {
    .workbench-grid {
        grid-template-columns: 1fr;
    }

    .monitor-rail {
        position: static;
    }
}

@media (max-width: 860px) {
    .shell {
        width: min(100% - 24px, 100%);
    }

    .console-banner,
    .workbench-grid,
    .toolbar-strip {
        grid-template-columns: 1fr;
    }

    .console-banner,
    .editor-panel,
    .console-card,
    .monitor-card,
    .sidebar-card {
        padding: 20px;
    }

    .window-bar,
    .action-row {
        align-items: stretch;
        flex-direction: column;
    }

    button,
    .ghost-button {
        width: 100%;
    }

    .field-lg textarea,
    .code-block {
        min-height: 260px;
    }
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 54px;
    background-image:
        linear-gradient(45deg, transparent 50%, #96a0b5 50%),
        linear-gradient(135deg, #96a0b5 50%, transparent 50%);
    background-position:
        calc(100% - 24px) calc(50% - 3px),
        calc(100% - 18px) calc(50% - 3px);
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
    cursor: pointer;
}
