:root {
    --bg: #f7f7fb;
    --sidebar: #f2f2f7;
    --surface: #ffffff;
    --surface-soft: #f1f1f7;
    --surface-hover: #ececf4;
    --text: #17171f;
    --muted: #7b7b8f;
    --border: #e2e2eb;
    --accent: #7565ff;
    --accent-hover: #6655f3;
    --accent-soft: rgba(117, 101, 255, 0.10);
    --success: #2fa36b;
    --shadow: 0 12px 35px rgba(30, 30, 60, 0.07);
    --shadow-small: 0 5px 18px rgba(30, 30, 60, 0.05);
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Inter,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);

    font-size: 14px;

    overflow: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

[hidden] {
    display: none !important;
}


/* =========================================
   APP
   ========================================= */

.shell {
    display: grid;

    grid-template-columns:
        var(--sidebar-width) 1fr;

    width: 100%;
    height: 100vh;
}


/* =========================================
   SIDEBAR
   ========================================= */

aside {
    height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 18px 14px;

    background: var(--sidebar);

    border-right:
        1px solid var(--border);

    overflow: hidden;
}


/* =========================================
   BRAND
   ========================================= */

.brand {
    display: flex;
    align-items: center;

    gap: 11px;

    padding:
        4px 5px 18px;
}

.logo {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #6959fb,
            #8978ff
        );

    color: white;

    font-size: 21px;
    font-weight: 800;

    box-shadow:
        0 9px 23px
        rgba(117, 101, 255, 0.24);
}

.brand b {
    display: block;

    font-size: 19px;

    line-height: 1;
}

.brand small {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 11px;
}


/* =========================================
   NEW CHAT
   ========================================= */

.new {
    width: 100%;

    padding:
        12px 14px;

    border:
        1px solid var(--border);

    border-radius: 13px;

    background: var(--surface);

    color: var(--text);

    text-align: left;

    font-size: 14px;
    font-weight: 650;

    cursor: pointer;

    box-shadow:
        var(--shadow-small);

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.new:hover {
    background: var(--surface-hover);

    transform:
        translateY(-1px);

    box-shadow:
        var(--shadow);
}

.new:active {
    transform:
        scale(0.98);
}


/* =========================================
   CHAT HISTORY
   ========================================= */

.chat-history {
    margin-top: 20px;

    min-height: 0;
    max-height: 280px;

    display: flex;
    flex-direction: column;
}

.history-title {
    padding:
        0 10px 8px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 750;

    letter-spacing: 1.3px;

    text-transform: uppercase;
}

#chatList {
    min-height: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;

    overflow-y: auto;

    padding-right: 3px;
}

#chatList::-webkit-scrollbar {
    width: 5px;
}

#chatList::-webkit-scrollbar-thumb {
    background: #d1d1dc;

    border-radius: 20px;
}

.chat-item {
    width: 100%;

    border: none;

    border-radius: 9px;

    background: transparent;

    color: var(--text);

    padding:
        10px 11px;

    text-align: left;

    font-size: 13px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    cursor: pointer;

    transition:
        background 0.12s ease;
}

.chat-item:hover {
    background: var(--surface-hover);
}

.chat-item.selected {
    background: var(--surface);

    font-weight: 650;

    box-shadow:
        0 2px 10px
        rgba(30, 30, 60, 0.05);
}


/* =========================================
   NAVIGATION
   ========================================= */

nav {
    display: flex;
    flex-direction: column;

    gap: 4px;

    margin-top: 18px;
}

nav .nav-item {
    width: 100%;

    min-height: 42px;

    display: flex;
    align-items: center;

    padding:
        0 11px;

    border: none;

    border-radius: 10px;

    background: transparent;

    color: var(--muted);

    text-align: left;

    font-size: 13px;
    font-weight: 550;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

nav button.nav-item:hover {
    background: var(--surface-hover);

    color: var(--text);
}

nav .nav-item.active {
    background: var(--surface);

    color: var(--text);

    font-weight: 650;

    box-shadow:
        var(--shadow-small);
}

nav .nav-item.disabled {
    cursor: default;
}

nav .nav-item span {
    margin-left: auto;

    padding:
        3px 7px;

    border-radius: 20px;

    background: var(--accent-soft);

    color: var(--accent);

    font-size: 9px;
    font-weight: 750;
}


/* =========================================
   MODEL
   ========================================= */

.model {
    margin-top: auto;

    padding:
        11px;

    border-top:
        1px solid var(--border);

    color: var(--muted);

    font-size: 10px;
}


/* =========================================
   MAIN
   ========================================= */

main {
    min-width: 0;
    height: 100vh;

    display: grid;

    grid-template-rows:
        auto 1fr auto;

    background: var(--bg);
}


/* =========================================
   HEADER
   ========================================= */

header {
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        0 28px;

    border-bottom:
        1px solid rgba(0, 0, 0, 0.04);

    background:
        rgba(247, 247, 251, 0.88);

    backdrop-filter:
        blur(15px);
}

header small {
    display: block;

    color: var(--accent);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 2px;
}

header h1 {
    margin:
        4px 0 0;

    font-size: 21px;

    line-height: 1;
}

.header-actions {
    display: flex;
    align-items: center;

    gap: 9px;
}


/* =========================================
   ACTIVE SKILL
   ========================================= */

.active-skill-badge {
    display: flex;
    align-items: center;

    min-height: 34px;

    padding:
        0 12px;

    border:
        1px solid rgba(117, 101, 255, 0.18);

    border-radius: 10px;

    background: var(--accent-soft);

    color: var(--accent);

    font-size: 11px;
    font-weight: 700;
}


/* =========================================
   THEME
   ========================================= */

#themeBtn {
    width: 36px;
    height: 36px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: var(--surface);

    cursor: pointer;

    transition:
        0.15s ease;
}

#themeBtn:hover {
    background: var(--surface-hover);
}


/* =========================================
   CHAT
   ========================================= */

.chat {
    min-height: 0;

    overflow-y: auto;

    padding:
        32px
        max(28px, calc((100% - 820px) / 2))
        45px;
}

.chat::-webkit-scrollbar {
    width: 6px;
}

.chat::-webkit-scrollbar-thumb {
    background: #d6d6df;

    border-radius: 20px;
}


/* =========================================
   HERO
   ========================================= */

.hero {
    min-height: 100%;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    text-align: center;

    padding-bottom: 70px;
}

.orb {
    width: 66px;
    height: 66px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 21px;

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            #6959fb,
            #8978ff
        );

    color: white;

    font-size: 27px;

    box-shadow:
        0 17px 42px
        rgba(117, 101, 255, 0.22);
}

.hero h2 {
    margin: 0;

    font-size: 37px;

    letter-spacing: -1.4px;
}

.hero p {
    margin:
        10px 0 26px;

    color: var(--muted);

    font-size: 14px;
}


/* =========================================
   SUGGESTIONS
   ========================================= */

.cards {
    width: 100%;
    max-width: 720px;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;
}

.suggestion {
    min-height: 74px;

    padding: 14px;

    border:
        1px solid var(--border);

    border-radius: 15px;

    background: var(--surface);

    color: var(--text);

    font-size: 13px;

    line-height: 1.4;

    cursor: pointer;

    box-shadow:
        var(--shadow-small);

    transition:
        0.15s ease;
}

.suggestion:hover {
    transform:
        translateY(-2px);

    box-shadow:
        var(--shadow);
}


/* =========================================
   MESSAGES
   ========================================= */

