@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Space+Grotesk:wght@400;600;700&display=swap");

:root {
    --bg: #0a0b10;
    --surface: #101218;
    --surface-2: #161820;
    --text: #f5f5f8;
    --muted: #8a8f96;
    --accent: #72b043;
    --accent-strong: #007f4e;
    --success: #72b043;
    --danger: #e12729;
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Outfit", sans-serif;
    background: linear-gradient(-45deg, #0a0b10, #101218, #161820, #0a0b10);
    background-size: 400% 400%;
    animation: appGradientShift 10s ease infinite;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

@keyframes appGradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    z-index: -1;
}

body::before {
    width: 620px;
    height: 620px;
    top: -180px;
    right: -180px;
    background: radial-gradient(circle, rgba(114, 176, 67, 0.30), rgba(114, 176, 67, 0.12) 40%, transparent 72%);
    animation: appFloatA 4.5s ease-in-out infinite, appLightningA 3.1s ease-in-out infinite;
}

body::after {
    width: 560px;
    height: 560px;
    bottom: -160px;
    left: -160px;
    background: radial-gradient(circle, rgba(0, 127, 78, 0.22), rgba(0, 127, 78, 0.08) 42%, transparent 74%);
    animation: appFloatB 5.4s ease-in-out infinite reverse, appLightningB 3.7s ease-in-out infinite;
}

@keyframes appFloatA {
    0%,
    100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-30px, 26px);
    }
}

@keyframes appFloatB {
    0%,
    100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(28px, -22px);
    }
}

@keyframes appLightningA {
    0%,
    80%,
    100% {
        opacity: 0.55;
    }
    83% {
        opacity: 1;
    }
    86% {
        opacity: 0.64;
    }
    89% {
        opacity: 0.96;
    }
}

@keyframes appLightningB {
    0%,
    74%,
    100% {
        opacity: 0.44;
    }
    77% {
        opacity: 0.88;
    }
    80% {
        opacity: 0.5;
    }
    83% {
        opacity: 0.84;
    }
}

.global-site-logo {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 30;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid rgba(114, 176, 67, 0.24);
    background: rgba(10, 11, 16, 0.72);
    box-shadow: 0 0 24px rgba(114, 176, 67, 0.20), inset 0 0 16px rgba(255, 255, 255, 0.04);
}

.global-site-logo-img {
    width: 225px;
    height: 225px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(114, 176, 67, 0.35));
}

.global-site-logo + .auth-page {
    padding-top: 108px;
}

.global-site-logo + .container,
.global-site-logo + main.container {
    padding-top: 7rem;
}

body.logo-layout-auth .auth-page {
    padding-top: 104px;
}

body.logo-layout-builder .auth-page {
    padding-top: 112px;
}

body.logo-layout-utility .container,
body.logo-layout-utility main.container {
    padding-top: 6.6rem;
}

body.logo-layout-dashboard .container,
body.logo-layout-dashboard main.container {
    padding-top: 6.6rem;
}

