/* ============================================================
   OMG · Catppuccin styles for the playground and explorer
   ------------------------------------------------------------
   Mocha (dark) by default, Latte (light) as a toggle. Both
   pages share this sheet — page-specific bits live inline.
   Palette: https://catppuccin.com/palette
   ============================================================ */

/* === Catppuccin palette tokens ========================================= */

:root,
[data-theme="dark"] {
    /* Mocha */
    --ctp-rosewater: #f5e0dc;
    --ctp-flamingo:  #f2cdcd;
    --ctp-pink:      #f5c2e7;
    --ctp-mauve:     #cba6f7;
    --ctp-red:       #f38ba8;
    --ctp-maroon:    #eba0ac;
    --ctp-peach:     #fab387;
    --ctp-yellow:    #f9e2af;
    --ctp-green:     #a6e3a1;
    --ctp-teal:      #94e2d5;
    --ctp-sky:       #89dceb;
    --ctp-sapphire:  #74c7ec;
    --ctp-blue:      #89b4fa;
    --ctp-lavender:  #b4befe;
    --ctp-text:      #cdd6f4;
    --ctp-subtext1:  #bac2de;
    --ctp-subtext0:  #a6adc8;
    --ctp-overlay2:  #9399b2;
    --ctp-overlay1:  #7f849c;
    --ctp-overlay0:  #6c7086;
    --ctp-surface2:  #585b70;
    --ctp-surface1:  #45475a;
    --ctp-surface0:  #313244;
    --ctp-base:      #1e1e2e;
    --ctp-mantle:    #181825;
    --ctp-crust:     #11111b;

    --shadow-soft:  0 1px 0 rgba(0, 0, 0, 0.25);
    --shadow-pop:   0 12px 32px -10px rgba(0, 0, 0, 0.5);
    --glow-accent:  0 0 24px rgba(203, 166, 247, 0.18);
}

[data-theme="light"] {
    /* Latte */
    --ctp-rosewater: #dc8a78;
    --ctp-flamingo:  #dd7878;
    --ctp-pink:      #ea76cb;
    --ctp-mauve:     #8839ef;
    --ctp-red:       #d20f39;
    --ctp-maroon:    #e64553;
    --ctp-peach:     #fe640b;
    --ctp-yellow:    #df8e1d;
    --ctp-green:     #40a02b;
    --ctp-teal:      #179299;
    --ctp-sky:       #04a5e5;
    --ctp-sapphire:  #209fb5;
    --ctp-blue:      #1e66f5;
    --ctp-lavender:  #7287fd;
    --ctp-text:      #4c4f69;
    --ctp-subtext1:  #5c5f77;
    --ctp-subtext0:  #6c6f85;
    --ctp-overlay2:  #7c7f93;
    --ctp-overlay1:  #8c8fa1;
    --ctp-overlay0:  #9ca0b0;
    --ctp-surface2:  #acb0be;
    --ctp-surface1:  #bcc0cc;
    --ctp-surface0:  #ccd0da;
    --ctp-base:      #eff1f5;
    --ctp-mantle:    #e6e9ef;
    --ctp-crust:     #dce0e8;

    --shadow-soft:  0 1px 0 rgba(76, 79, 105, 0.05);
    --shadow-pop:   0 14px 40px -12px rgba(76, 79, 105, 0.18);
    --glow-accent:  0 0 28px rgba(136, 57, 239, 0.18);
}

/* === Semantic tokens =================================================== */

:root {
    --bg-0:          var(--ctp-base);
    --bg-1:          var(--ctp-mantle);
    --bg-2:          var(--ctp-crust);
    --panel:         var(--ctp-surface0);
    --panel-hi:      var(--ctp-surface1);
    --border:        var(--ctp-surface0);
    --border-strong: var(--ctp-surface1);

    --fg-0:          var(--ctp-text);
    --fg-1:          var(--ctp-subtext1);
    --fg-2:          var(--ctp-subtext0);
    --fg-3:          var(--ctp-overlay1);
    --fg-dim:        var(--ctp-overlay0);

    --accent:        var(--ctp-mauve);
    --accent-soft:   color-mix(in srgb, var(--ctp-mauve) 18%, transparent);
    --accent-faint:  color-mix(in srgb, var(--ctp-mauve) 9%, transparent);

    --ok:            var(--ctp-green);
    --warn:          var(--ctp-yellow);
    --error:         var(--ctp-red);
    --error-soft:    color-mix(in srgb, var(--ctp-red) 14%, transparent);

    --ui:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --mono:  "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;

    --r-sm:  4px;
    --r-md:  6px;
    --r-lg:  10px;
    --r-pill: 999px;

    --topbar-h:    48px;
    --statusbar-h: 26px;
    --tabbar-h:    36px;
}