.message-row {
    width: 100%;

    display: flex;

    margin-bottom: 19px;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.assistant {
    justify-content: flex-start;
}

.message {
    font-size: 14px;

    line-height: 1.65;

    white-space: pre-wrap;

    overflow-wrap: anywhere;
}

.message-row.user .message {
    max-width: 72%;

    padding:
        10px 14px;

    border-radius:
        16px 16px 4px 16px;

    background: var(--accent);

    color: white;
}

.message-row.assistant .message {
    max-width: 90%;

    padding:
        5px 3px;

    background: transparent;

    color: var(--text);
}

.message.loading {
    color: var(--muted);

    font-style: italic;
}


/* =========================================
   CHAT FOOTER
   ========================================= */

footer {
    padding:
        14px 28px 15px;

    background:
        linear-gradient(
            to top,
            var(--bg) 78%,
            rgba(247, 247, 251, 0)
        );
}

.composer {
    width: 100%;
    max-width: 820px;

    margin:
        0 auto;

    display: flex;
    align-items: flex-end;

    gap: 10px;

    padding:
        9px 9px 9px 15px;

    border:
        1px solid var(--border);

    border-radius: 19px;

    background: var(--surface);

    box-shadow:
        0 10px 35px
        rgba(30, 30, 60, 0.08);
}

#messageInput {
    width: 100%;

    max-height: 150px;

    padding:
        7px 0;

    border: none;

    outline: none;

    resize: none;

    background: transparent;

    color: var(--text);

    font-size: 14px;

    line-height: 1.45;
}

#messageInput::placeholder {
    color: #a0a0af;
}

#sendBtn {
    width: 36px;
    height: 36px;

    flex-shrink: 0;

    border: none;

    border-radius: 11px;

    background: var(--accent);

    color: white;

    font-size: 18px;

    cursor: pointer;

    transition:
        0.15s ease;
}

#sendBtn:hover {
    background: var(--accent-hover);
}

#sendBtn:disabled {
    opacity: 0.5;

    cursor: default;
}

.note {
    max-width: 820px;

    margin:
        7px auto 0;

    text-align: center;

    color: var(--muted);

    font-size: 9px;
}


/* =========================================
   MEMORY
   ========================================= */

.memory-view {
    min-height: 0;

    overflow-y: auto;

    padding:
        48px 30px 70px;
}

.memory-container {
    width: 100%;
    max-width: 720px;

    margin:
        0 auto;
}

.memory-heading {
    display: flex;
    align-items: center;

    gap: 15px;

    margin-bottom: 28px;
}

.memory-icon {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border:
        1px solid var(--border);

    border-radius: 16px;

    background: var(--surface);

    font-size: 23px;

    box-shadow:
        var(--shadow-small);
}

.memory-heading h2 {
    margin:
        0 0 5px;

    font-size: 26px;

    letter-spacing: -0.7px;
}

.memory-heading p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
}

.memory-form {
    display: flex;
    align-items: center;

    gap: 9px;

    padding: 8px;

    border:
        1px solid var(--border);

    border-radius: 16px;

    background: var(--surface);

    box-shadow:
        var(--shadow);
}

#memoryInput {
    flex: 1;

    min-width: 0;

    padding:
        9px 10px;

    border: none;

    outline: none;

    background: transparent;

    color: var(--text);

    font-size: 14px;
}

#addMemoryBtn {
    padding:
        10px 15px;

    border: none;

    border-radius: 10px;

    background: var(--accent);

    color: white;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}

.memory-info {
    margin:
        10px 6px 25px;

    color: var(--muted);

    font-size: 10px;
}

#memoryList {
    display: flex;
    flex-direction: column;

    gap: 9px;
}

.memory-card {
    display: flex;
    align-items: center;

    gap: 12px;

    padding:
        14px 15px;

    border:
        1px solid var(--border);

    border-radius: 14px;

    background: var(--surface);

    box-shadow:
        var(--shadow-small);
}

.memory-card::before {
    content: "✦";

    width: 27px;
    height: 27px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 8px;

    background: var(--accent-soft);

    color: var(--accent);

    font-size: 11px;
}

.memory-content {
    flex: 1;

    font-size: 13px;

    line-height: 1.5;
}

.memory-delete {
    width: 30px;
    height: 30px;

    border: none;

    border-radius: 9px;

    background: transparent;

    color: var(--muted);

    font-size: 19px;

    cursor: pointer;
}

.memory-delete:hover {
    background: var(--surface-hover);

    color: #e14c4c;
}

.memory-empty {
    padding:
        45px 20px;

    border:
        1px dashed var(--border);

    border-radius: 15px;

    text-align: center;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================
   SKILLS
   ========================================= */

.skills-view {
    min-height: 0;

    overflow-y: auto;

    padding:
        48px 30px 70px;
}

.skills-container {
    width: 100%;
    max-width: 820px;

    margin:
        0 auto;
}

.skills-heading {
    display: flex;
    align-items: center;

    gap: 15px;

    margin-bottom: 28px;
}

.skills-icon {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border:
        1px solid var(--border);

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(117, 101, 255, 0.13),
            rgba(117, 101, 255, 0.04)
        );

    font-size: 24px;

    box-shadow:
        var(--shadow-small);
}

.skills-heading h2 {
    margin:
        0 0 5px;

    font-size: 27px;

    letter-spacing: -0.8px;
}

.skills-heading p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
}

.skills-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;

    padding:
        14px 16px;

    border:
        1px solid var(--border);

    border-radius: 15px;

    background: var(--surface);

    box-shadow:
        var(--shadow-small);
}

.skills-topbar > div {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.skills-topbar b {
    font-size: 11px;

    color: var(--muted);

    text-transform: uppercase;

    letter-spacing: 0.8px;
}

#activeSkillText {
    font-size: 14px;

    font-weight: 650;
}

#disableSkillsBtn {
    padding:
        9px 13px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: var(--surface-soft);

    color: var(--text);

    font-size: 11px;
    font-weight: 650;

    cursor: pointer;

    transition:
        0.15s ease;
}

#disableSkillsBtn:hover:not(:disabled) {
    background: var(--surface-hover);
}

#disableSkillsBtn:disabled {
    opacity: 0.45;

    cursor: default;
}