.global-site-logo-mark {
    font-size: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 9px;
    border: 1px solid rgba(114, 176, 67, 0.42);
    box-shadow: 0 0 0 2px rgba(114, 176, 67, 0.14), 0 8px 20px rgba(0, 0, 0, 0.28);
    background-image: url("../../../asset/Flash747transparent.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.global-site-logo-text {
    font-size: 24px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    background: linear-gradient(90deg, #f37324 0%, #72b043 50%, #007f4e 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: appLogoShimmer 4s ease-in-out infinite;
}

@keyframes appFlashMove {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

@keyframes appLogoShimmer {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes logoShimmer {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

body.logo-layout-auth .logo {
    font-size: 24px;
    font-weight: 700;
    font-family: "Space Grotesk", sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(10, 11, 16, 0.62);
    box-shadow: 0 0 24px rgba(114, 176, 67, 0.24), inset 0 0 16px rgba(255, 255, 255, 0.06);
    color: #f5f7f0;
    background: linear-gradient(90deg, #ffffff 0%, #c8e6a0 45%, #72b043 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 16px rgba(114, 176, 67, 0.35);
    animation: logoShimmer 4s ease-in-out infinite;
}

h1,
h2,
h3,
h4 {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.01em;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-strong);
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 1000;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(114, 176, 67, 0.5);
    background: rgba(10, 11, 16, 0.95);
    color: var(--text);
}

.skip-link:focus,
.skip-link:focus-visible {
    left: 12px;
    top: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
iframe:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
summary:focus,
iframe:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 4rem;
}

.page-shell {
    display: grid;
    gap: 1.5rem;
}

.card {
    background: var(--surface);
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.muted {
    color: var(--muted);
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.65rem;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin: 0;
}

.checkbox input {
    width: auto;
    margin: 0;
}

label + input,
label + textarea,
label + select {
    margin-top: 0.5rem;
}

.link-button {
    background: transparent;
    color: var(--accent);
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 600;
}

.link-button:hover {
    color: var(--accent-strong);
}

.field-hint {
    display: block;
    font-size: 0.85rem;
    margin: 0.4rem 0 1rem;
    color: var(--muted);
    min-height: 1.1em;
}

.field-hint.is-error {
    color: #ffb3a8;
}

.field-hint.is-ok {
    color: var(--accent);
}

.caps-hint {
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: var(--surface-2);
    color: var(--text);
    font-size: 1rem;
}

input::placeholder,
textarea::placeholder {
    color: rgba(207, 227, 209, 0.65);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    background: linear-gradient(90deg, #72b043, #007f4e);
    color: #ffffff;
    text-decoration: none;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 16px 30px rgba(114, 176, 67, 0.28);
}

.btn:hover {
    transform: translateY(-1px) scale(1.01);
    background: linear-gradient(90deg, #007f4e, #f8cc1b);
    box-shadow: 0 18px 36px rgba(114, 176, 67, 0.38);
}

.btn.secondary {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.btn.secondary.danger {
    border-color: rgba(255, 59, 59, 0.45);
    color: #ffd7d7;
}

.btn.secondary.danger:hover {
    background: rgba(255, 59, 59, 0.18);
    border-color: rgba(255, 59, 59, 0.65);
    color: #fff;
    box-shadow: none;
}

.global-logout-button {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
}

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.glow {
    position: absolute;
    width: 720px;
    height: 720px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.12) 45%, transparent 70%);
    top: -180px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(560px, 92vw);
}

body.logo-layout-auth {
    color: #fff;
}

body.logo-layout-auth .muted {
    color: #a0a5ad;
}

body.logo-layout-auth h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 4.2vw, 2.7rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
}

body.logo-layout-auth p {
    line-height: 1.6;
}

body.logo-layout-auth .auth-card > .muted {
    margin: 0 0 20px;
}

.auth-flash {
    margin: 0 0 16px;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    line-height: 1.45;
}

.auth-flash-success {
    border-color: rgba(114, 176, 67, 0.38);
    background: linear-gradient(135deg, rgba(114, 176, 67, 0.18), rgba(0, 127, 78, 0.12));
    color: #e8f4dc;
}

body.logo-layout-auth .card {
    border-radius: 18px;
    box-shadow: var(--shadow);
}

body.logo-layout-auth label {
    color: #e0e4ea;
}

body.logo-layout-auth .card {
    background: rgba(10, 11, 16, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

body.logo-layout-auth input,
body.logo-layout-auth textarea,
body.logo-layout-auth select {
    background: rgba(16, 18, 24, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

body.logo-layout-auth input::placeholder,
body.logo-layout-auth textarea::placeholder {
    color: rgba(160, 165, 173, 0.72);
}

body.logo-layout-auth .glow {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7), rgba(114, 176, 67, 0.28) 42%, transparent 72%);
}

body.user-login-page .auth-page {
    padding: 28px 16px;
}

body.user-login-page .auth-card {
    width: min(560px, 94vw);
    background: rgba(10, 11, 16, 0.88);
    border: 1px solid rgba(114, 176, 67, 0.14);
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(10, 11, 16, 0.72), 0 0 34px rgba(114, 176, 67, 0.10);
    padding: 1.8rem;
}

body.user-login-page .user-login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.1rem;
}

body.user-login-page .global-site-logo {
    position: static;
    top: auto;
    left: auto;
    gap: 10px;
    padding: 10px 16px;
    border-color: rgba(114, 176, 67, 0.26);
    background: linear-gradient(180deg, rgba(10, 11, 16, 0.95), rgba(16, 18, 24, 0.92));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 26px rgba(114, 176, 67, 0.18), inset 0 0 14px rgba(255, 255, 255, 0.04);
}

body.user-login-page .global-site-logo-mark {
    width: 100px;
    height: 100px;
    font-size: 16px;
    border: 1px solid rgba(114, 176, 67, 0.2);
    background-color: rgba(114, 176, 67, 0.1);
    box-shadow: inset 0 0 10px rgba(114, 176, 67, 0.15), 0 0 8px rgba(114, 176, 67, 0.12);
    filter: drop-shadow(0 0 6px #72b043) drop-shadow(0 0 12px #007f4e);
}

body.user-login-page .global-site-logo-text {
    font-size: 38px;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(114, 176, 67, 0.26);
}

body.user-login-page .user-login-kicker {
    margin: 0 0 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.78rem;
    color: #8a8f96;
}

body.user-login-page .user-login-title {
    margin: 0 0 10px;
    font-size: 3rem;
    line-height: 1.02;
    text-align: center;
}

body.user-login-page .user-login-subtitle {
    margin: 0 0 1.25rem;
    text-align: center;
    color: #a0a5ad;
}

body.user-login-page .user-login-form {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

body.user-login-page .user-login-form label {
    margin-bottom: 0.45rem;
}

body.user-login-page .user-login-form input {
    margin-top: 0.55rem;
    min-height: 56px;
    border-radius: 12px;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(16, 18, 24, 0.9);
}

body.user-login-page .user-login-form input:focus {
    border-color: rgba(114, 176, 67, 0.5);
    box-shadow: 0 0 0 0.18rem rgba(114, 176, 67, 0.14);
    outline: none;
}

body.user-login-page .user-login-form .field-row {
    align-items: center;
    margin-bottom: 1.1rem;
}

body.user-login-page .user-login-form .checkbox {
    color: #e0e4ea;
}

body.user-login-page .user-login-form .checkbox input {
    width: 18px;
    height: 18px;
}

body.user-login-page .user-login-form .link-button {
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(114, 176, 67, 0.24);
    background: rgba(114, 176, 67, 0.22);
    color: #dce0e5;
}

body.user-login-page .user-login-form .link-button:hover {
    color: #ffffff;
    border-color: rgba(114, 176, 67, 0.52);
    background: rgba(114, 176, 67, 0.32);
}

body.user-login-page .user-login-submit {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    background: linear-gradient(90deg, #72b043, #007f4e);
    box-shadow: 0 8px 24px rgba(114,176,67,0.28);
    color: #ffffff;
    font-weight: 700;
    border: none;
}

body.user-login-page .user-login-submit:hover {
    background: linear-gradient(90deg, #007f4e, #f8cc1b);
    box-shadow: 0 0 22px rgba(114, 176, 67, 0.38);
}

body.user-login-page .user-login-message {
    margin: 0.25rem 0 0.7rem;
    text-align: left;
}

body.user-login-page .user-login-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

body.user-login-page .user-login-links a,
body.user-login-page .user-login-footer a {
    color: #72b043;
    text-decoration: underline;
}

body.user-login-page .user-login-footer {
    margin: 0.8rem 0 0;
    color: #8a8f96;
}

@media (max-width: 640px) {
    body.user-login-page .auth-card {
        padding: 1.2rem;
    }

    body.user-login-page .global-site-logo-text {
        font-size: 30px;
    }

    body.user-login-page .user-login-title {
        font-size: 2.3rem;
    }

    body.user-login-page .user-login-links {
        flex-direction: column;
        gap: 8px;
    }
}

body.logo-layout-dashboard {
    color: #fff;
    min-height: 100vh;
    background: linear-gradient(-45deg, #0a0b10, #101218, #161820, #0a0b10) !important;
    background-size: 400% 400% !important;
    animation: appGradientShift 10s ease infinite;
}

body.logo-layout-dashboard::before {
    background: radial-gradient(circle, rgba(114, 176, 67, 0.25), rgba(114, 176, 67, 0.10) 40%, transparent 72%) !important;
}

body.logo-layout-dashboard::after {
    background: radial-gradient(circle, rgba(0, 127, 78, 0.18), rgba(0, 127, 78, 0.06) 42%, transparent 74%) !important;
}

body.logo-layout-dashboard .muted {
    color: #a0a5ad;
}

body.logo-layout-dashboard h1 {
    color: #fff;
    text-shadow: 0 0 16px rgba(114, 176, 67, 0.24);
}

body.logo-layout-dashboard .dashboard-navbar {
    position: fixed;
    top: 74px;
    left: 18px;
    right: 18px;
    z-index: 24;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.55rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(10, 11, 16, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

body.logo-layout-dashboard .dashboard-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.82rem;
    border-radius: 8px;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

body.logo-layout-dashboard .dashboard-nav-link:hover {
    color: var(--text);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.06);
}

body.logo-layout-dashboard .dashboard-nav-link.is-active {
    color: #72b043;
    border-color: rgba(114, 176, 67, 0.45);
    background: rgba(114, 176, 67, 0.12);
}

body.logo-layout-dashboard .provider-indicator {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.82rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

body.logo-layout-dashboard .provider-indicator-hint {
    margin-left: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-size: 0.68rem;
    line-height: 1;
    opacity: 0.9;
}

body.logo-layout-dashboard .provider-indicator.is-active {
    color: #d7ffec;
    border-color: rgba(114, 176, 67, 0.45);
    background: rgba(114, 176, 67, 0.14);
}

body.logo-layout-dashboard .provider-indicator.is-inactive {
    color: #ffd8d8;
    border-color: rgba(255, 59, 59, 0.45);
    background: rgba(255, 59, 59, 0.14);
}

body.logo-layout-dashboard .workspace {
    display: flex;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
    padding-top: 9.6rem;
}

body.logo-layout-dashboard .workspace-splitter {
    flex: 0 0 10px;
    position: relative;
    cursor: col-resize;
    background: transparent;
    touch-action: none;
}

body.logo-layout-dashboard .workspace-splitter::before {
    content: "";
    position: absolute;
    top: 0.65rem;
    bottom: 0.65rem;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.14);
}

body.logo-layout-dashboard .workspace-splitter:hover::before,
body.logo-layout-dashboard .workspace-splitter.is-active::before {
    background: rgba(114, 176, 67, 0.78);
    box-shadow: 0 0 10px rgba(114, 176, 67, 0.28);
}

body.logo-layout-dashboard .workspace-splitter:focus-visible,
body.logo-layout-dashboard .editor-splitter:focus-visible {
    outline: 2px solid rgba(114, 176, 67, 0.9);
    outline-offset: -2px;
    border-radius: 6px;
}

body.logo-layout-dashboard .workspace-sidebar {
    width: 240px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    padding: 1rem;
    gap: 0.7rem;
    background: var(--surface);
    min-height: 0;
}

body.logo-layout-dashboard .sidebar-bottom-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

body.logo-layout-dashboard .sidebar-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

body.logo-layout-dashboard .sidebar-toolbar input,
body.logo-layout-dashboard .sidebar-toolbar select,
body.logo-layout-dashboard #sidebarFileSearch {
    margin-top: 0;
    padding: 0.5rem 0.58rem;
    font-size: 0.82rem;
}

body.logo-layout-dashboard .sidebar-section-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.logo-layout-dashboard .sidebar-header h3,
body.logo-layout-dashboard .ai-header h3 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

body.logo-layout-dashboard .project-list {
    flex: 0 0 auto;
    max-height: 28vh;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.logo-layout-dashboard .sidebar-files-tree {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.logo-layout-dashboard .file-tree-folder {
    border: 0;
    border-radius: 6px;
    background: transparent;
}

body.logo-layout-dashboard .file-tree-folder > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.25rem 0.35rem;
    font-size: 0.8rem;
    color: var(--text);
    display: flex;
    align-items: center;
    border-radius: 6px;
    gap: 0.3rem;
}

body.logo-layout-dashboard .file-tree-folder > summary::before {
    content: "▸";
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1;
    transform: translateY(-1px);
    transition: transform 0.16s ease;
}

body.logo-layout-dashboard .file-tree-folder[open] > summary::before {
    transform: rotate(90deg) translateY(-1px);
}

body.logo-layout-dashboard .file-tree-folder > summary:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.logo-layout-dashboard .file-tree-folder > summary::-webkit-details-marker {
    display: none;
}

body.logo-layout-dashboard .file-tree-body {
    padding: 0.06rem 0 0.12rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

body.logo-layout-dashboard .file-tree-folder-label,
body.logo-layout-dashboard .generated-file-main {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-width: 0;
}

body.logo-layout-dashboard .file-tree-icon {
    font-size: 0.85rem;
    line-height: 1;
    flex: 0 0 auto;
}

body.logo-layout-dashboard .file-tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.logo-layout-dashboard .file-tree-project-root {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.12rem;
}

body.logo-layout-dashboard .file-tree-project-root > summary {
    font-weight: 600;
}

body.logo-layout-dashboard .project-item {
    width: 100%;
    padding: 0.55rem 0.65rem;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}

body.logo-layout-dashboard .project-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.35rem;
}

body.logo-layout-dashboard .project-item-delete {
    border: 1px solid rgba(255, 59, 59, 0.35);
    background: rgba(255, 59, 59, 0.1);
    color: #ffd7d7;
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    font-size: 0.84rem;
    line-height: 1;
}

body.logo-layout-dashboard .project-item-delete:hover {
    background: rgba(255, 59, 59, 0.2);
    border-color: rgba(255, 59, 59, 0.6);
    color: #fff;
}

body.logo-layout-dashboard .project-item:hover,
body.logo-layout-dashboard .project-item.is-active {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.05);
}

body.logo-layout-dashboard .project-item-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-weight: 600;
}

body.logo-layout-dashboard .project-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.08rem 0.38rem;
    border-radius: 999px;
    border: 1px solid rgba(114, 176, 67, 0.45);
    background: rgba(114, 176, 67, 0.12);
    color: rgba(204, 250, 255, 0.95);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
}

body.logo-layout-dashboard .project-item-meta {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

body.logo-layout-dashboard .btn.full {
    width: 100%;
}

body.logo-layout-dashboard .workspace-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
}

body.logo-layout-dashboard .workspace-topbar {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
    gap: 0.65rem;
    align-items: center;
    margin: 0.65rem 0.85rem;
    padding: 0.7rem 0.85rem;
    min-height: 56px;
    max-height: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(16, 18, 24, 0.95), rgba(10, 11, 16, 0.96));
    overflow: visible;
}

.project-intelligence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.project-intelligence-header h4 {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

.project-intelligence-actions {
    display: inline-flex;
    gap: 0.35rem;
}

.btn-memory,
.btn-memory-build {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
    line-height: 1.2;
}

.btn-memory-build {
    background: rgba(48, 158, 97, 0.22);
    border-color: rgba(73, 198, 128, 0.45);
}

.project-intelligence-status,
.project-intelligence-updated {
    margin-top: 0.55rem;
    font-size: 0.76rem;
    color: rgba(238, 245, 255, 0.82);
}

.project-intelligence-summary {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: rgba(238, 245, 255, 0.95);
    max-height: 120px;
    overflow: auto;
}

.project-intelligence-dependencies,
.project-intelligence-files {
    margin-top: 0.55rem;
    max-height: 110px;
    overflow: auto;
}

.project-intelligence-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.3rem;
}

.project-intelligence-list li {
    font-size: 0.74rem;
    color: rgba(216, 230, 248, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    background: rgba(255, 255, 255, 0.04);
}

body.logo-layout-dashboard .workspace-project-name-block {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.logo-layout-dashboard .workspace-control-title,
body.logo-layout-dashboard .workspace-project-type-label {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    line-height: 1;
}

body.logo-layout-dashboard .workspace-project-name-block #workspaceProjectName {
    width: 100%;
}

body.logo-layout-dashboard .workspace-type-filter-block {
    width: 170px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.logo-layout-dashboard .workspace-topbar #workspaceProjectType {
    width: 100%;
}

body.logo-layout-dashboard .workspace-type-filter-block #projectTypeFilterSelect {
    width: 100%;
}

body.logo-layout-dashboard .workspace-build-today {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.logo-layout-dashboard .workspace-build-today-title {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    line-height: 1;
}

body.logo-layout-dashboard .workspace-build-mode-wrap {
    width: 230px;
}

body.logo-layout-dashboard .workspace-topbar #aiBuildMode {
    width: 100%;
}

body.logo-layout-dashboard .workspace-openai-type-wrap {
    width: 230px;
    position: relative;
    z-index: 10;
    overflow: visible;
}

body.logo-layout-dashboard .workspace-openai-type-wrap.is-hidden {
    display: none;
}

body.logo-layout-dashboard .workspace-fullstack-type-wrap {
    width: 230px;
}

body.logo-layout-dashboard .workspace-fullstack-type-wrap.is-hidden {
    display: none;
}

body.logo-layout-dashboard .workspace-topbar #openAiProjectType {
    width: 100%;
}

body.logo-layout-dashboard .workspace-topbar #fullStackProjectType {
    width: 100%;
}

body.logo-layout-dashboard .workspace-build-schema-warning {
    margin-top: 0.35rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.14);
    color: #fef3c7;
    font-size: 0.74rem;
    line-height: 1.35;
}

body.logo-layout-dashboard .workspace-build-schema-warning.is-hidden {
    display: none;
}

body.logo-layout-dashboard .workspace-topbar input,
body.logo-layout-dashboard .workspace-topbar select {
    margin-top: 0;
    pointer-events: auto;
}

body.logo-layout-dashboard .workspace-topbar #projectTypeFilterSelect,
body.logo-layout-dashboard .workspace-topbar #workspaceProjectType {
    position: relative;
    z-index: 6;
    cursor: pointer;
}

body.logo-layout-dashboard .workspace-topbar .btn {
    width: auto;
    white-space: nowrap;
}

body.logo-layout-dashboard .processing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.55rem 0.75rem 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(114, 176, 67, 0.25);
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.08);
    color: #dce0e5;
    font-size: 0.82rem;
}

body.logo-layout-dashboard .processing-indicator.is-hidden {
    display: none;
}

body.logo-layout-dashboard .processing-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #72b043;
    box-shadow: 0 0 10px rgba(114, 176, 67, 0.6);
    animation: dashboardProcessingPulse 0.9s ease-in-out infinite;
}

@keyframes dashboardProcessingPulse {
    0%,
    100% {
        transform: scale(0.75);
        opacity: 0.6;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

body.logo-layout-dashboard .workspace-version {
    margin-left: 0;
    color: var(--muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

body.logo-layout-dashboard .editor-wrapper {
    flex: 1;
    padding: 0.55rem 0.75rem;
    min-height: 0;
    height: calc(100% - 56px - 38px);
}

body.logo-layout-dashboard .editor-wrapper.editor-split {
    --editor-split-left: 56%;
    display: grid;
    grid-template-columns: minmax(300px, var(--editor-split-left)) 10px minmax(240px, calc(100% - var(--editor-split-left) - 10px));
    grid-template-rows: minmax(360px, 1fr);
    gap: 0.5rem;
}

body.logo-layout-dashboard .editor-splitter {
    position: relative;
    cursor: col-resize;
    border-radius: 6px;
    touch-action: none;
}

body.logo-layout-dashboard .editor-splitter::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.16);
}

body.logo-layout-dashboard .editor-splitter:hover::before,
body.logo-layout-dashboard .editor-splitter.is-active::before {
    background: rgba(114, 176, 67, 0.75);
    box-shadow: 0 0 10px rgba(114, 176, 67, 0.26);
}

body.logo-layout-dashboard .editor-pane,
body.logo-layout-dashboard .preview-pane {
    min-width: 0;
    min-height: 0;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}

body.logo-layout-dashboard #codeEditor {
    width: 100%;
    height: 100%;
    resize: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
    margin-top: 0;
    border: 0;
    border-radius: 0;
}

body.logo-layout-dashboard #workspacePreview {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

body.logo-layout-dashboard .editor-status {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.55rem 0.9rem;
    min-height: 38px;
    max-height: 38px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--muted);
}

body.logo-layout-dashboard .editor-status #fileStatus,
body.logo-layout-dashboard .editor-status #creditStatus,
body.logo-layout-dashboard .editor-status #providerStatus {
    opacity: 0.86;
    transform: translateY(0);
    transition: opacity 180ms ease, transform 180ms ease;
}

body.logo-layout-dashboard .editor-status #autoSaveStatus {
    opacity: 0.7;
    transition: color 180ms ease, opacity 180ms ease;
}

