/* Каркас рабочего пространства LitHome (Apple Flat Minimalism, без теней и глобальной topbar) */
.lh-fixed-view {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius-surface);
    border: 1px solid var(--divider);
}

.lh-pane-box {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 16px 20px;
    gap: 12px;
    flex: 1;
}

.lh-pane-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.lh-loader-bar, #global-loader, #loading-pill, .lh-mobile-only, .lh-mobile-dock, .lh-viewport-fade-top, .lh-viewport-fade-bottom {
    display: none !important;
    animation: none !important;
}

@keyframes lhSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes lhGSpinRotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes lhGSpinDash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 92, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 92, 150;
        stroke-dashoffset: -124;
    }
}

.lh-spinner {
    animation: lhSpin 0.75s linear infinite;
}

.lh-gspinner {
    animation: lhGSpinRotate 1.75s linear infinite;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    color: currentColor;
}

.lh-gspinner-arc {
    animation: lhGSpinDash 1.35s ease-in-out infinite;
}

.lh-center-spinner-box {
    width: 100%;
    min-height: 240px;
    padding: 36px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: var(--text);
}

.lh-center-spinner-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.lh-center-spinner-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.lh-auth-gate {
    position: fixed;
    inset: 0;
    z-index: 990;
    background: var(--canvas);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lh-auth-card {
    width: min(410px, 100%);
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 22px;
    padding: 28px 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lh-auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 4px;
}

.lh-auth-title {
    font-size: 20px;
    line-height: 24px;
    font-weight: 600;
    color: var(--text);
}

.lh-auth-error {
    background: var(--semantic-err-bg);
    color: var(--semantic-err);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
}

.lh-auth-hint {
    text-align: center;
    padding-top: 2px;
}

.lh-shell {
    display: flex;
    min-height: 100dvh;
}

body.is-no-page-scroll .lh-shell {
    height: 100dvh;
    overflow: hidden;
}

.lh-sidebar {
    position: fixed;
    top: var(--shell-inset);
    left: var(--shell-inset);
    bottom: var(--shell-inset);
    width: var(--sidebar-width);
    height: calc(100dvh - 2 * var(--shell-inset));
    /* background: var(--surface); */
    /* border: 1px solid var(--divider); */
    /* border-radius: var(--radius-sidebar); */
    padding: var(--sidebar-padding);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 80;
}

.lh-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 8px;
}

.lh-brand-logo {
    color: var(--text);
    flex-shrink: 0;
    display: block;
}

.lh-brand-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 20px;
    letter-spacing: -0.02em;
}

.lh-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: none;
}

.lh-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.lh-nav-group-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted-text);
    padding: 10px 10px 4px;
    letter-spacing: 0.04em;
}

.lh-nav-item-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lh-nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: var(--nav-item-height);
    padding: 0 10px;
    border: 0;
    outline: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background-color 90ms ease;
}

.lh-nav-btn:hover {
    background: var(--hover);
}

.lh-nav-btn.is-active {
    background: var(--accent-primary);
    color: var(--surface);
    font-weight: 500;
}

.lh-nav-alert-pill {
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--semantic-err);
    color: var(--surface);
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lh-nav-subtabs {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 4px 26px;
}

.lh-nav-subtabs.is-open {
    display: flex;
}

.lh-nav-subbtn {
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--secondary-text);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lh-nav-subbtn:hover {
    background: var(--hover);
    color: var(--text);
}

.lh-nav-subbtn.is-sub-active {
    background: var(--field);
    color: var(--text);
    font-weight: 600;
}

.lh-lottie-wrap {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: none;
}

.lh-lottie-canvas {
    width: 20px;
    height: 20px;
    display: block;
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 180ms var(--ease-apple), transform 180ms var(--ease-apple);
}

.lh-lottie-canvas.is-ready {
    opacity: 0.86;
    transform: scale(1);
}

.lh-nav-btn.is-active .lh-lottie-canvas {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.lh-nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lh-sidebar-footer {
    padding-top: 8px;
    border-top: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.lh-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.lh-sidebar-quick-link {
    height: 34px;
    width: 100%;
    padding: 0 10px;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--secondary-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background-color 90ms ease, color 90ms ease;
}

.lh-sidebar-quick-link:hover {
    background: var(--hover);
    color: var(--text);
}

.lh-sidebar-quick-lead {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lh-sidebar-user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 6px 6px 10px;
    border-radius: var(--radius-control);
    background: var(--canvas);
    min-height: 46px;
}

.lh-sidebar-user-meta {
    min-width: 0;
    flex: 1;
    border: 0;
    background: transparent;
    padding: 2px 0;
    text-align: left;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 1px;
    cursor: pointer;
    border-radius: 6px;
}

.lh-sidebar-user-meta:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.lh-sidebar-user-bar:hover {
    background: var(--hover);
}

.lh-sidebar-user-meta strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lh-sidebar-user-meta span {
    font-size: 11.5px;
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lh-main {
    margin-left: calc(var(--sidebar-width) + var(--shell-inset) + var(--page-gap));
    padding: var(--shell-inset) var(--page-gap) var(--shell-inset) 0;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.lh-main.is-viewport-locked {
    height: 100dvh;
    overflow: hidden;
}

.lh-viewport {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    flex: 1;
    min-height: 0;
}

.lh-main.is-viewport-locked > .lh-viewport {
    overflow: hidden;
}

.lh-tab-mount {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.lh-main.is-viewport-locked .lh-tab-mount {
    height: 100%;
    overflow: hidden;
}

.lh-topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--related-gap);
    flex-wrap: wrap;
}

.lh-mac-settings-shell {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-surface);
    overflow: hidden;
}

.lh-mac-settings-nav {
    border-right: 1px solid var(--divider);
    background: var(--canvas);
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    scrollbar-width: none;
}

.lh-mac-settings-nav::-webkit-scrollbar {
    width: 0;
}

.lh-mac-settings-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--surface);
}

.lh-mac-settings-head {
    padding: 18px 26px 14px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
}

.lh-mac-settings-head h2 {
    font-size: 18px;
    line-height: 22px;
    font-weight: 600;
    color: var(--text);
}

.lh-mac-settings-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
