/* First paint mirrors the actual empty-chat screen while app data initializes. */
html.logicum-booting {
    background: var(--logicum-boot-surface, #242424);
}

/* Hydrate the real shell behind the preview without sliding the sidebar in
   during the short fade from the boot screen to the ready chat. */
html.logicum-booting body .sidebar,
html.logicum-booting body .main-content,
html.logicum-booting body .mobile-sidebar-backdrop {
    transition: none !important;
}

#logicumBootShell,
#logicumBootShell * {
    box-sizing: border-box;
}

#logicumBootShell {
    position: fixed;
    z-index: 20000;
    inset: 0;
    display: flex;
    overflow: hidden;
    background: var(--logicum-boot-surface, #242424);
    color: var(--logicum-boot-ink, #eeeeee);
    opacity: 1;
    visibility: visible;
    transition: opacity 140ms ease, visibility 0s linear 140ms;
}

html:not(.logicum-booting) #logicumBootShell {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.logicum-boot-sidebar {
    display: flex;
    flex: 0 0 var(--sidebar-expanded-width, 260px);
    flex-direction: column;
    width: var(--sidebar-expanded-width, 260px);
    min-width: 0;
    overflow: hidden;
    background: var(--logicum-boot-sidebar, #202020);
    border: 1px solid color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 6%, transparent);
    border-left-color: transparent;
    border-radius: 0 18px 18px 0;
}

.logicum-boot-sidebar-header {
    display: flex;
    flex: 0 0 87px;
    align-items: center;
    gap: 10px;
    padding: 24px 20px 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 6%, transparent);
}

.logicum-boot-sidebar-brand {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-bottom: 0;
}

.logicum-boot-sidebar-logo {
    display: block;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 18px;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));
}

.logicum-boot-sidebar-wordmark {
    color: var(--logicum-boot-ink, #eeeeee);
    font: 600 22px/normal 'Space Grotesk', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: -.03em;
}

.logicum-boot-sidebar-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: auto;
    border-radius: 8px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 10%, transparent);
}

.logicum-boot-sidebar-toggle svg {
    display: none;
}

.logicum-boot-skeleton {
    display: block;
    flex: 0 0 auto;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 12%, transparent);
    animation: logicum-boot-pulse 1.6s ease-in-out infinite;
}

.logicum-boot-sidebar-nav {
    display: flex;
    flex-direction: column;
    align-content: start;
    gap: 6px;
    margin-bottom: 8px;
    padding: 16px 12px;
}

.logicum-boot-nav-item,
.logicum-boot-agenda {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 55.8px;
    padding: 11px 14px;
    border-radius: 11px;
}

.logicum-boot-nav-item.is-active {
    border: 1px solid color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 11%, transparent);
    border-left: 2px solid color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 72%, transparent);
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 6.7%, transparent);
}

.logicum-boot-nav-icon,
.logicum-boot-agenda-icon {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 68%, transparent);
}

.logicum-boot-nav-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.logicum-boot-nav-copy strong {
    display: block;
    width: 62px;
    height: 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 18%, transparent);
    color: transparent;
    font-size: 0;
    line-height: 0;
    animation: logicum-boot-pulse 1.6s ease-in-out infinite;
}

.logicum-boot-nav-copy small {
    display: block;
    width: 91px;
    height: 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 12%, transparent);
    color: transparent;
    font-size: 0;
    line-height: 0;
    animation: logicum-boot-pulse 1.6s ease-in-out infinite;
}

.logicum-boot-nav-item:nth-child(2) .logicum-boot-nav-copy strong { width: 76px; }
.logicum-boot-nav-item:nth-child(2) .logicum-boot-nav-copy small { width: 72px; }
.logicum-boot-nav-item:nth-child(3) .logicum-boot-nav-copy strong { width: 97px; }
.logicum-boot-nav-item:nth-child(3) .logicum-boot-nav-copy small { width: 104px; }
.logicum-boot-agenda .logicum-boot-nav-copy strong { width: 53px; }
.logicum-boot-agenda .logicum-boot-nav-copy small { width: 90px; }

