
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --accent: #e04450;
    --bg: #17181d;
    --surface: #202127;
    --surface2: #252730;
    --text: #f2f2f4;
    --muted: #9295a1;
    --border: #30323c;
    --sidebar: #131419;
}

html[data-theme="light"] {
    --bg: #f1f2f5;
    --surface: #fff;
    --surface2: #f7f7f9;
    --text: #20212a;
    --muted: #6e7180;
    --border: #dfe1e7;
    --sidebar: #fff;
}

html[data-theme="black"] {
    --bg: #000;
    --surface: #090909;
    --surface2: #111;
    --text: #f5f5f5;
    --muted: #929292;
    --border: #292929;
    --sidebar: #050505;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Manrope, system-ui, sans-serif;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 245px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 27px 17px;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 13px;
    margin: 0 0 54px 7px;
}

.brand small {
    display: block;
    font: 10px 'DM Mono', monospace;
    color: var(--muted);
    letter-spacing: 3px;
    margin-top: 4px;
}

.brand-mark {
    width: 35px;
    height: 35px;
    border: 1px solid var(--accent);
    color: var(--accent);
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 19px;
}

.nav-label,
.eyebrow {
    font: 10px 'DM Mono', monospace;
    letter-spacing: 2px;
    color: var(--muted);
}

.nav-label {
    margin: 0 10px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 13px;
    border-radius: 8px;
    color: var(--muted);
    margin: 2px 0;
    font-weight: 600;
    transition: .2s;
}

.nav-link:hover,
.nav-link.active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--text);
}

.nav-link.active {
    box-shadow: inset 2px 0 var(--accent);
}

.online-dot,
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #46c58a;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 9px #46c58a;
}

.online-dot {
    margin-left: auto;
}

.sidebar-bottom {
    margin-top: auto;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding: 18px 5px 10px;
}

.user-chip strong,
.user-chip small {
    display: block;
}

.user-chip small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 22%, var(--surface));
    color: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.avatar.small {
    width: 29px;
    height: 29px;
}

.logout {
    background: none;
    border: 0;
    width: 100%;
    cursor: pointer;
    font: inherit;
}

.main-area {
    margin-left: 245px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 68px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4.5%;
    font: 10px 'DM Mono', monospace;
    letter-spacing: 1.5px;
    color: var(--muted);
}

.crumb span {
    padding: 0 9px;
    color: var(--accent);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.content {
    width: min(1120px, 91%);
    margin: 0 auto;
    padding: 58px 0 75px;
    flex: 1;
}

footer {
    border-top: 1px solid var(--border);
    padding: 19px 4.5%;
    font: 9px 'DM Mono', monospace;
    letter-spacing: 1px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}

/* STARTSEITE */

.hero {
    padding: 65px 0 70px;
    max-width: 720px;
}

.hero h1,
.page-heading h1,
.auth-card h1,
.luna-page h1 {
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.12;
    letter-spacing: -2.5px;
    margin: 20px 0;
}

.hero h1 span,
.page-heading h1 span,
.luna-page h1 span {
    color: var(--accent);
}

.hero p,
.muted {
    color: var(--muted);
    line-height: 1.8;
}

.hero p {
    max-width: 530px;
    font-size: 15px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    border: 1px solid var(--border);
    padding: 12px 17px;
    border-radius: 7px;
    font: 700 12px Manrope;
    cursor: pointer;
    transition: .2s;
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn.primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn.ghost {
    background: var(--surface);
    color: var(--text);
}

.btn.full {
    width: 100%;
    margin-top: 8px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 22px;
}

.feature-icon {
    width: 37px;
    height: 37px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 19px;
    margin-bottom: 20px;
}

.panel h3 {
    margin: 0 0 9px;
    font-size: 15px;
}

.panel p {
    color: var(--muted);
    line-height: 1.7;
    font-size: 12px;
    margin: 0;
}

/* LOGIN UND REGISTRIERUNG */

.auth-wrap {
    min-height: 65vh;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(440px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 34px;
}

.auth-card h1 {
    font-size: 30px;
    letter-spacing: -1px;
    margin: 14px 0 8px;
}

.form {
    display: grid;
    gap: 17px;
    margin-top: 27px;
}

.form label,
.settings-form > label {
    display: grid;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
}

.form label small {
    font-weight: 400;
    color: var(--muted);
}

input:not([type=radio]):not([type=color]) {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 13px;
    color: var(--text);
    font: 13px Manrope;
    outline: none;
}

input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.form-foot {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin: 22px 0 0;
}

.form-foot a {
    color: var(--accent);
    font-weight: 700;
}

.alert,
.success {
    padding: 12px 14px;
    border-radius: 7px;
    background: #6e2630;
    color: #ffd9dc;
    margin-top: 17px;
    font-size: 12px;
}

.success {
    background: #174c37;
    color: #c8f7df;
}

/* DASHBOARD */

.dashboard {
    width: 100%;
}

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 38px;
}

.dashboard-header h1 {
    font-size: clamp(30px, 4vw, 43px);
    letter-spacing: -2px;
    line-height: 1.15;
    margin: 15px 0 8px;
}

.dashboard-header .muted {
    margin: 0;
}

.system-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    font: 10px 'DM Mono', monospace;
    letter-spacing: 1px;
    white-space: nowrap;
    background: var(--surface);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.dashboard-card {
    position: relative;
    min-height: 215px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(
        145deg,
        var(--surface2),
        var(--surface)
    );
    overflow: hidden;
    transition: border-color .25s, transform .25s, box-shadow .25s;
}

.dashboard-card::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -75px;
    bottom: -85px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .035;
    filter: blur(25px);
    pointer-events: none;
}

.dashboard-card:hover {
    border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .12);
}

