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

body {
    background: var(--bg1);
    font-family: var(--mono);
    color: var(--fg);
}

/* Boot screen */

.boot {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 560px;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: var(--bg1);
}

.boot-prompt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

/* Portfolio shell */

.tui-root {
    display: none;
    flex-direction: column;
    height: 100vh;
    min-height: 560px;
    background: var(--bg1);
}

.tui-root.visible {
    display: flex;
}

/* Tabline */

.tabline {
    background: var(--bg1);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    height: 32px;
    flex-shrink: 0;
}

.tab {
    padding: 0 16px;
    height: 32px;
    display: flex;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
    color: var(--fg-dim);
    border-right: 1px solid var(--border);
    transition: all 0.15s;
    gap: 6px;
    user-select: none;
}

.tab:hover { color: var(--fg); background: var(--bg2); }

.tab.active {
    background: var(--bg);
    color: var(--fg);
    border-bottom: 2px solid var(--blue);
}

.tabline-space { flex: 1; }

.tabline-right {
    padding: 0 12px;
    font-size: 11px;
    color: var(--fg-dim);
}

/* Main area */

.main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */

.sidebar {
    width: 200px;
    background: var(--bg1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-title {
    padding: 4px 12px;
    font-size: 10px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-item {
    padding: 4px 12px 4px 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-dim);
    transition: all 0.1s;
    user-select: none;
}

.sidebar-item:hover  { background: var(--bg3); color: var(--fg); }
.sidebar-item.active { background: var(--bg4); color: var(--blue); }

.sidebar-item .item-icon {
    width: 14px;
    text-align: center;
    font-size: 11px;
}

.sidebar-bottom {
    padding: 8px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.sys-line {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    padding: 2px 0;
}

/* Content */

.content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
}

.content::-webkit-scrollbar       { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Panes */

.pane {
    display: none;
    flex-direction: column;
}

.pane.active {
    display: flex;
    animation: fade-in 0.3s ease both;
}

.pane-header {
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.pane-body {
    padding: 18px 20px;
    overflow-y: auto;
}

.pane-body::-webkit-scrollbar       { width: 4px; }
.pane-body::-webkit-scrollbar-thumb { background: var(--border); }

/* Mobile */

@media (max-width: 768px) {
    .sidebar { display: none; }

    .tabline-wrap { position: relative; }

    .tabline-wrap::before,
    .tabline-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 48px;
        pointer-events: none;
        z-index: 1;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .tabline-wrap::before {
        left: 0;
        background: linear-gradient(to right, var(--bg1), transparent);
    }

    .tabline-wrap::after {
        right: 0;
        background: linear-gradient(to left, var(--bg1), transparent);
    }

    .tabline-wrap.fade-left::before  { opacity: 1; }
    .tabline-wrap.fade-right::after  { opacity: 1; }

    .tabline { overflow-x: auto; }
    .tabline::-webkit-scrollbar { display: none; }
    .tab { flex-shrink: 0; }
    .tabline-space,
    .tabline-right { display: none; }

    .st-branch,
    .st-sep,
    .st-lsp,
    .st-ft { display: none; }
}

/* Statusline */

.statusline {
    background: var(--bg1);
    border-top: 1px solid var(--border);
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    flex-shrink: 0;
    font-size: 11px;
}