.logicum-boot-sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 7%, transparent);
}

.logicum-boot-agenda {
    min-height: 54px;
    margin-bottom: 8px;
    padding: 9px 12px;
}

.logicum-boot-sidebar-footer {
    display: flex;
    align-items: center;
    min-height: 56px;
}

.logicum-boot-profile {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 56px;
    padding: 8px 12px;
}

.logicum-boot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.logicum-boot-profile-name {
    width: 47px;
    height: 10px;
    border-radius: 999px;
    opacity: .5;
}

.logicum-boot-profile-settings {
    width: 18px;
    height: 18px;
    margin-left: auto;
    border-radius: 5px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 12%, transparent);
    color: transparent;
}

.logicum-boot-workspace {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--logicum-boot-surface, #242424);
}

.logicum-boot-topbar {
    position: absolute;
    z-index: 1;
    inset: 0 0 auto;
    height: 110px;
    padding: 0 28px 0 20px;
}

.logicum-boot-topbar-main {
    position: relative;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 10px;
}

.logicum-boot-back-link {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--logicum-boot-ink, #eeeeee);
    font: 500 14px/1.2 "Manrope", sans-serif;
}

.logicum-boot-back-link svg {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 14%, transparent);
    color: transparent;
}

.logicum-boot-back-link span {
    display: block;
    width: 44px;
    height: 11px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 17%, transparent);
    color: transparent;
    font-size: 0;
}

.logicum-boot-mode-switch {
    display: flex;
    align-items: center;
    width: 206px;
    height: 34px;
    margin-left: auto;
    padding: 2px;
    border: 1px solid color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 10%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 5%, transparent);
    color: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 64%, transparent);
    font: 600 12px/1 "Manrope", sans-serif;
}

.logicum-boot-mode-switch span {
    display: grid;
    flex: 1 1 0;
    place-items: center;
    height: 28px;
    white-space: nowrap;
}

.logicum-boot-mode-switch .is-selected {
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 9%, transparent);
    color: transparent;
}

.logicum-boot-mode-switch span {
    position: relative;
    color: transparent;
    font-size: 0;
}

.logicum-boot-mode-switch span::after {
    display: block;
    width: 46px;
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 19%, transparent);
    animation: logicum-boot-pulse 1.6s ease-in-out infinite;
    content: "";
}

.logicum-boot-mode-switch .is-selected::after { width: 58px; }

.logicum-boot-topbar-menu {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 10%, transparent);
    color: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 67%, transparent);
}

.logicum-boot-topbar-menu svg {
    display: none;
}

.logicum-boot-mobile-menu { display: none; }

.logicum-boot-search {
    position: absolute;
    top: 72px;
    left: 0;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 10%, transparent);
}

.logicum-boot-search svg {
    display: none;
}

.logicum-boot-content {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding: clamp(170px, 25vh, 260px) 24px 28px;
}

.logicum-boot-empty-state {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    width: min(100%, 960px);
    text-align: center;
}

.logicum-boot-logo {
    display: block;
    width: 104px;
    height: 104px;
    margin: 0 auto 28px;
    object-fit: contain;
}

.logicum-boot-title-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: min(100%, 900px);
}

.logicum-boot-title-lines i {
    position: relative;
    width: min(880px, 92%);
    height: clamp(30px, 2.6vw, 50px);
    background: transparent;
    animation: none;
}

.logicum-boot-title-lines i::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: clamp(16px, 1.2vw, 23px);
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 12%, transparent);
    animation: logicum-boot-pulse 1.6s ease-in-out infinite;
    content: "";
    transform: translateY(-50%);
}

.logicum-boot-title-lines i + i { display: block; width: min(175px, 25%); }

