/* ==========================================================================
   GALYM Arduino IDE — desktop-only theme aligned with main site (style.css).
   Uses the same green palette, light/dark tokens, and fonts as index.html
   (Golos Text + Manrope). Requires Web Serial + a real editor, so on
   touch-primary devices the whole app is swapped for a "use a computer"
   message instead of trying (and failing) to be usable on a phone.
   ========================================================================== */

/* ── Theme tokens (match style.css) ─────────────────────────────────────── */
:root {
    /* Light (default) — same as main site */
    --bg:        #ffffff;
    --bg2:   #f5f5f5;
    --bg3: #ededed;
    --accent:    #2D6A4F;
    --accent2: #1F4D38;
    --accent-foreground: #ffffff;
    --accent3:   #4A90A4;
    --accent-soft: rgba(45, 106, 79, 0.12);
    --text:      #1B3A2F;
    --muted:     rgba(27, 58, 47, 0.65);
    --border:    rgba(45, 106, 79, 0.15);
    --glow:      rgba(45, 106, 79, 0.12);

    --success: #2ecc71;
    --error:   #e74c3c;
    --warn:    #e67e22;

    /* Fonts — same stack as index.html / style.css */
    --font-ui: var(--font-body, "Inter", system-ui, sans-serif);
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

    color-scheme: light;
}

/* Dark mode — same tokens as [data-theme="dark"] in style.css */
[data-theme="dark"] {
    --bg:        #0F1A15;
    --bg2:   #16231C;
    --bg3: #1C2C23;
    --accent:    #4CAF7D;
    --accent2: #79C99E;
    --accent-foreground: #0F1A15;
    --accent3:   #6FB8CC;
    --accent-soft: rgba(76, 175, 125, 0.18);
    --text:      #EAF3EE;
    --muted:     rgba(234, 243, 238, 0.55);
    --border:    rgba(255, 255, 255, 0.08);
    --glow:      rgba(76, 175, 125, 0.22);

    --success: #34d399;
    --error:   #ff6b93;
    --warn:    #ffb454;

    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body.ide-page {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
}

/* ---------------------------------------------------------------------- */
/* Device gate — blocks touch-primary devices (phones/tablets), not just  */
/* narrow windows. Capability gate via (hover: none) and (pointer: coarse). */
/* IMPORTANT: robot_izbasar pre-check must use the same media features.   */
/* ---------------------------------------------------------------------- */
.mobile-block {
    display: none;
    height: 100dvh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 1.5rem;
    gap: 0.9rem;
}
.mobile-block svg { color: var(--accent); margin-bottom: 0.4rem; }
.mobile-block h1 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0;
    font-weight: 800;
}
.mobile-block p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 32ch;
    line-height: 1.5;
}
.mobile-block-sub { color: var(--text) !important; font-weight: 600; }

@media (min-width: 640px) {
    .mobile-block, .auth-block { padding: 64px 1.5rem; }
}
@media (min-width: 1024px) {
    .mobile-block, .auth-block { padding: 80px 1.5rem; }
}

.ide-shell { display: flex; }
.browser-warning:not([hidden]) { display: block; }

/* ---------------------------------------------------------------------- */
/* Auth gate — shown instead of the IDE shell when the visitor isn't      */
/* logged in. Same URL, no redirect. Toggled by app.js (checkSession())   */
/* via body.auth-blocked, after asking /api/session.                     */
/* ---------------------------------------------------------------------- */
.auth-block {
    display: none;
    height: 100dvh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 1.5rem;
    gap: 0.9rem;
}
.auth-block svg { color: var(--accent); margin-bottom: 0.4rem; }
.auth-block h1 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0;
    font-weight: 800;
}
.auth-block p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 34ch;
    line-height: 1.5;
}
.auth-block-btn { margin-top: 0.4rem; text-decoration: none; }

body.auth-blocked .auth-block { display: flex; }
body.auth-blocked .ide-shell,
body.auth-blocked .browser-warning { display: none !important; }

/* While the initial /api/session check is in flight, show nothing rather
   than flashing the editor (or the login screen) for a frame. */
body.auth-checking .ide-shell,
body.auth-checking .auth-block,
body.auth-checking .browser-warning { display: none !important; }

