.coop-shell-body {
    margin: 0;
    min-height: 100vh;
    color: #eaf1ff;
    background:
        radial-gradient(circle at 8% 12%, rgba(68, 44, 170, 0.42), transparent 42%),
        radial-gradient(circle at 95% -4%, rgba(22, 120, 255, 0.28), transparent 38%),
        linear-gradient(160deg, #040710 0%, #070d19 46%, #050810 100%);
    font-family: Inter, "Segoe UI", Roboto, sans-serif;
}

.coop-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.coop-shell-sidebar {
    border-right: 1px solid rgba(125, 136, 200, 0.28);
    background: linear-gradient(170deg, rgba(14, 12, 34, 0.95), rgba(7, 10, 19, 0.94));
    padding: 16px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.coop-shell-brand {
    display: grid;
    gap: 6px;
}

.coop-shell-brand__kicker {
    display: inline-flex;
    width: fit-content;
    min-height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(136, 111, 255, 0.5);
    background: rgba(49, 34, 107, 0.7);
    color: #d7ceff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    align-items: center;
    padding: 0 10px;
}

.coop-shell-brand h1 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.2;
}

.coop-shell-brand p {
    margin: 0;
    color: #9fafcc;
    font-size: 0.8rem;
}

.coop-shell-nav {
    display: grid;
    gap: 8px;
}

.coop-shell-nav a {
    min-height: var(--ss-viewport-touch, 44px);
    min-inline-size: max-content;
    border-radius: 12px;
    border: 1px solid rgba(135, 118, 238, 0.28);
    background: rgba(14, 18, 33, 0.92);
    color: #dce5ff;
    text-decoration: none;
    font-size: var(--ss-text-sm, 0.84rem);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-inline: var(--ss-btn-pad-x, clamp(10px, 2.4vw, 14px));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-inline-size: 100%;
}

.coop-shell-nav__badge {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(164, 145, 255, 0.72);
    background: rgba(56, 42, 130, 0.95);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.coop-shell-nav a:hover,
.coop-shell-nav a:focus-visible {
    border-color: rgba(161, 146, 255, 0.7);
    color: #fff;
}

.coop-shell-nav a.is-active {
    border-color: rgba(157, 136, 255, 0.86);
    background: linear-gradient(135deg, rgba(60, 40, 142, 0.92), rgba(38, 30, 100, 0.9));
    color: #fff;
    box-shadow: 0 8px 20px rgba(34, 27, 85, 0.4);
}

.coop-shell-sidebar-foot {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    border-top: 1px solid rgba(120, 134, 196, 0.24);
    padding-top: 8px;
    margin-top: auto;
}

.coop-shell-sidebar-foot .su-locale-switch__select {
    min-height: 34px;
    font-size: 0.74rem;
}

.coop-shell-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.coop-shell-topbar {
    border-bottom: 1px solid rgba(126, 143, 210, 0.24);
    backdrop-filter: blur(8px);
    background: rgba(8, 12, 22, 0.82);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.coop-shell-topbar__title h2 {
    margin: 0;
    font-size: 1.18rem;
}

.coop-shell-topbar__title p {
    margin: 3px 0 0;
    color: #adbddd;
    font-size: 0.84rem;
}

.coop-shell-topbar__actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.coop-shell-topbar__actions a {
    min-height: var(--ss-btn-h-sm, 36px);
    min-inline-size: max-content;
    border-radius: 10px;
    border: 1px solid rgba(130, 149, 224, 0.34);
    background: rgba(14, 19, 34, 0.92);
    color: #dce5ff;
    text-decoration: none;
    font-size: var(--ss-text-sm, 0.8rem);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    padding-inline: var(--ss-btn-pad-x, clamp(10px, 2.4vw, 14px));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-inline-size: 100%;
}

.coop-shell-content {
    padding: 14px 16px 90px;
}

/* Workspace: Sidebar fix, Hauptinhalt scrollt (Hilfe, Recht, lange Dashboards) */
.coop-shell-body:not(.is-coop-entry) .coop-shell {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.coop-shell-body:not(.is-coop-entry) .coop-shell-sidebar {
    height: 100dvh;
    overflow-y: auto;
}

.coop-shell-body:not(.is-coop-entry) .coop-shell-main {
    min-height: 0;
    overflow: hidden;
}

.coop-shell-body:not(.is-coop-entry) .coop-shell-content {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.coop-entry-surface {
    display: grid;
    gap: clamp(0.85rem, 2vw, 1.25rem);
    width: min(1440px, 100%);
    margin: 0 auto;
}

/* Entry: eine Viewport-Höhe, nur Content scrollt */
.is-coop-entry.coop-shell-body {
    overflow: hidden;
    height: 100dvh;
}

.is-coop-entry.coop-shell {
    height: 100dvh;
    overflow: hidden;
}

.is-coop-entry .coop-shell-sidebar {
    height: 100dvh;
    overflow: hidden;
}

.is-coop-entry .coop-shell-main {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.is-coop-entry .coop-shell-topbar {
    flex-shrink: 0;
    padding: 6px 12px;
}

.is-coop-entry .coop-shell-topbar__title h2 {
    font-size: 0.88rem;
    line-height: 1.2;
}

.is-coop-entry .coop-shell-topbar__title p {
    font-size: 0.62rem;
    line-height: 1.28;
}

.is-coop-entry .coop-shell-topbar__actions a {
    min-height: 26px;
    font-size: 0.62rem;
    border-radius: 999px;
    padding: 0 0.55rem;
}

.is-coop-entry .coop-shell-content {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 10px 14px 72px;
    -webkit-overflow-scrolling: touch;
}

.is-coop-entry .coop-shell-nav a {
    min-height: 34px;
    font-size: 0.72rem;
    border-radius: 999px;
}

.is-coop-entry .coop-shell-brand h1 {
    font-size: 0.82rem;
}

.is-coop-entry .coop-shell-brand p {
    font-size: 0.6rem;
}

.coop-shell-flashes {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.coop-shell-flash {
    border-radius: 11px;
    border: 1px solid rgba(120, 140, 186, 0.45);
    background: rgba(9, 14, 27, 0.9);
    padding: 10px 12px;
}

.coop-shell-flash--success {
    border-color: rgba(34, 197, 94, 0.45);
}

.coop-shell-flash--warning {
    border-color: rgba(245, 158, 11, 0.5);
}

.coop-shell-flash--danger,
.coop-shell-flash--error {
    border-color: rgba(239, 68, 68, 0.55);
}

.coop-support-widget {
    position: fixed;
    right: 18px;
    bottom: 16px;
    z-index: 45;
}

.coop-support-widget__launcher {
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(157, 136, 255, 0.78);
    background: linear-gradient(135deg, #2f216d, #1e1646);
    color: #f3f5ff;
    font-weight: 800;
    padding: 0 14px;
    cursor: pointer;
}

.coop-support-widget__panel {
    width: min(360px, calc(100vw - 22px));
    height: min(74vh, 620px);
    border-radius: 16px;
    border: 1px solid rgba(130, 111, 248, 0.48);
    background: linear-gradient(160deg, rgba(8, 12, 24, 0.98), rgba(12, 8, 26, 0.96));
    box-shadow: 0 26px 60px rgba(1, 3, 8, 0.62);
    margin-top: 10px;
    display: none;
    grid-template-rows: auto auto 1fr auto auto;
    overflow: hidden;
}

.coop-support-widget.is-open .coop-support-widget__panel {
    display: grid;
}

.coop-support-widget__head {
    padding: 12px;
    border-bottom: 1px solid rgba(118, 133, 194, 0.28);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.coop-support-widget__head h3 {
    margin: 0;
    font-size: 0.95rem;
}

.coop-support-widget__head p {
    margin: 3px 0 0;
    color: #b7c4df;
    font-size: 0.78rem;
}

.coop-support-widget__close {
    min-height: 30px;
    min-width: 30px;
    border-radius: 9px;
    border: 1px solid rgba(138, 157, 235, 0.42);
    background: rgba(13, 19, 34, 0.95);
    color: #dce5ff;
    cursor: pointer;
}

.coop-support-widget__prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(118, 133, 194, 0.2);
}

.coop-support-widget__prompts button {
    min-height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(130, 149, 224, 0.34);
    background: rgba(14, 19, 34, 0.9);
    color: #dce5ff;
    font-size: 0.72rem;
    padding: 0 10px;
    cursor: pointer;
}

.coop-support-widget__log {
    overflow-y: auto;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.coop-support-widget__entry {
    display: flex;
}

.coop-support-widget__entry.is-user {
    justify-content: flex-end;
}

.coop-support-widget__entry p {
    margin: 0;
    max-width: 90%;
    border-radius: 12px;
    border: 1px solid rgba(130, 149, 224, 0.28);
    background: rgba(16, 21, 36, 0.92);
    padding: 8px 10px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.coop-support-widget__entry.is-user p {
    border-color: rgba(157, 136, 255, 0.48);
    background: rgba(48, 35, 110, 0.86);
}

.coop-support-widget__handoff {
    padding: 9px 10px;
    border-top: 1px solid rgba(118, 133, 194, 0.24);
    display: grid;
    gap: 7px;
}

.coop-support-widget__handoff button {
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(130, 149, 224, 0.34);
    background: rgba(14, 19, 34, 0.9);
    color: #dce5ff;
    font-weight: 700;
    cursor: pointer;
}

.coop-support-widget__handoff button.is-primary {
    border-color: rgba(157, 136, 255, 0.86);
    background: linear-gradient(135deg, #2f216d, #1e1646);
    color: #fff;
}

.coop-support-widget__composer {
    border-top: 1px solid rgba(118, 133, 194, 0.24);
    display: flex;
    gap: 6px;
    padding: 10px;
}

.coop-support-widget__composer input {
    flex: 1;
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(136, 156, 255, 0.34);
    background: #070b14;
    color: #f7f9ff;
    padding: 0 10px;
}

.coop-support-widget__composer button {
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(157, 136, 255, 0.86);
    background: linear-gradient(135deg, #2f216d, #1e1646);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    padding: 0 12px;
}

.coop-support-widget__status {
    margin: 0;
    font-size: 0.72rem;
    color: #9cb1db;
}

@media (max-width: 980px) {
    .coop-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .is-coop-entry.coop-shell {
        height: 100dvh;
        grid-template-rows: auto 1fr;
        display: grid;
    }

    .coop-shell-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(125, 136, 200, 0.28);
        height: auto;
        max-height: none;
        flex-shrink: 0;
    }

    .is-coop-entry .coop-shell-sidebar {
        height: auto;
    }

    .coop-shell-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
    }

    .coop-shell-nav a {
        flex: 0 0 auto;
        min-height: 38px;
    }

    .coop-shell-sidebar-foot {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .coop-shell-topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 10px 12px;
    }

    .coop-shell-content {
        padding: 10px 10px 88px;
    }

    .coop-shell-topbar__actions a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .coop-support-widget {
        right: 10px;
        bottom: 10px;
    }
}