.skills-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.skill-card {
    position: relative;

    min-height: 220px;

    display: flex;
    flex-direction: column;

    padding: 20px;

    border:
        1px solid var(--border);

    border-radius: 18px;

    background: var(--surface);

    box-shadow:
        var(--shadow-small);

    overflow: hidden;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.skill-card:hover {
    transform:
        translateY(-3px);

    box-shadow:
        var(--shadow);
}

.skill-card.active {
    border-color:
        rgba(117, 101, 255, 0.38);

    background:
        linear-gradient(
            145deg,
            var(--surface),
            rgba(117, 101, 255, 0.055)
        );
}

.skill-card.active::after {
    content: "";

    position: absolute;

    width: 110px;
    height: 110px;

    right: -40px;
    top: -45px;

    border-radius: 50%;

    background:
        rgba(117, 101, 255, 0.10);

    filter: blur(2px);

    pointer-events: none;
}

.skill-card-icon {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 13px;

    background:
        var(--accent-soft);

    color:
        var(--accent);

    font-size: 17px;
    font-weight: 750;

    letter-spacing: -1px;
}

.skill-card-content {
    flex: 1;
}

.skill-card-content h3 {
    margin:
        0 0 9px;

    font-size: 19px;

    letter-spacing: -0.4px;
}

.skill-card-content p {
    margin: 0;

    max-width: 310px;

    color: var(--muted);

    font-size: 12px;

    line-height: 1.55;
}

.skill-toggle {
    align-self: flex-start;

    margin-top: 20px;

    padding:
        9px 14px;

    border: none;

    border-radius: 10px;

    background: var(--accent);

    color: white;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.skill-toggle:hover:not(:disabled) {
    background: var(--accent-hover);

    transform:
        translateY(-1px);
}

.skill-toggle.enabled {
    background:
        rgba(47, 163, 107, 0.10);

    color:
        var(--success);

    cursor: default;
}

.skill-toggle.enabled::before {
    content: "✓ ";

    font-weight: 800;
}


/* =========================================
   DARK MODE
   ========================================= */

body.dark {
    --bg: #17171d;
    --sidebar: #121217;

    --surface: #202027;
    --surface-soft: #25252d;
    --surface-hover: #2c2c35;

    --text: #f2f2f5;
    --muted: #9898a8;

    --border: #303039;

    --accent-soft:
        rgba(117, 101, 255, 0.14);

    --shadow:
        0 14px 40px
        rgba(0, 0, 0, 0.25);

    --shadow-small:
        0 6px 20px
        rgba(0, 0, 0, 0.16);
}

body.dark header {
    background:
        rgba(23, 23, 29, 0.88);
}


/* =========================================
   RESPONSIVE BASE
   ========================================= */

@media (max-width: 900px) {

    :root {
        --sidebar-width: 220px;
    }

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

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

@media (max-width: 650px) {

    .shell {
        display: block;
    }

    aside {
        display: none;
    }

    main {
        width: 100%;
    }

    header {
        padding:
            0 18px;
    }

    .chat {
        padding:
            24px 17px 35px;
    }

    footer {
        padding:
            10px 13px 13px;
    }

    .memory-view,
    .skills-view {
        padding:
            30px 17px;
    }

    .skills-topbar {
        align-items: flex-start;

        flex-direction: column;
    }

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

    .message-row.assistant .message {
        max-width: 100%;
    }
}


/* =========================================
   PROJECTS
   ========================================= */

.projects-view,
.project-detail-view {
    min-height: 0;

    overflow-y: auto;

    padding:
        48px 32px 80px;
}

.projects-container,
.project-detail-container {
    width: 100%;

    max-width: 900px;

    margin:
        0 auto;
}

.projects-view::-webkit-scrollbar,
.project-detail-view::-webkit-scrollbar {
    width: 6px;
}

.projects-view::-webkit-scrollbar-thumb,
.project-detail-view::-webkit-scrollbar-thumb {
    background:
        #d6d6df;

    border-radius: 20px;
}


/* PROJECTS HEADING */

.projects-heading {
    display: flex;

    align-items: center;

    gap: 16px;

    margin-bottom: 30px;
}

.projects-icon {
    width: 54px;
    height: 54px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border:
        1px solid
        var(--border);

    border-radius: 17px;

    background:
        linear-gradient(
            145deg,
            var(--surface),
            var(--accent-soft)
        );

    font-size: 23px;

    box-shadow:
        var(--shadow-small);
}

.projects-heading h2 {
    margin:
        0 0 5px;

    font-size: 28px;

    font-weight: 750;

    letter-spacing:
        -0.9px;
}

.projects-heading p {
    margin: 0;

    color:
        var(--muted);

    font-size: 13px;

    line-height: 1.5;
}


/* CREATE PROJECT */

.project-create-card {
    position: relative;

    display: grid;

    grid-template-columns:
        minmax(210px, 0.75fr)
        minmax(360px, 1.25fr);

    gap: 30px;

    align-items: center;

    margin-bottom: 34px;

    padding: 25px;

    border:
        1px solid
        var(--border);

    border-radius: 20px;

    background:
        linear-gradient(
            145deg,
            var(--surface),
            rgba(117, 101, 255, 0.035)
        );

    box-shadow:
        var(--shadow);

    overflow: hidden;
}

.project-create-card::after {
    content: "";

    position: absolute;

    width: 150px;
    height: 150px;

    right: -55px;
    top: -70px;

    border-radius: 50%;

    background:
        rgba(117, 101, 255, 0.07);

    pointer-events: none;
}

.project-create-card h3 {
    margin:
        0 0 8px;

    font-size: 18px;

    letter-spacing:
        -0.4px;
}

.project-create-card p {
    margin: 0;

    max-width: 330px;

    color:
        var(--muted);

    font-size: 12px;

    line-height: 1.6;
}

#projectForm {
    position: relative;

    z-index: 1;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 10px;
}

#projectNameInput,
#projectDescriptionInput,
#projectGoalInput,
#projectStateInput,
#projectDeadlineInput,
#projectGoalEditInput,
#projectStateEditInput,
#projectDeadlineEditInput {
    width: 100%;

    min-width: 0;

    padding:
        12px 13px;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    outline: none;

    background:
        var(--bg);

    color:
        var(--text);

    font-size: 13px;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

#projectNameInput:hover,
#projectDescriptionInput:hover,
#projectGoalInput:hover,
#projectStateInput:hover,
#projectDeadlineInput:hover,
#projectGoalEditInput:hover,
#projectStateEditInput:hover,
#projectDeadlineEditInput:hover {
    border-color:
        rgba(117, 101, 255, 0.23);
}

#projectNameInput:focus,
#projectDescriptionInput:focus,
#projectGoalInput:focus,
#projectStateInput:focus,
#projectDeadlineInput:focus,
#projectGoalEditInput:focus,
#projectStateEditInput:focus,
#projectDeadlineEditInput:focus {
    background:
        var(--surface);

    border-color:
        rgba(117, 101, 255, 0.55);

    box-shadow:
        0 0 0 3px
        rgba(117, 101, 255, 0.08);
}

#projectNameInput::placeholder,
#projectDescriptionInput::placeholder,
#projectGoalInput::placeholder,
#projectStateInput::placeholder,
#projectGoalEditInput::placeholder,
#projectStateEditInput::placeholder {
    color:
        #9d9dac;
}


.project-deadline-field {
    display: grid;

    gap: 6px;

    color:
        var(--muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing:
        0.2px;
}

.project-deadline-field span {
    padding-left: 2px;
}

.project-deadline-field input {
    color-scheme: light;
}

body.dark .project-deadline-field input {
    color-scheme: dark;
}

#createProjectBtn {
    grid-column:
        1 / -1;

    justify-self:
        flex-start;

    padding:
        11px 16px;

    border: none;

    border-radius: 11px;

    background:
        var(--accent);

    color: white;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 6px 18px
        rgba(117, 101, 255, 0.18);

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

#createProjectBtn:hover:not(:disabled) {
    background:
        var(--accent-hover);

    transform:
        translateY(-1px);

    box-shadow:
        0 9px 24px
        rgba(117, 101, 255, 0.24);
}

#createProjectBtn:active:not(:disabled) {
    transform:
        scale(0.98);
}

#createProjectBtn:disabled {
    opacity: 0.5;

    cursor: default;
}


/* PROJECT LIST */

.projects-section-title {
    margin:
        0 0 12px 4px;

    color:
        var(--muted);

    font-size: 10px;

    font-weight: 800;

    letter-spacing:
        1.25px;

    text-transform:
        uppercase;
}