.logicum-boot-subtitle-line {
    position: relative;
    width: 116px;
    height: 20.3px;
    margin-top: 20px;
    background: transparent;
    animation: none;
}

.logicum-boot-subtitle-line::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 12%, transparent);
    animation: logicum-boot-pulse 1.6s ease-in-out infinite;
    content: "";
    transform: translateY(-50%);
}

/* Quick-action pills mirror the three welcome buttons (Upload / New Chat / Mind Map)
   as calm neutral shapes — recognizable, without icons or labels. */
.logicum-boot-quick-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.logicum-boot-quick-actions i {
    display: block;
    width: 148px;
    height: 44px;
    border: 1px solid color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 9%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 6%, transparent);
    animation: logicum-boot-pulse 1.6s ease-in-out infinite;
}

.logicum-boot-quick-actions i:nth-child(2) { width: 132px; }
.logicum-boot-quick-actions i:nth-child(3) { width: 140px; }

.logicum-boot-composer-dock {
    width: min(100%, 990px);
    margin: 45px auto 0;
    padding: 0;
}

.logicum-boot-composer {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto 38px 40px;
    grid-template-rows: auto 40px;
    align-items: stretch;
    column-gap: 8px;
    row-gap: 2px;
    width: 100%;
    min-height: 165px;
    padding: 10px 12px 8px;
    border: 1px solid color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 8%, transparent);
    border-radius: 20px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 4%, transparent);
}

.logicum-boot-composer-placeholder {
    position: relative;
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: start;
    width: min(190px, 58%);
    height: 16px;
    margin: 4px 8px 0;
    background: transparent;
    animation: none;
}

.logicum-boot-composer-placeholder::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 12%, transparent);
    animation: logicum-boot-pulse 1.6s ease-in-out infinite;
    content: "";
    transform: translateY(-50%);
}

.logicum-boot-composer-control {
    display: grid;
    justify-self: center;
    align-self: center;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 15%, transparent);
    color: transparent;
}

.logicum-boot-composer-control svg {
    display: none;
}

.logicum-boot-voice svg { width: 18px; height: 18px; }

.logicum-boot-attach { grid-column: 1; grid-row: 2; }
.logicum-boot-voice { grid-column: 4; grid-row: 2; }

.logicum-boot-speed-control {
    display: flex;
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    min-width: 108.64px;
    margin: 0 1px;
    color: transparent;
}

.logicum-boot-speed-gauge {
    display: block;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 13%, transparent);
    color: transparent;
}

.logicum-boot-speed-label {
    display: block;
    width: 38px;
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 17%, transparent);
    font-size: 0;
}

.logicum-boot-speed-chevron {
    display: block;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 13%, transparent);
    color: transparent;
}

.logicum-boot-send {
    grid-column: 5;
    grid-row: 2;
    justify-self: center;
    align-self: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 18%, transparent);
    color: transparent;
}

.logicum-boot-send svg {
    display: none;
}

