/* THE CLOSED DRAWER'S ICON RAIL (issue #990, Adam (Adoom666), 2026-09-27).
 *
 * On a desktop (1024px and up) a closed agents drawer collapses to a narrow
 * column of icons instead of vanishing: the claw that reopens it, the two
 * drawer tabs, then one icon per item of the tab showing
 * (web/src/lib/mini-rail/MiniRail.svelte, mounted into #session-sidebar-rail).
 * `body.session-sidebar-railed` is put on and taken off by
 * web/src/lib/drawer/pin.ts, the one place that already decides
 * whether the drawer is docked; below 1024 it never lands, so the phone is
 * untouched.
 *
 * The layout half sets the docked drawer's `--dock-offset` token
 * (session-sidebar.css) to the rail's width: the screens, the home screen
 * and the header make room for it rather than sit under it. */

@layer components {
:root {
    --sidebar-rail-w: 48px;
}

#session-sidebar-rail {
    display: none;
}

body.session-sidebar-railed #session-sidebar-rail {
    display: block;
}

/* The rail sets the same `--dock-offset` token the docked drawer does
 * (session-sidebar.css), which `.screen`, `#launchpad-screen` and `.header`
 * read; see the reasoning there for why it is a token. */
body.session-sidebar-railed {
    --dock-offset: var(--sidebar-rail-w);
}

/* The rail's claw is the way back to the drawer now, so the header's own
 * drawer toggle stands down while the rail is up. */
body.session-sidebar-railed #session-sidebar-toggle {
    display: none;
}

/* THE TERMINAL PAGE'S EMPTY TOP BAR GOES. With the drawer closed that bar
 * held only the drawer toggle and the brand claw (every session control in
 * it is already hidden on this page at this width: terminal-grid.css and
 * terminal-empty.css), and the rail carries both jobs, so the page starts
 * at the top. The drawer-open case is terminal-grid.css's own rule. */
body.session-sidebar-railed.ps-terminal-active .header {
    display: none;
}
}