.projects-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.project-card {
    position: relative;

    min-height: 210px;

    display: flex;

    flex-direction: column;

    padding: 21px;

    border:
        1px solid
        var(--border);

    border-radius: 18px;

    background:
        var(--surface);

    box-shadow:
        var(--shadow-small);

    overflow: hidden;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.project-card:hover {
    transform:
        translateY(-3px);

    border-color:
        rgba(117, 101, 255, 0.30);

    box-shadow:
        var(--shadow);
}

.project-card::after {
    content: "";

    position: absolute;

    width: 105px;
    height: 105px;

    right: -43px;
    top: -48px;

    border-radius: 50%;

    background:
        rgba(117, 101, 255, 0.055);

    pointer-events: none;
}

.project-card-icon {
    width: 44px;
    height: 44px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 17px;

    border-radius: 13px;

    background:
        var(--accent-soft);

    font-size: 19px;
}

.project-card-content {
    flex: 1;

    position: relative;

    z-index: 1;
}

.project-card-content h3 {
    margin:
        0 0 7px;

    font-size: 18px;

    letter-spacing:
        -0.4px;
}

.project-card-content p {
    margin:
        0 0 15px;

    color:
        var(--muted);

    font-size: 12px;

    line-height: 1.55;
}

.project-card-meta {
    color:
        var(--muted);

    font-size: 10px;

    line-height: 1.5;
}

.project-open {
    align-self:
        flex-start;

    position: relative;

    z-index: 1;

    margin-top: 18px;

    padding:
        9px 13px;

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    background:
        var(--surface-soft);

    color:
        var(--text);

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.project-open:hover {
    background:
        var(--accent-soft);

    color:
        var(--accent);

    border-color:
        rgba(117, 101, 255, 0.25);

    transform:
        translateX(2px);
}

.project-empty {
    grid-column:
        1 / -1;

    min-height: 170px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 30px;

    border:
        1px dashed
        var(--border);

    border-radius: 18px;

    background:
        rgba(255, 255, 255, 0.20);

    color:
        var(--muted);

    text-align: center;

    font-size: 12px;
}


/* PROJECT DETAILS */

.project-back {
    display:
        inline-flex;

    align-items: center;

    margin-bottom: 22px;

    padding:
        8px 11px;

    border: none;

    border-radius: 9px;

    background:
        transparent;

    color:
        var(--muted);

    font-size: 12px;

    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.project-back:hover {
    background:
        var(--surface-hover);

    color:
        var(--text);

    transform:
        translateX(-2px);
}

.project-detail-heading {
    display: flex;

    align-items: center;

    gap: 16px;

    margin-bottom: 25px;
}

.project-detail-icon {
    width: 56px;
    height: 56px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border:
        1px solid
        var(--border);

    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            var(--surface),
            var(--accent-soft)
        );

    font-size: 24px;

    box-shadow:
        var(--shadow-small);
}

.project-detail-heading h2 {
    margin:
        0 0 5px;

    font-size: 28px;

    letter-spacing:
        -0.8px;
}

.project-detail-heading p {
    margin: 0;

    color:
        var(--muted);

    font-size: 13px;

    line-height: 1.5;
}


/* DASHBOARD */

.project-dashboard {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 18px;
}

.project-stat {
    min-width: 0;

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 15px;

    border:
        1px solid
        var(--border);

    border-radius: 14px;

    background:
        var(--surface);

    box-shadow:
        var(--shadow-small);
}

.project-stat > span {
    width: 36px;
    height: 36px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 11px;

    background:
        var(--accent-soft);

    font-size: 16px;
}

.project-stat div {
    min-width: 0;
}

.project-stat b {
    display: block;

    max-width: 100%;

    overflow: hidden;

    color:
        var(--text);

    font-size: 14px;

    white-space: nowrap;

    text-overflow:
        ellipsis;
}

.project-stat small {
    display: block;

    margin-top: 2px;

    color:
        var(--muted);

    font-size: 9px;
}


/* PROJECT COMPASS */

.project-profile-card {
    margin-bottom: 18px;

    padding: 19px;

    border:
        1px solid
        var(--border);

    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            var(--surface),
            rgba(117, 101, 255, 0.035)
        );

    box-shadow:
        var(--shadow-small);
}

.project-profile-header {
    display: flex;

    align-items:
        flex-start;

    justify-content:
        space-between;

    gap: 18px;

    margin-bottom: 15px;
}

.project-profile-header h3 {
    margin:
        0 0 5px;

    font-size: 15px;
}

.project-profile-header p {
    margin: 0;

    max-width: 540px;

    color:
        var(--muted);

    font-size: 11px;

    line-height: 1.55;
}

#editProjectProfileBtn {
    flex-shrink: 0;

    padding:
        8px 11px;

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    background:
        var(--bg);

    color:
        var(--text);

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;
}

#editProjectProfileBtn:hover {
    border-color:
        rgba(117, 101, 255, 0.35);

    background:
        var(--surface-hover);
}

.project-profile-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;
}

.project-profile-item {
    min-width: 0;

    padding: 13px;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    background:
        var(--bg);
}

.project-profile-item span {
    display: block;

    margin-bottom: 7px;

    color:
        var(--muted);

    font-size: 10px;
    font-weight: 700;
}

.project-profile-item b {
    display: block;

    color:
        var(--text);

    font-size: 12px;
    font-weight: 650;

    line-height: 1.5;

    overflow-wrap: anywhere;
}

.project-profile-form {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 10px;
}

.project-profile-form[hidden],
.project-profile-grid[hidden] {
    display: none;
}

.project-profile-actions {
    grid-column:
        1 / -1;

    display: flex;

    justify-content:
        flex-end;

    gap: 8px;

    margin-top: 2px;
}

.project-profile-actions button {
    padding:
        9px 12px;

    border:
        1px solid
        transparent;

    border-radius: 10px;

    background:
        var(--accent);

    color: white;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;
}

.project-profile-actions button.secondary {
    border-color:
        var(--border);

    background:
        var(--bg);

    color:
        var(--text);
}

.project-profile-actions button:disabled {
    opacity: 0.5;

    cursor: default;
}


/* PROJECT BLOCKS */

.project-block {
    margin-top: 14px;

    padding: 21px;

    border:
        1px solid
        var(--border);

    border-radius: 18px;

    background:
        var(--surface);

    box-shadow:
        var(--shadow-small);
}

.project-block-header {
    display: flex;

    align-items: center;

    justify-content:
        space-between;

    gap: 20px;

    margin-bottom: 17px;
}

.project-block-header h3 {
    margin:
        0 0 4px;

    font-size: 16px;

    letter-spacing:
        -0.25px;
}

.project-block-header p {
    margin: 0;

    color:
        var(--muted);

    font-size: 11px;

    line-height: 1.5;
}


/* PROJECT CHAT */

#newProjectChatBtn {
    flex-shrink: 0;

    padding:
        9px 13px;

    border: none;

    border-radius: 10px;

    background:
        var(--accent);

    color: white;

    font-size: 11px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

#newProjectChatBtn:hover {
    background:
        var(--accent-hover);

    transform:
        translateY(-1px);
}

#projectChatsList {
    display: flex;

    flex-direction: column;

    gap: 6px;
}

.project-chat-item {
    width: 100%;

    padding:
        12px 13px;

    border:
        1px solid
        transparent;

    border-radius: 11px;

    background:
        var(--surface-soft);

    color:
        var(--text);

    text-align: left;

    font-size: 12px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.project-chat-item::before {
    content: "💬";

    margin-right: 8px;

    font-size: 11px;
}

.project-chat-item:hover {
    background:
        var(--surface-hover);

    border-color:
        var(--border);

    transform:
        translateX(2px);
}


/* PROJECT MEMORY */

.project-memory-form {
    display: flex;

    gap: 8px;

    margin-bottom: 13px;
}

#projectMemoryInput {
    flex: 1;

    min-width: 0;

    padding:
        11px 12px;

    border:
        1px solid
        var(--border);

    border-radius: 11px;

    outline: none;

    background:
        var(--bg);

    color:
        var(--text);

    font-size: 12px;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

#projectMemoryInput:focus {
    border-color:
        rgba(117, 101, 255, 0.50);

    box-shadow:
        0 0 0 3px
        rgba(117, 101, 255, 0.07);
}

#projectMemoryInput::placeholder {
    color:
        #9d9dac;
}

.project-memory-form button {
    padding:
        9px 14px;

    border: none;

    border-radius: 10px;

    background:
        var(--accent);

    color: white;

    font-size: 11px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease;
}

.project-memory-form button:hover {
    background:
        var(--accent-hover);
}

#projectMemoryList {
    display: flex;

    flex-direction: column;

    gap: 7px;
}

.project-memory-card {
    display: flex;

    align-items: center;

    gap: 10px;

    padding:
        11px 12px;

    border:
        1px solid
        var(--border);

    border-radius: 11px;

    background:
        var(--bg);
}

.project-memory-card::before {
    content: "✦";

    width: 25px;
    height: 25px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 8px;

    background:
        var(--accent-soft);

    color:
        var(--accent);

    font-size: 10px;
}

.project-memory-content {
    flex: 1;

    min-width: 0;

    font-size: 12px;

    line-height: 1.45;
}