.card-top {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.card-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    font-size: 20px;
}

.card-label {
    font: 10px 'DM Mono', monospace;
    letter-spacing: 1.6px;
    color: var(--muted);
}

.dashboard-card h2 {
    font-size: 22px;
    letter-spacing: -.6px;
    margin: 0 0 9px;
}

.dashboard-card p {
    max-width: 360px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    margin: 0 0 18px;
}

.card-link {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    margin-top: auto;
    letter-spacing: .2px;
}

.status-text {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 10px;
    margin-top: auto;
}

.status-text .status-dot {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.dashboard-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    margin-top: 25px;
    padding: 27px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.dashboard-bottom h2 {
    font-size: 18px;
    margin: 12px 0 7px;
}

.dashboard-bottom .muted {
    font-size: 11px;
    margin: 0;
}

.version-info {
    display: grid;
    gap: 6px;
    text-align: right;
    font-family: 'DM Mono', monospace;
}

.version-info span {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1.5px;
}

.version-info strong {
    font-size: 20px;
    color: var(--accent);
}

/* EINSTELLUNGEN */

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
}

.page-heading h1 {
    font-size: 36px;
    margin: 13px 0 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 42px;
}

.stat {
    display: grid;
    gap: 9px;
}

.stat small,
.section-title span {
    font: 10px 'DM Mono';
    letter-spacing: 1.5px;
    color: var(--muted);
}

.stat strong {
    font-size: 25px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 16px;
}

.section-title h2,
.settings-form h2 {
    font-size: 17px;
}

.app-card {
    display: block;
    position: relative;
    min-height: 170px;
    transition: .2s;
}

.app-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-arrow {
    position: absolute;
    right: 20px;
    top: 20px;
    color: var(--accent);
}

.coming {
    display: inline-block;
    color: var(--accent);
    font: 9px 'DM Mono';
    letter-spacing: 1px;
    margin-top: 17px;
}

.muted-card {
    opacity: .7;
}

.settings-form {
    max-width: 720px;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 12px 0 28px;
}

.choice {
    border: 1px solid var(--border);
    padding: 13px;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    cursor: pointer;
}

.choice input {
    accent-color: var(--accent);
}

.swatch {
    height: 48px;
    border-radius: 5px;
}

.dark-swatch {
    background: #24252d;
}

.light-swatch {
    background: #f1f2f5;
    border: 1px solid #ddd;
}

.black-swatch {
    background: #000;
    border: 1px solid #333;
}

.choice small {
    color: var(--muted);
}

.accent-label {
    margin-bottom: 22px;
}

.accent-label input[type=color] {
    width: 65px;
    height: 38px;
    border: 0;
    background: none;
    cursor: pointer;
}