/* === Reset ============================================================= */

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

html, body { height: 100%; }
html { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }

body {
    margin: 0;
    font-family: var(--ui);
    font-size: 13px;
    line-height: 1.5;
    color: var(--fg-0);
    background: var(--bg-0);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background 180ms ease, color 180ms ease;
    overflow: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ctp-lavender); }

::selection {
    background: var(--accent-soft);
    color: var(--fg-0);
}

/* === App shell ========================================================= */

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* --- Top bar ------------------------------------------------------------ */

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: var(--topbar-h);
    padding: 0 16px;
    background:
        linear-gradient(180deg, var(--ctp-mantle) 0%, color-mix(in srgb, var(--ctp-mantle) 70%, var(--ctp-base)) 100%);
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
    z-index: 10;
    position: relative;
}

.topbar::after {
    /* faint mauve under-bar glow, only on dark */
    content: "";
    position: absolute;
    inset: auto 0 -1px 0;
    height: 1px;
    background:
        linear-gradient(90deg, transparent 0%, var(--accent-soft) 28%, var(--accent-soft) 72%, transparent 100%);
    pointer-events: none;
    opacity: 0.6;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--fg-0);
    user-select: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background:
        linear-gradient(135deg, var(--ctp-mauve) 0%, var(--ctp-pink) 65%, var(--ctp-peach) 100%);
    color: var(--ctp-base);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        var(--glow-accent);
}

[data-theme="light"] .brand-mark { color: var(--ctp-mantle); }

.brand-name {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.06em;
}

.brand-sep {
    width: 1px;
    height: 16px;
    background: var(--border-strong);
    margin: 0 2px;
}

.brand-tag {
    font-family: var(--ui);
    font-size: 11.5px;
    color: var(--fg-3);
    font-weight: 500;
    font-feature-settings: "ss01", "cv11";
}

.brand-tag em {
    color: var(--fg-1);
    font-style: normal;
}

.navtabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    padding: 3px;
    background: var(--bg-0);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}

.navtab {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-2);
    border-radius: 4px;
    transition: color 120ms ease, background 120ms ease;
}

.navtab:hover { color: var(--fg-0); }

.navtab.is-active {
    color: var(--accent);
    background: var(--accent-soft);
}

.topbar-spacer { flex: 1; }

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --- Workspace --------------------------------------------------------- */

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 1px;
    flex: 1;
    min-height: 0;
    background: var(--border);
}

[data-sidebar="open"] .workspace {
    grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1.05fr);
}

[data-sidebar="closed"] .sidebar { display: none; }

@media (max-width: 880px) {
    .workspace { grid-template-columns: 1fr; grid-auto-rows: minmax(280px, 1fr); }
    [data-sidebar="open"] .workspace { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    #sidebarToggle { display: none; }
}

/* --- Reference sidebar -------------------------------------------------- */

.sidebar {
    background: var(--bg-1);
}

.sidebar-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 14px 18px 14px;
    font-family: var(--ui);
    font-size: 12px;
    line-height: 1.55;
    color: var(--fg-1);
}

.ref-section {
    margin: 14px 2px 8px 2px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-3);
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

.ref-section:first-child { margin-top: 0; }

.ref-entry {
    margin: 8px 0 12px 0;
}

.ref-title {
    margin: 0 0 4px 2px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--fg-0);
}

.ref-code {
    margin: 0;
    padding: 8px 10px;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--fg-0);
    overflow-x: auto;
    white-space: pre;
}

.ref-code code { font: inherit; color: inherit; }

.sb-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--fg-3);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.sb-close:hover {
    color: var(--fg-0);
    background: var(--panel);
    border-color: var(--border-strong);
}

/* --- Themed scrollbars (sidebar + reference code) ----------------------- */

.sidebar-body,
.ref-code {
    scrollbar-width: thin;
    scrollbar-color: var(--ctp-surface2) transparent;
}

.sidebar-body::-webkit-scrollbar,
.ref-code::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.sidebar-body::-webkit-scrollbar-track,
.ref-code::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb,
.ref-code::-webkit-scrollbar-thumb {
    background: var(--ctp-surface1);
    border: 2px solid var(--bg-1);
    border-radius: 6px;
}

.ref-code::-webkit-scrollbar-thumb {
    border-color: var(--bg-0);
}

.sidebar-body::-webkit-scrollbar-thumb:hover,
.ref-code::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.sidebar-body::-webkit-scrollbar-corner,
.ref-code::-webkit-scrollbar-corner {
    background: transparent;
}

.pane {
    display: flex;
    flex-direction: column;
    background: var(--bg-0);
    min-width: 0;
    min-height: 0;
}

.pane-head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--tabbar-h);
    padding: 0 14px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.pane-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-1);
}