.project-memory-delete {
    width: 28px;
    height: 28px;

    flex-shrink: 0;

    border: none;

    border-radius: 8px;

    background:
        transparent;

    color:
        var(--muted);

    font-size: 17px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.project-memory-delete:hover {
    background:
        var(--surface-hover);

    color:
        #df4e4e;
}


/* PROJECT SKILLS */

#projectSkillsList {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}

.project-skill-option {
    padding:
        10px 13px;

    border:
        1px solid
        var(--border);

    border-radius: 11px;

    background:
        var(--surface-soft);

    color:
        var(--muted);

    font-size: 11px;

    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.project-skill-option:hover {
    color:
        var(--text);

    border-color:
        rgba(117, 101, 255, 0.28);

    transform:
        translateY(-1px);
}

.project-skill-option.active {
    background:
        var(--accent-soft);

    color:
        var(--accent);

    border-color:
        rgba(117, 101, 255, 0.35);

    box-shadow:
        0 4px 15px
        rgba(117, 101, 255, 0.08);
}

.project-list-empty {
    padding:
        24px 15px;

    border:
        1px dashed
        var(--border);

    border-radius: 11px;

    background:
        rgba(117, 101, 255, 0.015);

    color:
        var(--muted);

    text-align: center;

    font-size: 11px;
}

body.dark .project-empty {
    background:
        rgba(255, 255, 255, 0.015);
}

body.dark .project-create-card {
    background:
        linear-gradient(
            145deg,
            var(--surface),
            rgba(117, 101, 255, 0.055)
        );
}


/* PROJECT RESPONSIVE */

@media (max-width: 1000px) {

    .project-create-card {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 800px) {

    .project-dashboard {
        grid-template-columns: 1fr;
    }

    #projectForm {
        grid-template-columns: 1fr;
    }

    .project-profile-grid,
    .project-profile-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {

    .projects-view,
    .project-detail-view {
        padding:
            28px 17px 60px;
    }

    .project-create-card {
        padding: 18px;
    }

    .project-block-header {
        align-items:
            flex-start;

        flex-direction:
            column;
    }

    .project-memory-form {
        flex-direction:
            column;
    }

    .project-memory-form button {
        width: 100%;
    }
}


/* =========================================
   STREAMING
   ========================================= */

.assistant-response-meta {
    min-height: 18px;

    margin-bottom: 5px;

    color:
        var(--muted);

    font-size: 10px;

    font-weight: 650;

    letter-spacing: 0.1px;

    user-select: none;
}

.assistant-stream-text {
    white-space:
        pre-wrap;

    overflow-wrap:
        anywhere;
}

.assistant-stream-text.streaming::after {
    content: "";

    display:
        inline-block;

    width: 5px;
    height: 14px;

    margin-left: 3px;

    border-radius: 2px;

    background:
        var(--accent);

    vertical-align: -2px;

    animation:
        lumaStreamingCursor
        0.75s
        ease-in-out
        infinite;
}

@keyframes lumaStreamingCursor {

    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 1;
    }
}


/* =========================================
   STOP GENERATION
   ========================================= */

#sendBtn.stop {
    background:
        var(--text);

    color:
        var(--bg);

    font-size: 11px;

    box-shadow:
        0 4px 14px
        rgba(20, 20, 30, 0.14);
}

#sendBtn.stop:hover {
    background:
        var(--text);

    transform:
        scale(1.04);
}

#sendBtn.stop:active {
    transform:
        scale(0.94);
}


/* =========================================
   PROJECT FILES
   ========================================= */

.project-file-add {
    appearance: none;
    -webkit-appearance: none;

    flex-shrink: 0;

    min-height: 34px;

    padding:
        0 13px;

    border: none;

    outline: none;

    border-radius: 10px;

    background:
        var(--accent);

    color: #ffffff;

    font-size: 11px;

    font-weight: 700;

    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 6px 16px
        rgba(117, 101, 255, 0.17);

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease;
}

.project-file-add:hover:not(:disabled) {
    background:
        var(--accent-hover);

    transform:
        translateY(-1px);

    box-shadow:
        0 8px 20px
        rgba(117, 101, 255, 0.22);
}

.project-file-add:active:not(:disabled) {
    transform:
        scale(0.97);
}

.project-file-add:disabled {
    opacity: 0.55;

    cursor: default;
}


/* FILE STATUS */

.project-files-status {
    margin-bottom: 12px;

    padding:
        9px 11px;

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    background:
        var(--surface-soft);

    color:
        var(--muted);

    font-size: 11px;

    line-height: 1.4;
}

.project-files-status.success {
    border-color:
        rgba(
            47,
            163,
            107,
            0.18
        );

    background:
        rgba(
            47,
            163,
            107,
            0.08
        );

    color:
        var(--success);
}

.project-files-status.error {
    border-color:
        rgba(
            220,
            70,
            70,
            0.17
        );

    background:
        rgba(
            220,
            70,
            70,
            0.07
        );

    color:
        #d94c4c;
}


/* FILE LIST */

.project-files-list {
    display: flex;

    flex-direction: column;

    gap: 7px;
}


/* EMPTY FILES */

.project-files-empty {
    min-height: 90px;

    display: flex;

    align-items: center;

    gap: 13px;

    padding: 15px;

    border:
        1px dashed
        var(--border);

    border-radius: 12px;

    background:
        rgba(
            117,
            101,
            255,
            0.018
        );

    color:
        var(--muted);
}

.project-files-empty-icon {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 11px;

    background:
        var(--accent-soft);

    font-size: 16px;
}

.project-files-empty b {
    display: block;

    margin-bottom: 4px;

    color:
        var(--text);

    font-size: 12px;

    font-weight: 700;
}

.project-files-empty span {
    display: block;

    max-width: 350px;

    font-size: 10px;

    line-height: 1.5;
}


/* FILE ITEM */