/* LUNA */

.luna-page {
    text-align: center;
    max-width: 650px;
    margin: 30px auto;
}

.luna-orb {
    width: 90px;
    height: 90px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 48px;
    margin: 0 auto 28px;
    box-shadow: 0 0 45px color-mix(in srgb, var(--accent) 16%, transparent);
}

.luna-page h1 {
    font-size: 48px;
}

.luna-notice {
    text-align: left;
    margin-top: 45px;
}

.luna-notice .feature-icon {
    margin-bottom: 14px;
}

/* MOBILE */

@media (max-width: 800px) {
    .sidebar {
        width: 66px;
        padding: 20px 9px;
    }

    .brand {
        margin: 0 auto 45px;
    }

    .brand > span:last-child,
    .nav-label,
    .nav-link span,
    .user-chip > div:last-child,
    .status {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 13px 5px;
    }

    .nav-link .online-dot {
        display: none;
    }

    .user-chip {
        justify-content: center;
    }

    .main-area {
        margin-left: 66px;
    }

    .content {
        padding-top: 35px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 0 18px;
    }

    .choice-grid {
        grid-template-columns: 1fr;
    }
}

/* Ruhiges Dashboard-Design */

.dashboard-header {
    display: block;
    margin-bottom: 42px;
}

.dashboard-header h1 {
    font-size: clamp(30px, 4vw, 43px);
    letter-spacing: -2px;
    line-height: 1.2;
    margin: 15px 0 8px;
}

.dashboard-header .eyebrow {
    letter-spacing: 1px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.dashboard-card {
    min-height: 205px;
    padding: 27px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: border-color .2s, transform .2s;
}

.dashboard-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: none;
}

.dashboard-card::after {
    display: none;
}

.dashboard-card .card-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--surface2);
    color: var(--accent);
    font-size: 19px;
    margin-bottom: 23px;
}

.dashboard-card h2 {
    font-size: 20px;
    margin: 0 0 8px;
    letter-spacing: -.5px;
}

.dashboard-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    margin: 0 0 20px;
}

.dashboard-card .card-link {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    margin-top: auto;
}

.dashboard-bottom {
    margin-top: 24px;
    padding: 25px 0;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
}

.dashboard-bottom h2 {
    font-size: 16px;
    margin: 0 0 7px;
}

.dashboard-bottom .muted {
    font-size: 12px;
}

.version-info span {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1px;
}

@media (max-width: 800px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}



/* LUNA CHAT - LAYOUT FIX */

.luna-chat-page {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.luna-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.luna-heading h1 {
    font-size: 38px;
    margin: 12px 0 5px;
}

.luna-avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--accent);
    border-radius: 13px;
    color: var(--accent);
    font-size: 20px;
    font-weight: 800;
}

.chat-window {
    width: 100%;
    height: min(680px, 70vh);
    min-height: 450px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 85%;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface2);
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
}