@keyframes logicum-boot-pulse {
    0%, 100% { opacity: .42; }
    50% { opacity: .78; }
}

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

    .logicum-boot-topbar {
        height: 64px;
        padding: 0;
    }

    .logicum-boot-topbar-main {
        height: 64px;
        border-bottom: 0;
    }

    .logicum-boot-back-link { display: none; }

    .logicum-boot-mobile-menu {
        position: absolute;
        top: calc(8px + env(safe-area-inset-top, 0px));
        left: calc(12px + env(safe-area-inset-left, 0px));
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: color-mix(in srgb, var(--logicum-boot-ink, #eeeeee) 10%, transparent);
    }

    .logicum-boot-mobile-menu svg {
        display: none;
    }

    .logicum-boot-mode-switch {
        position: absolute;
        top: calc(8px + env(safe-area-inset-top, 0px));
        left: 50%;
        width: min(226px, calc(100vw - 112px));
        height: 44px;
        margin: 0;
        transform: translateX(-50%);
    }

    .logicum-boot-topbar-menu {
        position: absolute;
        top: calc(14px + env(safe-area-inset-top, 0px));
        right: calc(14px + env(safe-area-inset-right, 0px));
    }

    .logicum-boot-search {
        top: calc(66px + env(safe-area-inset-top, 0px));
        left: calc(14px + env(safe-area-inset-left, 0px));
    }

    .logicum-boot-content {
        justify-content: center;
        /* The real empty state centers its greeting in #chatMessages after
           reserving 184px for the dock and safe area. Mirror that same space. */
        padding: calc(82px + env(safe-area-inset-top, 0px)) 14px calc(374px + 2 * env(safe-area-inset-bottom, 0px));
    }

    .logicum-boot-empty-state {
        width: 100%;
        max-width: 680px;
    }

    .logicum-boot-logo {
        width: 88px;
        height: 88px;
        margin-bottom: 16px;
    }

    .logicum-boot-title-lines {
        gap: 0;
        width: min(100%, 680px);
    }

    .logicum-boot-title-lines i {
        width: 92%;
        height: 26.84px;
    }

    .logicum-boot-title-lines i::before { height: 16px; }

    .logicum-boot-title-lines i + i {
        display: block;
        width: 25%;
    }

    .logicum-boot-subtitle-line { margin-top: 10px; }

    .logicum-boot-quick-actions {
        gap: 8px;
        margin-top: 22px;
    }

    .logicum-boot-quick-actions i {
        width: 118px;
        height: 40px;
    }

    .logicum-boot-quick-actions i:nth-child(2) { width: 106px; }
    .logicum-boot-quick-actions i:nth-child(3) { display: none; }

    .logicum-boot-composer-dock {
        position: absolute;
        right: 0;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
        left: 0;
        width: 100%;
        margin: 0;
        padding: 8px 14px;
        isolation: isolate;
    }

    .logicum-boot-composer-dock::before {
        position: absolute;
        z-index: -1;
        inset: 0 0 calc(-1 * (env(safe-area-inset-bottom, 0px) + 6px));
        background: color-mix(in srgb, var(--logicum-boot-surface, #242424) 92%, transparent);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        content: "";
        pointer-events: none;
    }

    .logicum-boot-composer {
        grid-template-columns: 38px minmax(0, 1fr) auto 38px 40px;
        grid-template-rows: auto 40px;
        width: 100%;
        min-height: 120px;
        padding: 10px 12px 8px;
    }

    .logicum-boot-composer-placeholder {
        width: min(190px, 70%);
        height: 15px;
    }

    .logicum-boot-composer-placeholder::before { height: 12px; }

    .logicum-boot-speed-gauge { width: 16px; height: 16px; }

    .logicum-boot-speed-control {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }
    .logicum-boot-speed-label,
    .logicum-boot-speed-chevron { display: none; }
}

@media (max-width: 380px) {
    .logicum-boot-mode-switch { width: min(204px, calc(100vw - 104px)); }
}

@media (max-height: 600px) {
    .logicum-boot-sidebar-bottom { padding-top: 6px; padding-bottom: 8px; }
    .logicum-boot-content { padding-top: 120px; }
    .logicum-boot-logo { width: 64px; height: 64px; margin-bottom: 10px; }
    .logicum-boot-subtitle-line { margin-top: 10px; }
}

@media (max-width: 768px) and (max-height: 600px) {
    .logicum-boot-content {
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(334px + 2 * env(safe-area-inset-bottom, 0px));
    }

    .logicum-boot-logo { width: 72px; height: 72px; margin-bottom: 10px; }
    .logicum-boot-title-lines i { height: 23px; }
}

@media (prefers-reduced-motion: reduce) {
    #logicumBootShell { transition: none; }
    .logicum-boot-skeleton { animation: none; }
    .logicum-boot-quick-actions i { animation: none; }
}
