:root {
    --shell-bg: #08080a;
    --shell-panel: #121217;
    --shell-panel-2: #181820;
    --shell-text: #f7f8ff;
    --shell-muted: #9ca3af;
    --shell-border: rgba(255,255,255,.11);
    --shell-accent: var(--accent, #2e5bff);
}

.ai-shell-header {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(210px, 1.1fr) minmax(220px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--shell-border);
    background: rgba(8,8,10,.94);
    color: var(--shell-text);
    position: relative;
    z-index: 20;
}

.ai-shell-brand a,
.ai-shell-title strong {
    display: block;
    color: var(--shell-text);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 0;
}

.ai-shell-brand span,
.ai-shell-title span,
.ai-shell-footer span:last-child {
    display: block;
    color: var(--shell-muted);
    font-size: 11px;
    line-height: 1.35;
    margin-top: 2px;
}

.ai-shell-title strong {
    color: var(--shell-accent);
}

.ai-shell-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-shell-nav a,
.ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid var(--shell-border);
    border-radius: 8px;
    background: var(--shell-panel-2);
    color: var(--shell-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.ai-shell-nav a.active,
.ai-btn.primary {
    background: var(--shell-accent);
    border-color: transparent;
    color: #fff;
}

.ai-shell-nav a.logout {
    color: #ff7b7b;
}

.ai-shell-extra {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-shell-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid var(--shell-border);
    background: rgba(8,8,10,.92);
    color: var(--shell-muted);
    font-size: 12px;
}

@media (max-width: 860px) {
    .ai-shell-header {
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 10px 12px;
    }
    .ai-shell-nav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    .ai-shell-nav::-webkit-scrollbar { display: none; }
    .ai-shell-nav a { flex: 0 0 auto; }
    .ai-shell-footer {
        flex-direction: column;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }
}