body.logo-layout-dashboard .editor-status #autoSaveStatus[data-state="pending"],
body.logo-layout-dashboard .editor-status #autoSaveStatus[data-state="saving"] {
    color: #ccff88;
    opacity: 0.84;
}

body.logo-layout-dashboard .editor-status #autoSaveStatus[data-state="saved"] {
    color: #7fffc1;
    opacity: 0.82;
}

body.logo-layout-dashboard .editor-status #autoSaveStatus[data-state="failed"] {
    color: #ff9a9a;
    opacity: 0.9;
}

body.logo-layout-dashboard .editor-status #fileStatus.status-toast-visible,
body.logo-layout-dashboard .editor-status #creditStatus.status-toast-visible,
body.logo-layout-dashboard .editor-status #providerStatus.status-toast-visible {
    opacity: 1;
    transform: translateY(-1px);
}

body.logo-layout-dashboard .workspace-ai {
    width: clamp(300px, 26vw, 420px);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background: var(--surface);
    min-width: 280px;
    min-height: 0;
}

body.logo-layout-dashboard .workspace-files {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
    min-height: 160px;
    max-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

body.logo-layout-dashboard .workspace-files h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.01em;
}

body.logo-layout-dashboard .generated-files-list {
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.logo-layout-dashboard .generated-file-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.28rem 0.36rem;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

body.logo-layout-dashboard .generated-file-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

body.logo-layout-dashboard .generated-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.logo-layout-dashboard .generated-file-type {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 0.08rem 0.42rem;
    font-size: 0.64rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

body.logo-layout-dashboard .generated-file-item:hover,
body.logo-layout-dashboard .generated-file-item.is-active {
    background: rgba(114, 176, 67, 0.1);
    border-color: rgba(114, 176, 67, 0.48);
}

body.logo-layout-dashboard .ai-header {
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
    min-height: 56px;
    max-height: 56px;
    border-bottom: 1px solid var(--border);
}

body.logo-layout-dashboard .chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem 0.9rem;
    min-height: 0;
}

body.logo-layout-dashboard .chat-message {
    margin-bottom: 0.55rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

body.logo-layout-dashboard .chat-message.user {
    color: #dbe9f7;
}

body.logo-layout-dashboard .chat-message.assistant {
    color: var(--text);
}

body.image-studio-page .image-studio-shell {
    padding-top: 9.8rem;
}

body.image-studio-page .image-studio {
    display: flex;
    gap: 30px;
    padding: 30px;
}

body.image-studio-page .studio-controls {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

body.image-studio-page .studio-controls textarea {
    height: 150px;
    resize: none;
}

body.image-studio-page .studio-controls input,
body.image-studio-page .studio-controls select,
body.image-studio-page .studio-controls textarea {
    margin-top: 0;
}

body.image-studio-page .upload-control-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.image-studio-page .studio-message {
    min-height: 20px;
    font-size: 0.85rem;
    color: var(--muted);
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 180ms ease, transform 180ms ease;
}

body.image-studio-page .studio-message.is-visible {
    opacity: 1;
    transform: translateY(0);
}

body.image-studio-page .studio-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

body.image-studio-page #generatedImage {
    max-width: 100%;
    border-radius: 10px;
}

body.image-studio-page .studio-gallery {
    padding: 30px;
}

body.image-studio-page #imageGallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

body.image-studio-page #imageGallery img {
    width: 100%;
    border-radius: 8px;
}

body.image-studio-page .studio-gallery-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.image-studio-page .studio-gallery-item figcaption {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: capitalize;
}

body.image-studio-page .studio-gallery-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

body.image-studio-page .studio-download-format-label {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

body.image-studio-page .studio-download-format-select {
    width: auto;
    min-width: 96px;
    margin-top: 0;
}

body.image-studio-page .studio-delete-btn {
    width: auto;
    min-height: 30px;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
}

@media (max-width: 768px) {
    body.image-studio-page .image-studio {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    body.image-studio-page .studio-controls {
        width: 100%;
    }

    body.image-studio-page .studio-gallery {
        padding: 16px;
    }

    body.image-studio-page #imageGallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    body.image-studio-page .image-studio-shell {
        padding-top: 6rem;
    }

    body.image-studio-page .image-studio {
        padding: 10px;
        gap: 12px;
    }

    body.image-studio-page .studio-gallery {
        padding: 10px;
    }

    body.image-studio-page #imageGallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

body.logo-layout-dashboard .chat-input-area {
    padding: 0.7rem;
    min-height: 0;
    max-height: min(42vh, 260px);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow-y: auto;
}

body.logo-layout-dashboard .chat-input-area.is-drag-active {
    background: rgba(114, 176, 67, 0.08);
    box-shadow: inset 0 0 0 1px rgba(114, 176, 67, 0.5);
}

body.logo-layout-dashboard .chat-input-area textarea {
    resize: vertical;
    min-height: 84px;
    height: clamp(84px, 15vh, 170px);
    max-height: 28vh;
    margin-top: 0;
}

body.logo-layout-dashboard .chat-input-area .btn {
    flex: 0 0 auto;
    width: 100%;
}

body.logo-layout-dashboard .chat-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

body.logo-layout-dashboard .chat-actions-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.logo-layout-dashboard .chat-actions-row #generateRequest {
    width: auto;
    min-width: 160px;
}

body.logo-layout-dashboard .chat-actions-left #downloadProjectBtn,
body.logo-layout-dashboard .chat-actions-left #resetLayoutBtn,
body.logo-layout-dashboard .chat-actions-row #resetLayoutBtn {
    width: auto;
    white-space: nowrap;
}

body.logo-layout-dashboard .chat-attachment-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 28px;
}