.message-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.message-name {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.user-message .message-name {
    text-align: right;
}

.message-bubble {
    display: block;
    width: fit-content;
    max-width: 100%;
    padding: 12px 15px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px 12px 12px 12px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.user-message .message-bubble {
    margin-left: auto;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
    border-radius: 12px 4px 12px 12px;
}

.chat-input-area {
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 15px;
    margin: 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.chat-input-area textarea {
    display: block;
    flex: 1;
    width: 0;
    min-width: 0;
    min-height: 44px;
    max-height: 130px;
    margin: 0;
    padding: 12px 14px;
    resize: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font: 13px/1.5 Manrope, sans-serif;
}

.chat-input-area textarea:focus {
    border-color: var(--accent);
    box-shadow: none;
}

.chat-input-area button {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-size: 22px;
    cursor: pointer;
}

.chat-input-area button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.chat-hint {
    margin: 0;
    padding: 0 15px 12px;
    background: var(--surface);
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}

@media (max-width: 600px) {
    .chat-window {
        height: 70vh;
        min-height: 420px;
    }

    .chat-messages {
        padding: 15px;
    }

    .message {
        max-width: 95%;
    }
}



/* Luna Markdown und Chat */

.luna-page {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
}

.luna-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.luna-header h1 {
    margin: 0;
}

.luna-header p {
    margin: 5px 0 0;
    opacity: 0.65;
}

.luna-avatar,
.luna-message-avatar,
.user-message-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(224, 68, 80, 0.15);
    color: #e04450;
    font-weight: 700;
}

.luna-chat-window {
    background: var(--card-bg, #151515);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 18px;
    overflow: hidden;
}

.luna-messages {
    min-height: 350px;
    max-height: 65vh;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.luna-message,
.user-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.user-message {
    flex-direction: row-reverse;
}

.luna-message-body,
.user-message-body {
    min-width: 0;
    max-width: 85%;
}

.user-message-body {
    text-align: right;
}

.luna-message-name,
.user-message-name {
    font-size: 12px;
    opacity: 0.6;
    margin-bottom: 7px;
}

.luna-message-content {
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.user-message .luna-message-content {
    display: inline-block;
    padding: 11px 15px;
    border-radius: 14px 14px 3px 14px;
    background: rgba(224, 68, 80, 0.13);
    text-align: left;
}

/* Markdown */

.luna-message-content h1,
.luna-message-content h2,
.luna-message-content h3,
.luna-message-content h4 {
    margin: 20px 0 10px;
    line-height: 1.35;
}

.luna-message-content h1 {
    font-size: 1.5rem;
}

.luna-message-content h2 {
    font-size: 1.3rem;
}

.luna-message-content h3 {
    font-size: 1.1rem;
}

.luna-message-content p {
    margin: 0 0 12px;
}

.luna-message-content p:last-child {
    margin-bottom: 0;
}

.luna-message-content strong {
    font-weight: 700;
    color: inherit;
}

.luna-message-content em {
    font-style: italic;
}

.luna-message-content ul,
.luna-message-content ol {
    padding-left: 24px;
    margin: 10px 0 15px;
}

.luna-message-content li {
    margin: 5px 0;
}

.luna-message-content blockquote {
    margin: 14px 0;
    padding: 10px 15px;
    border-left: 3px solid #e04450;
    background: rgba(224, 68, 80, 0.07);
    border-radius: 0 8px 8px 0;
}

.luna-message-content code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
    background: rgba(128, 128, 128, 0.15);
    padding: 2px 6px;
    border-radius: 5px;
}

.luna-message-content pre {
    margin: 14px 0;
    padding: 16px;
    overflow-x: auto;
    border-radius: 10px;
    background: #0b0b0d;
    border: 1px solid rgba(255,255,255,0.08);
}

.luna-message-content pre code {
    padding: 0;
    background: transparent;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre;
}

.luna-message-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 15px 0;
}

.luna-message-content th,
.luna-message-content td {
    padding: 9px 12px;
    border: 1px solid rgba(128,128,128,0.25);
    text-align: left;
}

.luna-message-content th {
    background: rgba(128,128,128,0.12);
}

.luna-message-content a {
    color: #e04450;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.luna-message-content hr {
    border: 0;
    border-top: 1px solid rgba(128,128,128,0.25);
    margin: 18px 0;
}

.luna-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.08));
}

.luna-chat-form textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    max-height: 180px;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.12));
    background: var(--input-bg, #101010);
    color: inherit;
    font: inherit;
    outline: none;
}

.luna-chat-form textarea:focus {
    border-color: #e04450;
}