@media (hover: none) and (pointer: coarse) {
    .mobile-block { display: flex; }
    .ide-shell { display: none !important; }
    .browser-warning { display: none !important; }
    /* Device gate always wins on touch devices — .auth-block would otherwise
       also render (via body.auth-blocked) for a logged-out mobile visitor,
       stacking both full-screen gates. !important is required to beat the
       body.auth-blocked .auth-block rule below regardless of source order. */
    .auth-block { display: none !important; }
}

/* ---------------------------------------------------------------------- */
/* Browser support banner (Firefox/Safari lack Web Serial)                */
/* ---------------------------------------------------------------------- */
.browser-warning {
    background: rgba(230, 126, 34, 0.1);
    color: var(--warn);
    border-bottom: 1px solid rgba(230, 126, 34, 0.3);
    font-size: 0.8rem;
    padding: 0.55rem 1.2rem;
    text-align: center;
    font-family: var(--font-ui);
}

/* ---------------------------------------------------------------------- */
/* Shell                                                                   */
/* ---------------------------------------------------------------------- */
.ide-shell {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

.ide-topbar {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 1vw, 1rem);
    padding: 0.65rem clamp(0.8rem, 2vw, 1.4rem);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}

.ide-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
    flex-shrink: 0; /* anchor: never let the brand get squeezed to make room for other items */
}
.ide-brand span { color: var(--accent); }

.board-tag {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(45, 106, 79, 0.25);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
    font-family: var(--font-ui);
    white-space: nowrap;
}
[data-theme="dark"] .board-tag {
    border-color: rgba(76, 175, 125, 0.35);
    color: var(--accent2);
}

.ide-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
    padding: 0.3rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.step-connector {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0.05rem;
    user-select: none;
    font-weight: 700;
}

.step-connector-arrow {
    color: var(--accent);
    font-size: 0.85rem;
}
[data-theme="dark"] .step-connector-arrow { color: var(--accent2); }

.flow-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 0.45rem;
    padding: 0;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.72rem;
    font-style: italic;
    font-weight: 700;
    cursor: help;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.flow-info:hover,
.flow-info:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--glow);
    outline: none;
}

.step-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 0.6rem;
    font-size: 0.85rem;
}

.step-btn::before {
    content: attr(data-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 0.68rem;
    font-weight: 800;
}
[data-theme="dark"] .step-btn::before { background: rgba(255, 255, 255, 0.12); }

.step-btn.primary::before,
.step-btn.accent::before {
    background: rgba(255, 255, 255, 0.28);
}
.step-btn.accent::before { background: rgba(46, 204, 113, 0.18); }

.step-btn:disabled::before { opacity: 0.6; }

.step-btn.is-busy {
    cursor: progress;
}
.step-btn.is-busy::before {
    content: "";
    background: transparent;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-bottom-color: transparent;
    animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.step-btn.is-error {
    animation: btn-shake 0.35s ease;
    border-color: var(--error) !important;
    color: var(--error) !important;
    background: rgba(231, 76, 60, 0.1) !important;
}
@keyframes btn-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Push status pill to the far right */
.status-pill { margin-left: auto; }

/* Slim second row for the auth badge — kept separate from the main
   topbar so the workflow buttons + status pill don't have to compete
   with "who's logged in" for space. Collapses away entirely while
   logged out, since its only child is [hidden] in that state. */
.ide-subbar {
    display: flex;
    justify-content: flex-end;
    padding: 0.3rem clamp(0.8rem, 2vw, 1.4rem);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}
.ide-subbar:has(.ide-auth-session[hidden]) {
    display: none;
}

/* ── Auth session badge ── same avatar+dropdown pattern as the site
   nav (assets/css/style.css .nav-session-*): a name has no
   predictable width, so it lives in a dropdown behind a fixed-size
   icon rather than sitting inline as plain text. Sits directly in
   .ide-topbar, right after #statusPill (which has margin-left:auto,
   so both end up flush at the row's right edge) — small enough at
   26/38px that it doesn't need a row of its own the way the old
   plain-text badge did. */
.ide-auth-session {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0; /* anchor: account access stays put — course switcher/step pills give up space first */
}
.ide-auth-session[hidden] { display: none; }

.ide-auth-session-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: none;
    color: var(--text);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}
.ide-auth-session-avatar:hover,
.ide-auth-session-avatar[aria-expanded="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.ide-auth-session-icon { color: var(--text); width: 14px; height: 14px; }

.ide-auth-session-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    min-width: 150px;
    padding: 0.65rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(45, 106, 79, 0.15);
    z-index: 20;
}
.ide-auth-session-dropdown.open { display: flex; }

/* ── Course switcher ── same avatar+dropdown pattern as the auth session
   badge above, but a labelled button instead of an icon (course names
   have no fixed width, but there are only ever a handful of them, so an
   inline pill reads better than a bare icon here). Hidden entirely by
   app.js when a course's manifest only has one entry. */
.course-switcher {
    position: relative;
    display: flex;
    align-items: center;
    /* shrinkable, not fixed-width: this is the item that gives up space
       first when the topbar is tight, so the auth avatar never has to
       wrap to a second row. min-width:0 is required for the button's
       ellipsis (below) to actually engage instead of just overflowing. */
    flex-shrink: 1;
    min-width: 0;
}
.course-switcher[hidden] { display: none; }

.course-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 30px;
    padding: 0 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    /* persistent (not hover-only) tint so the control reads as
       interactive at a glance, matching the connect button's weight */
    background: var(--bg3);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    max-width: 220px;
    min-width: 0; /* let the button itself shrink below 220px when the row is tight */
}
.course-switcher-btn span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.course-switcher-btn svg {
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.course-switcher-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}
.course-switcher-btn:hover,
.course-switcher-btn[aria-expanded="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Once a second course exists, this control appears for the first
   time on a page users already know — collapse the label before that
   point so it never competes with the avatar for space, rather than
   only truncating after everything already feels cramped. */
@media (max-width: 640px) {
    .course-switcher-btn { max-width: 110px; }
}

.course-switcher-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    min-width: 220px;
    padding: 0.4rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(45, 106, 79, 0.15);
    z-index: 20;
}
.course-switcher-dropdown.open { display: flex; }