body.logo-layout-dashboard .chat-attachment-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.logo-layout-dashboard .attachment-toggle {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-radius: 8px;
    min-height: 30px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    cursor: pointer;
}

body.logo-layout-dashboard .attachment-toggle:hover {
    border-color: rgba(114, 176, 67, 0.55);
    color: #ccff88;
}

body.logo-layout-dashboard .attachment-summary {
    color: var(--muted);
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.logo-layout-dashboard .attachment-list {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-height: 22px;
}

body.logo-layout-dashboard .attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #d9ecff;
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
}

body.logo-layout-dashboard .attachment-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

body.logo-layout-dashboard .attachment-chip-remove {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0;
}

body.logo-layout-dashboard .attachment-chip-remove:hover {
    color: #ffb3b3;
}

body.logo-layout-dashboard .workspace-empty {
    color: var(--muted);
    font-size: 0.9rem;
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    flex: 1;
    padding-right: 64px;
}

.show-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    letter-spacing: 0.03em;
    transition: color 0.15s;
    user-select: none;
}

.show-password-btn:hover {
    color: var(--accent);
}

.password-meter {
    height: 8px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 12px;
}

.password-meter-bar {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.2s ease;
}

.password-rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px 12px;
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 12px;
}

.password-rules span {
    opacity: 0.6;
}