.pane-title .file-icon {
    color: var(--accent);
    opacity: 0.85;
}

.pane-title-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-dim);
}

.pane-title.is-modified .pane-title-dot { background: var(--ctp-peach); }

.pane-head-spacer { flex: 1; }

.pane-head-meta {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--fg-3);
    letter-spacing: 0.04em;
}

/* --- Status bar -------------------------------------------------------- */

.statusbar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--statusbar-h);
    padding: 0 12px;
    background: var(--bg-1);
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--fg-2);
    flex: 0 0 auto;
}

.sb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    height: 100%;
    white-space: nowrap;
}

.sb-sep {
    width: 1px;
    height: 12px;
    background: var(--border-strong);
    margin: 0 2px;
}

.sb-spacer { flex: 1; }

.sb-accent { color: var(--accent); }
.sb-warn   { color: var(--warn); }
.sb-error  { color: var(--error); }
.sb-ok     { color: var(--ok); }

.sb-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--fg-dim);
    transition: background 140ms ease;
}

.sb-dot.is-busy {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-soft);
    animation: sbPulse 1.1s ease-in-out infinite;
}

.sb-dot.is-ok    { background: var(--ok); }
.sb-dot.is-error { background: var(--error); }

@keyframes sbPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

.sb-link {
    color: var(--fg-2);
    transition: color 120ms ease;
}
.sb-link:hover { color: var(--accent); }

/* === Controls ========================================================== */

.select {
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--mono);
    font-size: 11.5px;
    padding: 5px 26px 5px 10px;
    background: var(--bg-0);
    color: var(--fg-0);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--fg-2) 50%),
        linear-gradient(135deg, var(--fg-2) 50%, transparent 50%);
    background-position:
        calc(100% - 12px) 50%,
        calc(100% - 8px) 50%;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.select:hover { border-color: var(--ctp-overlay1); }
.select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-0);
    background: var(--bg-0);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
    white-space: nowrap;
}

.btn:hover  { background: var(--panel); border-color: var(--ctp-overlay1); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn-primary {
    background:
        linear-gradient(180deg, var(--ctp-mauve) 0%, color-mix(in srgb, var(--ctp-mauve) 88%, black) 100%);
    color: var(--ctp-base);
    border-color: transparent;
    font-weight: 600;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 1px 0 rgba(0, 0, 0, 0.12),
        var(--glow-accent);
}

[data-theme="light"] .btn-primary { color: var(--ctp-mantle); }

.btn-primary:hover {
    background:
        linear-gradient(180deg, var(--ctp-lavender) 0%, var(--ctp-mauve) 100%);
    border-color: transparent;
}

.btn-primary .ico { color: currentColor; }

.btn .ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
}

.kbd {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    margin-left: 4px;
    background: rgba(0, 0, 0, 0.22);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 3px;
}

[data-theme="light"] .btn-primary .kbd {
    background: rgba(255, 255, 255, 0.35);
    color: var(--ctp-mantle);
}

/* === Theme toggle ====================================================== */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--fg-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--bg-0);
    transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.theme-toggle:hover { color: var(--accent); background: var(--panel); border-color: var(--ctp-overlay1); }

.theme-toggle .iconStack { position: relative; width: 14px; height: 14px; }

.theme-toggle .iconStack svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity 200ms ease, transform 200ms cubic-bezier(.2, .8, .2, 1);
}

.theme-toggle .sun  { opacity: 0; transform: rotate(-90deg) scale(0.8); }
.theme-toggle .moon { opacity: 1; transform: rotate(0deg) scale(1); }

[data-theme="light"] .theme-toggle .sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(0.8); }

/* === Toast ============================================================= */

.toast {
    position: fixed;
    left: 50%;
    bottom: 48px;
    transform: translate(-50%, 12px);
    padding: 8px 14px;
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-0);
    background: var(--panel);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 1000;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.is-error {
    border-color: color-mix(in srgb, var(--ctp-red) 60%, var(--border-strong));
    color: var(--ctp-red);
}

/* === Editor ============================================================ */

.editor {
    display: flex;
    flex: 1;
    min-height: 0;
    background: var(--bg-0);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.65;
    overflow: hidden;
}

.gutter {
    flex: 0 0 auto;
    padding: 14px 12px 14px 18px;
    margin: 0;
    text-align: right;
    color: var(--fg-dim);
    background: var(--bg-0);
    border-right: 1px solid var(--border);
    user-select: none;
    white-space: pre;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    pointer-events: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    min-width: 44px;
}

.editor-area {
    position: relative;
    flex: 1;
    min-width: 0;
}

.editor-hl,
.editor-src {
    position: absolute;
    inset: 0;
    padding: 14px 18px;
    margin: 0;
    font: inherit;
    background: transparent;
    border: 0;
    outline: none;
    white-space: pre;
    word-wrap: normal;
    tab-size: 4;
}

