/* Product-specific sidebar CHROME — InfinityAI projects & recent conversations.
   The route-bearing rows themselves reuse the canonical Infinity.AppShell navigation classes
   (infinity-nav-link / infinity-nav-link-active), so the active project/conversation shows the SAME selected
   surface (var(--air-selected)) as any shared nav item — InfinityAI owns no active-state styling. This file only
   styles non-navigation chrome: section headers, the row wrapper that positions the overflow menu, captions, the
   settings-close affordance, the made-in-sweden badge, and the access-request card. All values use --air-* tokens. */

.ai-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 8px 4px;
}

.ai-section-title {
    display: block;
    padding: 14px 8px 5px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--air-text);
    letter-spacing: -0.01em;
}

.ai-section-row .ai-section-title {
    padding: 0;
}

.ai-recent-title {
    padding-top: 16px;
}

.ai-section-action {
    color: var(--air-text) !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
}

    .ai-section-action .air-icon {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        stroke-width: 2;
    }

    .ai-section-action:hover {
        background: var(--air-hover) !important;
    }

.ai-nav {
    display: block;
    padding: 0;
    margin: 0;
}

/* ── Route-bearing rows ──────────────────────────────────────────────────────
   The link is a canonical Infinity.AppShell nav link (owns hover + active/selected surface + a11y). This wrapper
   only positions the trailing overflow menu so the canonical link can span the full row width. */
.ai-nav-row {
    position: relative;
}

    /* Room on the right so the title never sits under the overflow menu. */
    .ai-nav-row .infinity-nav-link {
        padding-right: 34px;
    }

.ai-row-menu {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0;
    color: var(--air-text);
    transition: opacity .15s ease;
}

    /* Reveal on hover, keyboard focus within the row, or when the row is the active route. */
    .ai-nav-row:hover .ai-row-menu,
    .ai-nav-row:focus-within .ai-row-menu,
    .ai-nav-row .infinity-nav-link-active ~ .ai-row-menu {
        opacity: 1;
    }

    .ai-row-menu .air-icon,
    .ai-row-menu svg {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        stroke-width: 2;
    }

    .ai-row-menu .mud-icon-root {
        font-size: 20px !important;
        color: var(--air-text) !important;
    }

.ai-menu-item-icon {
    margin-right: 8px;
}

.ai-icon-danger {
    color: var(--mud-palette-error) !important;
}

.ai-sidebar-caption {
    color: var(--air-text-muted);
    display: block;
    padding: 8px;
}

/* Focused settings pages hide the shell sidebar; this is the way back to chat. */
.ai-settings-fab {
    position: fixed;
    top: 24px;
    right: 32px;
    z-index: 1000;
}

.ai-fab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--air-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .15s ease, color .15s ease;
}

    .ai-fab-btn:hover {
        background: var(--air-hover);
        color: var(--air-text);
    }

    .ai-fab-btn .mud-icon-root {
        font-size: 20px;
        color: inherit;
    }

.made-in-sweden-badge {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
    pointer-events: none;
    opacity: 0.4;
}

    .made-in-sweden-badge img {
        height: 16px;
        width: auto;
        display: block;
    }

/* Access-request (private page) card — shown to authenticated users without InfinityAI access. */
.ai-public-shell {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--air-bg);
}

.ai-public-card {
    width: min(620px, 100%);
    padding: 32px;
    background: var(--air-surface);
    border: 1px solid var(--air-border);
    border-radius: 22px;
    box-shadow: var(--air-shadow-md);
    text-align: left;
}

@media (max-width: 959.98px) {
    .ai-public-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .ai-settings-fab {
        top: calc(env(safe-area-inset-top) + 12px);
        right: 12px;
    }
}