.project-file-item {
    min-width: 0;

    display: flex;

    align-items: center;

    gap: 11px;

    padding:
        10px 11px;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    background:
        var(--bg);

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.project-file-item:hover {
    background:
        var(--surface-soft);

    border-color:
        rgba(
            117,
            101,
            255,
            0.25
        );

    transform:
        translateX(2px);

    box-shadow:
        0 4px 14px
        rgba(
            30,
            30,
            60,
            0.04
        );
}


/* FILE ICON */

.project-file-icon {
    width: 35px;
    height: 35px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    background:
        var(--accent-soft);

    color:
        var(--accent);

    font-size: 13px;

    font-weight: 800;

    user-select: none;
}


/* FILE INFO */

.project-file-info {
    min-width: 0;

    flex: 1;
}

.project-file-name {
    overflow: hidden;

    color:
        var(--text);

    font-size: 12px;

    font-weight: 650;

    white-space: nowrap;

    text-overflow:
        ellipsis;
}

.project-file-meta {
    margin-top: 3px;

    color:
        var(--muted);

    font-size: 9px;
}


/* OPEN FILE */

.project-file-open {
    appearance: none;
    -webkit-appearance: none;

    flex-shrink: 0;

    padding:
        7px 10px;

    border:
        1px solid
        var(--border);

    border-radius: 9px;

    background:
        var(--surface);

    color:
        var(--muted);

    font-size: 10px;

    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.project-file-open:hover {
    border-color:
        rgba(
            117,
            101,
            255,
            0.25
        );

    background:
        var(--accent-soft);

    color:
        var(--accent);

    transform:
        translateY(-1px);
}


/* DELETE FILE */

.project-file-delete {
    appearance: none;
    -webkit-appearance: none;

    width: 29px;
    height: 29px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 0;

    border: none;

    border-radius: 8px;

    background:
        transparent;

    color:
        var(--muted);

    font-size: 17px;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.project-file-delete:hover {
    background:
        rgba(
            220,
            70,
            70,
            0.08
        );

    color:
        #df4e4e;
}

.project-file-delete:active {
    transform:
        scale(0.90);
}


/* =========================================
   FILE PREVIEW
   ========================================= */

.project-file-preview {
    position: fixed;

    inset: 0;

    z-index: 9000;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 28px;
}

.project-file-preview[hidden] {
    display: none !important;
}

.project-file-preview-backdrop {
    position: absolute;

    inset: 0;

    background:
        rgba(
            17,
            17,
            29,
            0.56
        );

    backdrop-filter:
        blur(5px);

    -webkit-backdrop-filter:
        blur(5px);
}

.project-file-preview-card {
    position: relative;

    z-index: 1;

    width:
        min(
            900px,
            calc(
                100vw - 50px
            )
        );

    height:
        min(
            720px,
            calc(
                100vh - 70px
            )
        );

    display: flex;

    flex-direction: column;

    overflow: hidden;

    border:
        1px solid
        var(--border);

    border-radius: 20px;

    background:
        var(--surface);

    box-shadow:
        0 30px 100px
        rgba(
            0,
            0,
            0,
            0.28
        );

    animation:
        projectFilePreviewAppear
        0.17s ease;
}


/* PREVIEW HEADER */

.project-file-preview-header {
    display: flex;

    align-items: center;

    justify-content:
        space-between;

    gap: 20px;

    flex-shrink: 0;

    padding:
        17px 19px;

    border-bottom:
        1px solid
        var(--border);
}

.project-file-preview-header > div {
    min-width: 0;
}

.project-file-preview-header span {
    display: block;

    color:
        var(--accent);

    font-size: 8px;

    font-weight: 800;

    letter-spacing: 1.5px;
}

.project-file-preview-header h3 {
    margin:
        3px 0 0;

    overflow: hidden;

    color:
        var(--text);

    font-size: 15px;

    font-weight: 700;

    letter-spacing:
        -0.2px;

    white-space:
        nowrap;

    text-overflow:
        ellipsis;
}


/* PREVIEW CLOSE */

#projectFilePreviewClose {
    appearance: none;
    -webkit-appearance: none;

    width: 32px;
    height: 32px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 0;

    border: none;

    border-radius: 9px;

    background:
        transparent;

    color:
        var(--muted);

    font-size: 21px;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

#projectFilePreviewClose:hover {
    background:
        var(--surface-hover);

    color:
        var(--text);
}

#projectFilePreviewClose:active {
    transform:
        scale(0.90);
}


/* PREVIEW META */

.project-file-preview-meta {
    flex-shrink: 0;

    padding:
        9px 19px;

    border-bottom:
        1px solid
        var(--border);

    background:
        var(--surface-soft);

    color:
        var(--muted);

    font-size: 9px;
}


/* PREVIEW CODE */

.project-file-preview-code {
    flex: 1;

    min-width: 0;
    min-height: 0;

    margin: 0;

    overflow: auto;

    padding: 20px;

    background:
        var(--bg);

    color:
        var(--text);

    font-family:
        "SFMono-Regular",
        "SF Mono",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 11px;

    line-height: 1.65;

    tab-size: 4;

    white-space: pre;

    text-align: left;
}

.project-file-preview-code::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.project-file-preview-code::-webkit-scrollbar-thumb {
    border-radius: 20px;

    background:
        rgba(
            120,
            120,
            140,
            0.28
        );
}

.project-file-preview-code::-webkit-scrollbar-corner {
    background:
        transparent;
}


/* PREVIEW ANIMATION */

@keyframes projectFilePreviewAppear {

    from {
        opacity: 0;

        transform:
            translateY(8px)
            scale(0.985);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* FILES DARK */

body.dark .project-files-empty {
    background:
        rgba(
            255,
            255,
            255,
            0.015
        );
}

body.dark .project-file-item {
    background:
        rgba(
            255,
            255,
            255,
            0.015
        );
}

body.dark .project-file-item:hover {
    background:
        var(--surface-soft);
}

body.dark .project-file-preview-backdrop {
    background:
        rgba(
            5,
            5,
            10,
            0.70
        );
}


/* =========================================
   FILES MOBILE
   ========================================= */

@media (max-width: 650px) {

    .project-file-preview {
        padding: 10px;
    }

    .project-file-preview-card {
        width: 100%;

        height:
            calc(
                100vh - 20px
            );

        border-radius: 16px;
    }

    .project-file-preview-header {
        padding:
            14px 15px;
    }

    .project-file-preview-meta {
        padding:
            8px 15px;
    }

    .project-file-preview-code {
        padding: 15px;

        font-size: 10px;
    }

    .project-file-open {
        display: none;
    }

    .project-file-item {
        gap: 8px;
    }
}


/* =========================================
   REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {

    .project-file-preview-card {
        animation: none;
    }

    .project-file-item,
    .project-file-add,
    .project-file-open,
    .project-file-delete {
        transition: none;
    }
}


/* =========================================
   LUMA PRODUCT UI REFRESH v1
   Safe visual overrides: no JS/API behavior changes.
   ========================================= */

:root {
    --sidebar-width: 288px;
    --radius-xs: 8px;
    --radius-sm: 11px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --content-width: 900px;
    --ease-ui: 180ms cubic-bezier(.2, .8, .2, 1);
}

body {
    letter-spacing: -0.01em;
}

body.dark {
    --bg: #15151b;
    --sidebar: #101015;
    --surface: #1d1d24;
    --surface-soft: #22222b;
    --surface-hover: #292933;
    --text: #f5f5f7;
    --muted: #9696a8;
    --border: #2d2d37;
    --accent-soft: rgba(117, 101, 255, 0.16);
}

.shell {
    background: var(--bg);
}

aside {
    padding: 16px 13px 14px;
    border-right-color: color-mix(in srgb, var(--border) 82%, transparent);
}

.brand {
    gap: 10px;
    padding: 5px 6px 16px;
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 20px;
    box-shadow: 0 10px 28px rgba(117, 101, 255, 0.20);
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.brand-title-row b {
    font-size: 18px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 6px;
    border: 1px solid rgba(117, 101, 255, 0.24);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.7px;
}

.brand small {
    margin-top: 4px;
    font-size: 10px;
}

.new {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 13px;
    box-shadow: none;
    transition:
        background var(--ease-ui),
        border-color var(--ease-ui),
        transform var(--ease-ui);
}

.new:hover {
    border-color: rgba(117, 101, 255, 0.28);
    background: linear-gradient(135deg, var(--surface), var(--accent-soft));
    box-shadow: none;
}

.chat-history {
    margin-top: 18px;
    max-height: 250px;
}

.history-title {
    padding: 0 10px 7px;
    font-size: 9px;
    letter-spacing: 1.4px;
}

#chatList {
    gap: 2px;
}

.chat-item {
    min-height: 38px;
    padding: 9px 11px;
    border-radius: 9px;
    font-size: 12px;
}

.chat-item.selected {
    background: var(--surface-soft);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

nav {
    gap: 3px;
    margin-top: 15px;
}

nav .nav-item {
    min-height: 40px;
    padding: 0 11px;
    border-radius: 10px;
    font-size: 12.5px;
}

nav .nav-item.active {
    background: var(--surface-soft);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-card {
    min-height: 58px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.account-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #6959fb, #8978ff);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.account-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.account-copy b {
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-more {
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 1px;
}

.model {
    margin-top: 0;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 7px 0;
    border-top: none;
    font-size: 9px;
}

.model-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.model-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(47, 163, 107, 0.10);
}

main {
    background:
        radial-gradient(circle at 82% 12%, rgba(117, 101, 255, 0.05), transparent 26%),
        var(--bg);
}

header {
    height: 76px;
    padding: 0 28px;
    border-bottom-color: color-mix(in srgb, var(--border) 66%, transparent);
}

.header-title small {
    display: flex;
    align-items: center;
    gap: 7px;
}

.header-live-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(117, 101, 255, 0.08);
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 4px;
}

.header-title-row h1 {
    margin: 0;
}

.header-beta {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

#themeBtn {
    border-radius: 12px;
    box-shadow: none;
}

.chat {
    padding:
        26px
        max(28px, calc((100% - var(--content-width)) / 2))
        34px;
}

.hero {
    padding-bottom: 42px;
}

.hero-eyebrow {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.orb {
    width: 62px;
    height: 62px;
    margin-bottom: 20px;
    border-radius: 19px;
    box-shadow: 0 16px 42px rgba(117, 101, 255, 0.18);
}

.hero h2 {
    font-size: clamp(31px, 3vw, 40px);
    letter-spacing: -1.5px;
}

.hero p {
    max-width: 520px;
    margin: 10px 0 28px;
    font-size: 13px;
    line-height: 1.55;
}

.cards {
    max-width: 760px;
    gap: 9px;
}

.suggestion {
    position: relative;
    min-height: 70px;
    padding: 14px 15px 14px 42px;
    border-radius: 16px;
    box-shadow: none;
    text-align: left;
    transition:
        transform var(--ease-ui),
        border-color var(--ease-ui),
        background var(--ease-ui);
}

.suggestion::before {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.suggestion:nth-child(1)::before { content: "⌕"; }
.suggestion:nth-child(2)::before { content: "</>"; font-size: 9px; }
.suggestion:nth-child(3)::before { content: "✦"; }

.suggestion:hover {
    transform: translateY(-2px);
    border-color: rgba(117, 101, 255, 0.30);
    background: linear-gradient(145deg, var(--surface), var(--accent-soft));
    box-shadow: none;
}

.message-row {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
}

.message-row.user {
    padding-top: 2px;
}

.message-row.user .message {
    max-width: min(72%, 620px);
    padding: 10px 14px;
    border-radius: 17px 17px 5px 17px;
    box-shadow: 0 7px 18px rgba(117, 101, 255, 0.08);
}

.message-row.assistant {
    padding: 5px 0 10px;
}

.message-row.assistant .message {
    max-width: min(84%, 760px);
    padding: 4px 2px;
    line-height: 1.62;
}

footer {
    padding: 10px 28px 13px;
}

.composer {
    max-width: var(--content-width);
    min-height: 54px;
    padding: 8px 8px 8px 16px;
    border-radius: 18px;
    box-shadow: 0 10px 32px rgba(20, 20, 35, 0.09);
    transition:
        border-color var(--ease-ui),
        box-shadow var(--ease-ui),
        transform var(--ease-ui);
}

.composer:focus-within {
    border-color: rgba(117, 101, 255, 0.42);
    box-shadow:
        0 12px 36px rgba(20, 20, 35, 0.11),
        0 0 0 3px rgba(117, 101, 255, 0.07);
}

#messageInput {
    min-height: 34px;
    padding: 7px 0 6px;
    font-size: 13.5px;
}

#sendBtn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    box-shadow: 0 7px 16px rgba(117, 101, 255, 0.22);
}

.note {
    max-width: var(--content-width);
    margin-top: 7px;
    font-size: 8.5px;
}

.memory-container,
.skills-container,
.projects-container,
.project-detail-container {
    animation: lumaViewIn 180ms ease-out;
}

@keyframes lumaViewIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.dark .account-card {
    background: rgba(255, 255, 255, 0.025);
}

body.dark .new {
    background: rgba(255, 255, 255, 0.035);
}

body.dark header {
    background: rgba(21, 21, 27, 0.88);
}

body.dark .composer {
    background: rgba(29, 29, 36, 0.96);
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 230px;
    }

    .brand-badge,
    .header-beta {
        display: none;
    }

    .account-copy small {
        display: none;
    }
}

@media (max-width: 650px) {
    header {
        height: 68px;
    }

    .hero {
        padding-bottom: 24px;
    }

    .hero p {
        max-width: 330px;
    }

    .composer {
        min-height: 50px;
        border-radius: 16px;
    }
}


/* =========================================
   AUTH — LUMA ACCOUNTS v0.1
   ========================================= */

.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 18% 12%, rgba(117, 101, 255, 0.16), transparent 31%),
        radial-gradient(circle at 82% 82%, rgba(117, 101, 255, 0.09), transparent 31%),
        var(--bg);
}

.auth-gate[hidden] {
    display: none !important;
}

.auth-card {
    width: min(100%, 440px);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 28px 80px rgba(24, 22, 48, 0.13);
    backdrop-filter: blur(18px);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 31px;
}

.auth-logo {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #6959fb, #8978ff);
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(117, 101, 255, 0.22);
}

.auth-brand b {
    display: block;
    font-size: 17px;
}

.auth-brand small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.auth-heading {
    margin-bottom: 22px;
}

.auth-kicker {
    color: var(--accent);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 1.8px;
}

.auth-heading h1 {
    margin: 7px 0 8px;
    font-size: 29px;
    letter-spacing: -1px;
}

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

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 19px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft);
}