.course-switcher-option {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}
.course-switcher-option:hover { background: var(--accent-soft); }
.course-switcher-option.active {
    color: var(--accent);
    font-weight: 700;
}

.ide-auth-session-name {
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ide-auth-session-name[hidden] {
    display: none !important;
}

/* Match site nav (.nav-session-profile / .nav-session-logout in components.js) */
.ide-auth-session-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    background: var(--accent, #2D6A4F);
    border: none;
    border-radius: 4px;
    padding: 0.45rem 0.9rem;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-ui, inherit);
    text-decoration: none;
    color: var(--accent-foreground) !important;
    cursor: pointer;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.ide-auth-session-profile:hover {
    opacity: 0.9;
    background: var(--accent, #2D6A4F);
    color: var(--accent-foreground) !important;
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
}
[data-theme="dark"] .ide-auth-session-profile,
[data-theme="dark"] .ide-auth-session-profile:hover {
    /* dark theme's --accent (#4CAF7D) is too bright for white text (2.7:1, fails WCAG AA) */
    color: #0a120e !important;
    box-shadow: 0 4px 12px rgba(76, 175, 125, 0.28);
}

.ide-auth-session-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.45rem 0.9rem;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-ui, inherit);
    cursor: pointer;
    color: var(--text);
    flex-shrink: 0;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.ide-auth-session-logout:hover {
    border-color: var(--accent);
    color: var(--accent2, var(--accent));
    background: var(--glow, transparent);
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.ide-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.82rem;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.08s ease, opacity 0.15s ease, border-color 0.15s;
    white-space: nowrap;
}
.ide-btn:hover:not(:disabled) {
    background: var(--glow);
    border-color: var(--accent);
}
.ide-btn:active:not(:disabled) { transform: translateY(1px); }
.ide-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.ide-btn.ghost { background: transparent; }
.ide-btn.small { padding: 0.4rem 0.7rem; font-size: 0.74rem; border-radius: 4px; }

.ide-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-foreground);
}
.ide-btn.primary:hover:not(:disabled) {
    background: var(--accent2);
    border-color: var(--accent2);
}