.editor-hl {
    pointer-events: none;
    overflow: hidden;
    color: var(--fg-0);
}

.editor-src {
    color: transparent;
    caret-color: var(--ctp-rosewater);
    -webkit-text-fill-color: transparent;
    resize: none;
    overflow: auto;
}

.editor-src::selection {
    background: var(--accent-soft);
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.editor-src:focus { outline: 0; }

/* Subtle "focused editor" indicator. */
.pane.is-focused .pane-head {
    background: color-mix(in srgb, var(--bg-1) 60%, var(--accent-faint));
}

/* === Output / content body ============================================= */

.pane-body {
    flex: 1;
    min-height: 0;
    padding: 14px 18px;
    margin: 0;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.65;
    color: var(--fg-0);
    background: var(--bg-0);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: auto;
    border: 0;
    tab-size: 4;
}

.pane-body.is-empty {
    color: var(--fg-3);
    font-style: italic;
}

.pane-body.is-error { color: var(--error); }

/* === Tabs (explorer right pane) ======================================== */

/* The pane that contains the tab bar becomes its own size-context so the
   container queries below can hide tab metadata when the pane is narrow,
   regardless of viewport width. */
.pane:has(> .tabbar) {
    container-type: inline-size;
    container-name: stages;
}

.tabbar {
    display: flex;
    flex: 0 0 auto;
    height: var(--tabbar-h);
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    height: var(--tabbar-h);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-2);
    border-right: 1px solid var(--border);
    transition: background 120ms ease, color 120ms ease;
    white-space: nowrap;
    /* Share width equally so all six tabs always fit. min-width: 0 lets
       them shrink past their intrinsic content width when needed. */
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}

.tab .tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.tab .tab-num {
    font-size: 9.5px;
    color: var(--fg-dim);
    letter-spacing: 0.04em;
    flex: 0 0 auto;
}

.tab:hover { color: var(--fg-0); background: color-mix(in srgb, var(--bg-1) 60%, var(--accent-faint)); }

.tab.is-active {
    color: var(--fg-0);
    background: var(--bg-0);
}

.tab.is-active::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background:
        linear-gradient(90deg, var(--ctp-mauve) 0%, var(--ctp-pink) 100%);
    border-radius: 0 0 2px 2px;
}

.tab.is-active .tab-num { color: var(--accent); }

.tab.is-error { color: var(--error); }
.tab.is-error .tab-num { color: var(--error); }
.tab.is-active.is-error::before {
    background: linear-gradient(90deg, var(--ctp-red) 0%, var(--ctp-maroon) 100%);
}

.tab.is-empty .tab-num { opacity: 0.5; }

.tab-size {
    font-size: 9.5px;
    color: var(--fg-dim);
    flex: 0 0 auto;
}

.tab.is-active .tab-size { color: var(--fg-2); }

/* Progressive disclosure: drop the byte-count chip when the pane is
   narrow, then the roman-numeral prefix at the tightest sizes. */
@container stages (max-width: 560px) {
    .tab-size { display: none; }
    .tab { padding: 0 8px; }
}
@container stages (max-width: 380px) {
    .tab-num { display: none; }
    .tab { gap: 0; }
}

.stage-pane { display: none; }
.stage-pane.is-active { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* === Syntax highlight palette (Catppuccin convention) ================== */

.tok-comment  { color: var(--ctp-overlay0); font-style: italic; }
.tok-string   { color: var(--ctp-green); }
.tok-number   { color: var(--ctp-peach); }
.tok-keyword  { color: var(--ctp-mauve); }
.tok-builtin  { color: var(--ctp-sapphire); }
.tok-boolean  { color: var(--ctp-peach); }
.tok-langvar  { color: var(--ctp-red); }
.tok-op       { color: var(--ctp-sky); }
.tok-fn       { color: var(--ctp-blue); }

/* === Pipeline strip (explorer status bar) ============================= */

.pipeline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 100%;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--fg-3);
}

.pipeline .pstep {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: color 120ms ease, background 120ms ease;
}

.pipeline .pstep:hover { color: var(--fg-0); background: var(--panel); }
.pipeline .pstep.is-current { color: var(--accent); background: var(--accent-soft); }
.pipeline .pstep.is-error   { color: var(--error); }
.pipeline .pstep.is-empty   { opacity: 0.45; }

.pipeline .arrow { color: var(--fg-dim); user-select: none; padding: 0 1px; }

/* === Scrollbars ======================================================== */

* { scrollbar-width: thin; scrollbar-color: var(--ctp-surface1) transparent; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--ctp-surface1);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background-color: var(--ctp-surface2);
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }

/* === Focus ring ======================================================== */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* === Motion preferences ================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