.auth-tab {
    min-height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.auth-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 4px 13px rgba(30, 30, 60, 0.07);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.auth-form[hidden] {
    display: none !important;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-form label > span {
    padding-left: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    min-height: 45px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-form input:focus {
    border-color: rgba(117, 101, 255, 0.55);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(117, 101, 255, 0.08);
}

.auth-form input::placeholder {
    color: color-mix(in srgb, var(--muted) 76%, transparent);
}

.auth-primary {
    min-height: 45px;
    margin-top: 3px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #8978ff);
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 9px 22px rgba(117, 101, 255, 0.20);
}

.auth-primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.auth-primary:disabled {
    opacity: 0.62;
    cursor: wait;
}

.auth-error {
    margin-top: 13px;
    padding: 10px 12px;
    border: 1px solid rgba(219, 68, 68, 0.20);
    border-radius: 11px;
    background: rgba(219, 68, 68, 0.07);
    color: #d34c5c;
    font-size: 11px;
    line-height: 1.45;
}

.auth-legacy-note,
.auth-footnote {
    margin: 1px 2px 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
}

.auth-footnote {
    margin-top: 17px;
    text-align: center;
}

body.auth-locked .shell {
    pointer-events: none;
    user-select: none;
}

.account-card {
    position: relative;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.account-card:hover {
    border-color: rgba(117, 101, 255, 0.28);
    background: var(--surface-soft);
}

.account-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(117, 101, 255, 0.10);
}

.sidebar-bottom {
    position: relative;
}

.account-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 101px;
    z-index: 80;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 17px 45px rgba(20, 20, 35, 0.15);
}

.account-menu[hidden] {
    display: none !important;
}

.account-menu-user {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 9px 10px;
    border-bottom: 1px solid var(--border);
}

.account-menu-user b {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-user small {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#logoutBtn {
    width: 100%;
    min-height: 36px;
    margin-top: 7px;
    padding: 0 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #d34c4c;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

#logoutBtn:hover {
    background: rgba(219, 68, 68, 0.07);
}

body.dark .auth-card,
body.dark .account-menu {
    background: rgba(28, 28, 35, 0.96);
}

body.dark .auth-form input {
    background: rgba(255, 255, 255, 0.025);
}

@media (max-width: 520px) {
    .auth-gate {
        align-items: flex-start;
        padding: 18px;
    }

    .auth-card {
        margin-top: 24px;
        padding: 23px 19px;
        border-radius: 20px;
    }

    .auth-heading h1 {
        font-size: 26px;
    }
}


/* ==========================================
   SPRINT 3 — PROJECT PROGRESS + DELETE
   ========================================== */

.project-detail-copy {
    flex: 1;
    min-width: 0;
}

.project-delete-btn {
    margin-left: auto;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: #d85d6a;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.project-delete-btn:hover {
    background: rgba(216, 93, 106, 0.10);
    border-color: rgba(216, 93, 106, 0.30);
    transform: translateY(-1px);
}

.project-delete-btn:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.project-card-delete {
    position: absolute;
    z-index: 3;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.project-card-delete:hover {
    background: rgba(216, 93, 106, 0.10);
    color: #d85d6a;
    border-color: rgba(216, 93, 106, 0.22);
}

.project-progress-suggestion {
    width: min(680px, calc(100% - 28px));
    margin: 18px auto;
    padding: 16px 17px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-small);
}

.project-progress-suggestion.accepted {
    opacity: 0.92;
}

.project-progress-suggestion-badge {
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.project-progress-suggestion strong {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
}

.project-progress-suggestion-state {
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 12px;
    line-height: 1.55;
}

.project-progress-suggestion-reason {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.project-progress-suggestion-actions {
    display: flex;
    gap: 8px;
    margin-top: 13px;
}

.project-progress-suggestion-actions button {
    padding: 8px 11px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}

.project-progress-accept {
    border: 1px solid transparent;
    background: var(--accent);
    color: white;
}

.project-progress-dismiss {
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
}

@media (max-width: 720px) {
    .project-detail-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .project-delete-btn {
        width: 100%;
        margin-left: 0;
    }
}

/* ==========================================
   SPRINT 4A — SECURITY / PROGRESS UI
   ========================================== */

.account-danger-btn {
    width: 100%;
    margin-top: 6px;
    border: 1px solid rgba(220, 70, 70, 0.35);
    background: transparent;
    color: #b53b3b;
}

.account-danger-btn:hover {
    background: rgba(220, 70, 70, 0.08);
}

body.dark .account-danger-btn {
    color: #ff9b9b;
    border-color: rgba(255, 120, 120, 0.32);
}

.project-progress-suggestion {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    width: min(440px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(120, 120, 120, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(18px);
}

.project-progress-suggestion[hidden] {
    display: none !important;
}

.project-progress-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(110, 90, 255, 0.12);
    font-size: 20px;
}

.project-progress-copy b {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.project-progress-copy p {
    margin: 0;
    opacity: 0.72;
    font-size: 13px;
    line-height: 1.45;
}

.project-progress-next {
    margin-top: 11px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(120, 120, 120, 0.08);
}

.project-progress-next span {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    opacity: 0.62;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.project-progress-next strong {
    font-size: 13px;
    line-height: 1.4;
}

.project-progress-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.project-progress-actions button {
    min-width: 104px;
}

body.dark .project-progress-suggestion {
    background: rgba(27, 27, 31, 0.97);
    border-color: rgba(255, 255, 255, 0.11);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

body.dark .project-progress-next {
    background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 700px) {
    .project-progress-suggestion {
        right: 16px;
        bottom: 16px;
        width: calc(100vw - 32px);
    }
}


/* === LUMA MOBILE V1 === */
/* Mobile drawer + phone layout. Desktop behavior stays unchanged. */

.mobile-menu-btn,
.mobile-sidebar-backdrop {
    display: none;
}

@media (max-width: 650px) {
    html,
    body,
    .shell,
    main {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
    }

    body {
        overscroll-behavior: none;
    }

    .shell {
        display: block;
    }

    main {
        min-width: 0;
        overflow: hidden;
    }

    header {
        position: relative;
        height: calc(64px + env(safe-area-inset-top));
        min-height: calc(64px + env(safe-area-inset-top));
        padding:
            env(safe-area-inset-top)
            max(12px, env(safe-area-inset-right))
            0
            max(58px, calc(46px + env(safe-area-inset-left)));
    }

    .mobile-menu-btn {
        position: absolute;
        top: calc(env(safe-area-inset-top) + 12px);
        left: max(12px, env(safe-area-inset-left));
        z-index: 5;

        width: 40px;
        height: 40px;

        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;

        padding: 0;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: color-mix(in srgb, var(--surface) 90%, transparent);
        color: var(--text);
        box-shadow: var(--shadow-small);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-btn span {
        width: 17px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transition:
            transform 180ms ease,
            opacity 180ms ease;
    }

    .mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-btn[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    aside {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1200;

        width: min(86vw, 320px);
        height: 100dvh;

        display: flex !important;
        flex-direction: column;

        padding:
            max(16px, env(safe-area-inset-top))
            13px
            max(14px, env(safe-area-inset-bottom));

        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;

        border-right: 1px solid var(--border);
        background: var(--sidebar);
        box-shadow: 24px 0 60px rgba(20, 20, 35, 0.18);

        transform: translate3d(-105%, 0, 0);
        visibility: hidden;
        transition:
            transform 220ms cubic-bezier(.2, .8, .2, 1),
            visibility 220ms step-end;
    }

    aside.mobile-open {
        transform: translate3d(0, 0, 0);
        visibility: visible;
        transition:
            transform 220ms cubic-bezier(.2, .8, .2, 1),
            visibility 0ms step-start;
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1190;

        display: block;
        background: rgba(12, 12, 18, 0.42);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            opacity 200ms ease,
            visibility 200ms step-end;
    }

    .mobile-sidebar-backdrop.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition:
            opacity 200ms ease,
            visibility 0ms step-start;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    .brand {
        flex-shrink: 0;
    }

    .chat-history {
        max-height: min(31dvh, 260px);
    }

    nav {
        flex-shrink: 0;
    }

    .sidebar-bottom {
        flex-shrink: 0;
    }

    .header-title {
        min-width: 0;
    }

    .header-title small {
        font-size: 8px;
    }

    .header-title-row {
        min-width: 0;
    }

    .header-title-row h1 {
        font-size: 19px;
    }

    .header-actions {
        gap: 6px;
    }

    #activeSkillBadge {
        max-width: 115px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #themeBtn {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .chat {
        min-height: 0;
        padding: 18px 14px 24px;
        scroll-padding-bottom: 110px;
    }

    .hero {
        width: 100%;
        max-width: 100%;
        padding-bottom: 20px;
    }

    .orb {
        width: 54px;
        height: 54px;
        margin-bottom: 16px;
        border-radius: 17px;
    }

    .hero h2 {
        font-size: clamp(28px, 9vw, 36px);
        letter-spacing: -1.1px;
    }

    .hero p {
        max-width: 340px;
        margin-bottom: 20px;
        font-size: 13px;
    }

    .cards {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .suggestion {
        min-height: 62px;
        padding: 12px 13px 12px 40px;
    }

    .message-row {
        width: 100%;
        max-width: 100%;
    }

    .message-row.user .message {
        max-width: 88%;
    }

    .message-row.assistant .message {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    footer {
        padding:
            8px
            max(10px, env(safe-area-inset-right))
            max(10px, env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-left));
    }

    .composer {
        width: 100%;
        max-width: none;
        min-height: 50px;
        padding: 7px 7px 7px 14px;
        border-radius: 16px;
    }

    #messageInput {
        min-width: 0;
        font-size: 16px; /* prevents iOS Safari auto-zoom */
        line-height: 1.35;
    }

    #sendBtn {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .note {
        padding: 0 4px;
        font-size: 8px;
    }

    .memory-view,
    .skills-view,
    .projects-view,
    .project-detail-view {
        min-width: 0;
        padding: 22px 14px 72px;
    }

    .memory-container,
    .skills-container,
    .projects-container,
    .project-detail-container {
        width: 100%;
        max-width: 100%;
    }

    .project-create-card,
    #projectForm,
    .project-dashboard,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    input,
    textarea,
    select,
    button {
        max-width: 100%;
    }
}

@media (max-width: 390px) {
    header {
        padding-left: max(56px, calc(44px + env(safe-area-inset-left)));
        padding-right: max(9px, env(safe-area-inset-right));
    }

    .header-title small,
    .header-beta {
        display: none;
    }

    .header-title-row {
        margin-top: 0;
    }

    #activeSkillBadge {
        max-width: 90px;
        font-size: 9px;
    }

    .chat {
        padding-left: 11px;
        padding-right: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    aside,
    .mobile-sidebar-backdrop,
    .mobile-menu-btn span {
        transition: none !important;
    }
}