.ide-btn.accent {
    background: transparent;
    border-color: var(--success);
    color: var(--success);
}
.ide-btn.accent:hover:not(:disabled) {
    background: rgba(46, 204, 113, 0.12);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-ui);
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    white-space: nowrap;
    color: var(--muted);
}
.status-pill i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}
.status-pill.online {
    color: var(--success);
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.08);
}
.status-pill.online i { animation: pulse-dot 1.6s ease-in-out infinite; }
.status-pill.busy {
    color: var(--accent);
    border-color: rgba(45, 106, 79, 0.35);
    background: var(--accent-soft);
}
[data-theme="dark"] .status-pill.busy {
    color: var(--accent2);
    border-color: rgba(76, 175, 125, 0.4);
}
.status-pill.error {
    color: var(--error);
    border-color: rgba(231, 76, 60, 0.4);
    background: rgba(231, 76, 60, 0.08);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5); }
    50%      { opacity: 0.6; box-shadow: 0 0 0 4px rgba(46, 204, 113, 0); }
}

/* ---------------------------------------------------------------------- */
/* Body: editor + monitor, side by side (desktop)                         */
/* ---------------------------------------------------------------------- */
.ide-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 6px var(--monitor-width, clamp(300px, 26vw, 460px));
}

.pane-splitter {
    background: var(--border);
    cursor: col-resize;
    position: relative;
}
.pane-splitter::after {
    content: "";
    position: absolute;
    inset: 0 -3px;
}
.pane-splitter:hover,
.pane-splitter:active {
    background: var(--accent);
}

.pane { display: flex; min-height: 0; min-width: 0; }
.pane-code { flex-direction: column; }
.editor-pane { flex: 1; min-height: 0; }

.pane-monitor {
    flex-direction: column;
    background: var(--bg2);
    border-left: 1px solid var(--border);
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-ui);
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.pane-controls { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.pane-controls select {
    font-size: 0.72rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    font-family: var(--font-ui);
}
.autoscroll {
    font-size: 0.68rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-ui);
}

.monitor-output {
    flex: 1;
    margin: 0;
    padding: 0.7rem;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    background: var(--bg);
}

/* ---------------------------------------------------------------------- */
/* Log resize handle — the line between the code/monitor area and the    */
/* build log below it. Deliberately visible (not hover-only) so it reads */
/* as a distinct, grabbable divider rather than part of either pane.     */
/* ---------------------------------------------------------------------- */
.log-splitter {
    height: 11px;
    flex-shrink: 0;
    margin: 0;
    cursor: row-resize;
    position: relative;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.log-splitter::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 3px;
    background: var(--muted);
    opacity: 0.55;
    transform: translate(-50%, -50%);
    transition: opacity 0.15s ease, background 0.15s ease;
}
.log-splitter:hover,
.log-splitter.dragging {
    background: var(--glow);
}
.log-splitter:hover::before,
.log-splitter.dragging::before {
    opacity: 1;
    background: var(--accent);
}
[data-theme="dark"] .log-splitter:hover::before,
[data-theme="dark"] .log-splitter.dragging::before {
    background: var(--accent2);
}

/* ---------------------------------------------------------------------- */
/* Collapsible build log                                                  */
/* ---------------------------------------------------------------------- */
.ide-logbar {
    border-top: 1px solid var(--border);
    background: var(--bg2);
    flex-shrink: 0;
}
[data-theme="dark"] .ide-logbar {
    background: #0a120e;
}
.ide-logbar summary {
    padding: 0.4rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    font-family: var(--font-ui);
}
.ide-logbar pre {
    margin: 0;
    padding: 0 1rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.55;
    white-space: pre-wrap;
    color: var(--muted);
}
.ide-logbar pre .err { color: var(--error); }
.ide-logbar pre .ok  { color: var(--success); }

/* ---------------------------------------------------------------------- */
/* Narrower desktop windows                                               */
/* ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .ide-btn { padding: 0.45rem 0.7rem; font-size: 0.78rem; }
    .ide-btn.step-btn { padding: 0.45rem 0.85rem 0.45rem 0.5rem; }
    .ide-brand { display: none; }
}

@media (max-width: 640px) {
    .ide-body {
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr 6px minmax(180px, 34vh);
    }
    .pane-splitter { cursor: row-resize; }
    .pane-monitor {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

@media (min-width: 1700px) {
    .ide-body {
        grid-template-columns: minmax(0, 1400px) 6px var(--monitor-width, 460px);
        justify-content: center;
    }
}