.password-rules span.is-ok {
    opacity: 1;
    color: var(--accent);
    font-weight: 600;
}

@media (max-width: 992px) {
    .container {
        padding: 2rem 1rem 2.5rem;
    }

    .card {
        padding: 1.35rem;
        border-radius: 14px;
    }

    .field-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    body.logo-layout-dashboard .workspace {
        padding-top: 9rem;
    }

    body.logo-layout-dashboard .workspace-topbar {
        flex-wrap: wrap;
        min-height: 0;
        max-height: none;
    }

    body.logo-layout-dashboard .ai-header,
    body.logo-layout-dashboard .chat-input-area {
        min-height: 0;
        max-height: none;
    }

    body.logo-layout-dashboard .chat-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    body.logo-layout-dashboard .chat-actions-left {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    body.logo-layout-dashboard .chat-actions-row #generateRequest,
    body.logo-layout-dashboard .chat-actions-left #downloadProjectBtn,
    body.logo-layout-dashboard .chat-actions-left #resetLayoutBtn {
        width: 100%;
    }

    body.logo-layout-dashboard .workspace-topbar #workspaceProjectName,
    body.logo-layout-dashboard .workspace-topbar .workspace-project-name-block,
    body.logo-layout-dashboard .workspace-topbar .workspace-type-filter-block,
    body.logo-layout-dashboard .workspace-topbar #projectTypeFilterSelect,
    body.logo-layout-dashboard .workspace-topbar .workspace-build-today,
    body.logo-layout-dashboard .workspace-topbar .workspace-project-type-label,
    body.logo-layout-dashboard .workspace-topbar #workspaceProjectType,
    body.logo-layout-dashboard .workspace-topbar .workspace-build-mode-wrap,
    body.logo-layout-dashboard .workspace-topbar .workspace-build-schema-warning,
    body.logo-layout-dashboard .workspace-topbar #aiBuildMode,
    body.logo-layout-dashboard .workspace-topbar .btn,
    body.logo-layout-dashboard .workspace-topbar .workspace-version {
        width: 100%;
        margin-left: 0;
    }

    body.logo-layout-dashboard .editor-wrapper {
        height: auto;
    }

    body.logo-layout-dashboard .editor-wrapper.editor-split {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(260px, 1fr);
    }

    body.logo-layout-dashboard .workspace-splitter,
    body.logo-layout-dashboard .editor-splitter {
        display: none;
    }

    body.logo-layout-dashboard .workspace-sidebar {
        width: 220px;
    }

    body.logo-layout-dashboard .workspace-ai {
        width: clamp(280px, 35vw, 360px);
        min-width: 260px;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }

    .container {
        padding: 1.5rem 0.85rem 2rem;
    }

    .auth-page {
        padding: 16px;
    }

    .global-site-logo {
        top: 12px;
        left: 12px;
        padding: 8px 12px;
    }

    .global-site-logo + .auth-page {
        padding-top: 88px;
    }

    .global-site-logo + .container,
    .global-site-logo + main.container {
        padding-top: 6rem;
    }

    body.logo-layout-auth .auth-page {
        padding-top: 84px;
    }

    body.logo-layout-builder .auth-page {
        padding-top: 90px;
    }

    body.logo-layout-utility .container,
    body.logo-layout-utility main.container {
        padding-top: 5.6rem;
    }

    body.logo-layout-dashboard .container,
    body.logo-layout-dashboard main.container {
        padding-top: 5.6rem;
    }

    body.logo-layout-dashboard .workspace {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding-top: 8rem;
    }

    body.logo-layout-dashboard .dashboard-navbar {
        top: 64px;
        left: 12px;
        right: 12px;
        padding: 0.45rem;
        gap: 0.35rem;
    }

    body.logo-layout-dashboard .dashboard-nav-link {
        font-size: 0.78rem;
        min-height: 30px;
        padding: 0.35rem 0.62rem;
    }

    body.logo-layout-dashboard .workspace-topbar,
    body.logo-layout-dashboard .editor-status,
    body.logo-layout-dashboard .ai-header,
    body.logo-layout-dashboard .chat-input-area {
        min-height: 0;
        max-height: none;
    }

    body.logo-layout-dashboard .editor-wrapper {
        height: auto;
    }

    body.logo-layout-dashboard .workspace-sidebar,
    body.logo-layout-dashboard .workspace-ai {
        width: 100%;
        border-right: 0;
        border-left: 0;
    }

    body.logo-layout-dashboard .workspace-sidebar {
        border-bottom: 1px solid var(--border);
    }

    body.logo-layout-dashboard .workspace-ai {
        border-top: 1px solid var(--border);
        min-height: 40vh;
    }

    body.logo-layout-dashboard .chat-history {
        min-height: 26vh;
        max-height: 46vh;
    }

    body.logo-layout-dashboard .chat-input-area {
        max-height: none;
    }

    body.logo-layout-dashboard .chat-input-area textarea {
        min-height: 92px;
        height: clamp(92px, 18vh, 190px);
        max-height: 34vh;
    }

    body.logo-layout-dashboard .workspace-editor {
        min-height: 55vh;
    }

    .global-site-logo-text {
        font-size: 20px;
    }

    .card {
        padding: 1rem;
    }

    input,
    textarea,
    select {
        margin-top: 0.5rem;
        padding: 0.78rem 0.85rem;
        font-size: 0.95rem;
    }

    .btn {
        width: 100%;
        padding: 0.78rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* -- Runtime & Deploy Buttons ------------------------------------------------ */
.btn-run {
    background: #1a7f37;
    color: #fff;
    border-color: #1a7f37;
}
.btn-run:hover:not(:disabled) {
    background: #15692e;
    border-color: #15692e;
}
.btn-deploy {
    background: #0969da;
    color: #fff;
    border-color: #0969da;
}
.btn-deploy:hover:not(:disabled) {
    background: #0550ae;
    border-color: #0550ae;
}
.btn-analyze {
    background: #6f42c1;
    color: #fff;
    border-color: #6f42c1;
}
.btn-analyze:hover:not(:disabled) {
    background: #5a32a3;
    border-color: #5a32a3;
}
.btn-autofix {
    background: #d97706;
    color: #fff;
    border-color: #d97706;
}
.btn-autofix:hover:not(:disabled) {
    background: #b45309;
    border-color: #b45309;
}
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* -- Deploy Modal ----------------------------------------------------------- */
.deploy-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}
.deploy-modal-overlay.is-hidden {
    display: none;
}
.deploy-modal {
    background: var(--bg-surface, #1e1e1e);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 10px;
    width: min(480px, 96vw);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.deploy-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #3a3a3a);
}
.deploy-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary, #e8e8e8);
}
.deploy-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted, #888);
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
}
.deploy-modal-close:hover {
    background: var(--bg-hover, #2a2a2a);
    color: var(--text-primary, #e8e8e8);
}
.deploy-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.deploy-modal-info {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    margin: 0;
}
.deploy-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #ccc);
}
.deploy-target-select {
    padding: 0.45rem 0.65rem;
    border-radius: 5px;
    border: 1px solid var(--border-color, #3a3a3a);
    background: var(--bg-input, #2a2a2a);
    color: var(--text-primary, #e8e8e8);
    font-size: 0.9rem;
    width: 100%;
}
.deploy-env-hint {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    margin: 0;
    padding: 0.4rem 0.5rem;
    background: var(--bg-code, #252525);
    border-radius: 4px;
}
.deploy-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--border-color, #3a3a3a);
    flex-wrap: wrap;
}
.deploy-status {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-muted, #888);
}

/* -- AI Code Diagnostics Modal --------------------------------------------- */
.diagnostics-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 901;
    padding-top: 4vh;
    overflow-y: auto;
}
.diagnostics-modal-overlay.is-hidden {
    display: none;
}
.diagnostics-modal {
    background: var(--bg-surface, #1e1e1e);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 10px;
    width: min(860px, 96vw);
    max-height: 85vh;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 4vh;
}
.diagnostics-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #3a3a3a);
    flex-shrink: 0;
}
.diagnostics-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary, #e8e8e8);
}
.diagnostics-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted, #888);
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
}
.diagnostics-modal-close:hover {
    background: var(--bg-hover, #2a2a2a);
    color: var(--text-primary, #e8e8e8);
}
.diagnostics-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #3a3a3a);
    flex-shrink: 0;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.diagnostics-summary {
    font-size: 0.85rem;
    color: var(--text-muted, #999);
}
.diagnostics-fix-btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
}
.diagnostics-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.diagnostics-empty-state {
    font-size: 0.9rem;
    color: var(--text-muted, #888);
    text-align: center;
    padding: 2rem 0;
    margin: 0;
}
.diagnostics-empty-state.diagnostics-clean {
    color: #3fb950;
}
.diagnostics-error {
    font-size: 0.9rem;
    color: #f44336;
    padding: 1rem 0;
    margin: 0;
}
.diagnostics-file-group {
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 6px;
    overflow: hidden;
}
.diagnostics-file-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: var(--bg-code, #252525);
    font-size: 0.85rem;
    color: var(--text-secondary, #ccc);
    flex-wrap: wrap;
}
.diagnostics-issue-count {
    margin-left: auto;
    font-size: 0.78rem;
    background: rgba(120, 80, 200, 0.2);
    color: #b49df8;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
}
.diagnostics-diff-stat {
    margin-left: auto;
    font-size: 0.78rem;
    font-family: monospace;
    color: var(--text-muted, #888);
}
.diagnostics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.diagnostics-table thead tr {
    background: var(--bg-code, #252525);
}
.diagnostics-table th {
    padding: 0.45rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted, #888);
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border-color, #3a3a3a);
}
.diagnostics-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: top;
    color: var(--text-secondary, #ccc);
    line-height: 1.4;
}
.diagnostics-row:last-child td {
    border-bottom: none;
}
.diagnostics-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}
.diagnostics-badge-critical { background: rgba(248, 81, 73, 0.18); color: #f85149; }
.diagnostics-badge-warning  { background: rgba(210, 153, 34, 0.18); color: #d29922; }
.diagnostics-badge-info     { background: rgba(88, 166, 255, 0.18); color: #58a6ff; }
.diagnostics-sev-critical td { background: rgba(248, 81, 73, 0.04); }
.diagnostics-sev-warning  td { background: rgba(210, 153, 34, 0.04); }
.diagnostics-diff-block {
    padding: 0.75rem 1rem;
    background: var(--bg-code, #252525);
}
.diagnostics-diff-pre {
    margin: 0;
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-secondary, #ccc);
    overflow-x: auto;
    white-space: pre;
}
.diff-add    { color: #3fb950; display: block; }
.diff-remove { color: #f85149; display: block; }
.diagnostics-modal-footer {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color, #3a3a3a);
    flex-shrink: 0;
}
.diagnostics-status {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.system-health-panel {
    margin: 10px 0 18px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(5, 12, 22, 0.72), rgba(20, 10, 6, 0.66));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.system-health-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.system-health-header h4 {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #d6e8ff;
}

.system-health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.system-health-grid .engine-monitor-card,
.system-health-grid .db-health-card {
    margin: 0;
    min-height: 100%;
}

.engine-monitor-card {
    margin: 14px 0 18px;
    padding: 14px;
    border: 1px solid rgba(114, 176, 67, 0.22);
    border-radius: 12px;
    background: rgba(10, 11, 16, 0.75);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.db-health-card {
    margin: 10px 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 184, 61, 0.28);
    border-radius: 12px;
    background: rgba(34, 24, 6, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.db-health-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.db-health-header h4 {
    margin: 0;
    font-size: 0.92rem;
}

.db-health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
}

.db-health-grid p {
    margin: 0;
    font-size: 0.82rem;
    color: #d4e6f5;
}

.db-health-message {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #ffd082;
}

.db-health-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.db-health-actions .btn {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.78rem;
}

.db-health-hints {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #f7d7a1;
    font-size: 0.78rem;
    line-height: 1.5;
}

.db-health-hints:empty {
    display: none;
}

.badge-warning {
    color: #ffd082;
    border-color: rgba(255, 184, 61, 0.45);
    background: rgba(255, 184, 61, 0.12);
}

.badge-success {
    color: #8cf0c9;
    border-color: rgba(47, 212, 138, 0.5);
    background: rgba(47, 212, 138, 0.14);
}

.badge-danger {
    color: #ff9a9a;
    border-color: rgba(248, 81, 73, 0.45);
    background: rgba(248, 81, 73, 0.14);
}

.engine-monitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.engine-monitor-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.engine-monitor-card p {
    margin: 6px 0;
    color: #d4e6f5;
    font-size: 0.9rem;
}

.engine-monitor-progress {
    margin-top: 10px;
    width: 100%;
    height: 22px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.engine-monitor-progress-bar {
    height: 100%;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #72b043, #007f4e);
    color: #081019;
    font-size: 0.76rem;
    font-weight: 700;
    transition: width 0.35s ease;
}

.engine-monitor-updated {
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--muted);
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.72rem;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-primary {
    color: #8be7ff;
    border-color: rgba(114, 176, 67, 0.4);
    background: rgba(114, 176, 67, 0.12);
}

@media (max-width: 980px) {
    .system-health-grid {
        grid-template-columns: 1fr;
    }
}