.luna-chat-form button {
    border: 0;
    border-radius: 10px;
    padding: 13px 17px;
    background: #e04450;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

.luna-chat-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.luna-chat-hint {
    padding: 0 16px 13px;
    margin: 0;
    font-size: 11px;
    opacity: 0.45;
}

@media (max-width: 600px) {
    .luna-messages {
        padding: 16px;
    }

    .luna-message-body,
    .user-message-body {
        max-width: 90%;
    }

    .luna-chat-form {
        padding: 10px;
    }

    .luna-chat-form button {
        padding: 13px;
    }

    .luna-chat-form button span:first-child {
        display: none;
    }
}


/* =========================================
   LUNA – Neue Chatoberfläche
========================================= */

.luna-workspace {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    height: calc(100vh - 110px);
    min-height: 600px;
    overflow: hidden;
    background: var(--surface, #151515);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
}

.luna-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #111111;
    border-right: 1px solid rgba(255,255,255,0.07);
}

.luna-sidebar-header {
    padding: 22px 17px;
}

.luna-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.luna-sidebar-brand h2 {
    margin: 0;
    font-size: 18px;
}

.luna-sidebar-brand span {
    display: block;
    margin-top: 3px;
    color: #888;
    font-size: 12px;
}

.luna-new-chat {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(224,68,80,0.35);
    border-radius: 10px;
    background: rgba(224,68,80,0.10);
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.luna-new-chat:hover {
    background: rgba(224,68,80,0.20);
}

.luna-new-chat span {
    margin-right: 8px;
    color: #e04450;
    font-size: 18px;
}

.luna-sidebar-label {
    padding: 5px 18px 12px;
    color: #777;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.luna-chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
}

.luna-chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 4px;
    padding: 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #bbb;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}

.luna-chat-item:hover {
    background: #202020;
    color: #fff;
}

.luna-chat-item.active {
    background: rgba(224,68,80,0.13);
    color: #fff;
}

.luna-chat-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.luna-chat-item-icon {
    color: #777;
    font-size: 20px;
}

.luna-list-empty,
.luna-list-loading {
    padding: 12px;
    color: #777;
    font-size: 13px;
}

.luna-sidebar-footer {
    padding: 17px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.luna-sidebar-footer a {
    color: #999;
    font-size: 13px;
    text-decoration: none;
}

.luna-sidebar-footer a:hover {
    color: #fff;
}

.luna-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    position: relative;
}

.luna-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.luna-main-header h1 {
    margin: 0;
    font-size: 20px;
}

.luna-main-header p {
    margin: 5px 0 0;
    color: #888;
    font-size: 12px;
}

.luna-header-actions {
    display: flex;
    gap: 8px;
}

.luna-header-actions button {
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
}

.luna-header-actions button:hover:not(:disabled) {
    background: #252525;
    color: #fff;
}

.luna-header-actions button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.luna-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 30px max(25px, calc((100% - 850px) / 2));
}

.luna-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    text-align: center;
}

.luna-welcome-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 20px;
    border-radius: 18px;
    background: rgba(224,68,80,0.14);
    color: #e04450;
    font-size: 25px;
    font-weight: 700;
}

.luna-welcome h2 {
    margin: 0 0 9px;
    font-size: 25px;
}

.luna-welcome p {
    color: #888;
    font-size: 14px;
}

.luna-input-area {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 15px 25px 20px;
}

.luna-input-area .luna-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: #1b1b1b;
}

.luna-input-area textarea {
    flex: 1;
    min-width: 0;
    max-height: 180px;
    padding: 10px;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: #fff;
}

.luna-input-area .luna-chat-form button {
    flex-shrink: 0;
    padding: 11px 15px;
    border: none;
    border-radius: 9px;
    background: #e04450;
    color: #fff;
    cursor: pointer;
}

.luna-input-area .luna-chat-form button:disabled,
.luna-new-chat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.luna-input-area .luna-chat-hint {
    margin: 9px 0 0;
    color: #777;
    font-size: 11px;
    text-align: center;
}

/* Kleine Bildschirme */

@media (max-width: 760px) {

    .luna-workspace {
        grid-template-columns: 1fr;
        height: calc(100vh - 90px);
        min-height: 550px;
    }

    .luna-sidebar {
        max-height: 185px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    .luna-sidebar-header {
        padding: 12px 14px;
    }

    .luna-sidebar-brand {
        margin-bottom: 10px;
    }

    .luna-sidebar-brand .luna-avatar {
        width: 32px;
        height: 32px;
    }

    .luna-sidebar-label {
        padding: 5px 15px;
    }

    .luna-chat-list {
        display: flex;
        gap: 5px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 10px 10px;
    }

    .luna-chat-item {
        flex: 0 0 170px;
        align-self: flex-start;
    }

    .luna-sidebar-footer {
        display: none;
    }

    .luna-main-header {
        padding: 14px;
    }

    .luna-main-header h1 {
        font-size: 17px;
    }

    .luna-header-actions button {
        padding: 7px;
        font-size: 11px;
    }

    .luna-messages {
        padding: 20px 14px;
    }

    .luna-input-area {
        padding: 10px 12px 15px;
    }
}
