#legacyAppHostWorkspace {
    display: none !important;
}

#hostView #appHostWorkspace {
    width: 100%;
    min-width: 0;
    display: none !important;
}

#hostView #appHostWorkspace.active {
    display: block !important;
}

.host-project-onboarding {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 18px;
}

#hostView .host-project-onboarding .host-surface,
#hostView .host-project-console .host-surface {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 16px 42px rgba(23, 24, 29, .055);
}

.host-domain-input {
    width: 100%;
    min-height: 47px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.host-domain-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.host-domain-input input {
    min-width: 60px;
    flex: 1;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font: 650 .76rem "Space Grotesk", sans-serif;
}

.host-domain-input > span {
    color: var(--text-3);
    font-size: .67rem;
    font-weight: 650;
    white-space: nowrap;
}

.host-create-project-btn {
    width: 100%;
    min-height: 47px;
    margin-top: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    color: #17120e;
    background: var(--accent);
    font: 750 .72rem "Space Grotesk", sans-serif;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.host-create-project-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.host-create-project-btn:disabled {
    opacity: .55;
    cursor: wait;
}

.host-create-project-btn svg {
    width: 15px;
    height: 15px;
}

.host-project-intro {
    min-height: 360px;
    padding: 38px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden !important;
    background:
        radial-gradient(circle at 82% 16%, rgba(241, 125, 31, .13), transparent 31%),
        var(--surface) !important;
}

.host-project-intro-icon {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: #7657c9;
    background: #f1edff;
}

.host-project-intro-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.7;
}

#hostView .host-project-intro h3 {
    max-width: 13ch;
    margin: 24px 0 12px !important;
    color: var(--text);
    font: 650 1.65rem/1.08 "Space Grotesk", sans-serif !important;
    letter-spacing: -.045em;
    text-transform: none;
}

.host-project-intro p {
    max-width: 58ch;
    margin: 0;
    color: var(--text-3);
    font-size: .72rem;
    line-height: 1.65;
}

.host-project-intro code {
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--text);
    background: var(--surface-2);
}

.host-project-intro > div {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.host-project-intro > div span {
    min-height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-2);
    background: var(--surface-2);
    font-size: .59rem;
    font-weight: 650;
}

.host-project-intro > div svg {
    width: 13px;
    height: 13px;
    color: var(--accent);
}

.host-project-console {
    width: 100%;
    animation: hostProjectEnter .3s ease both;
}

.host-project-toolbar {
    padding: 17px 19px !important;
    display: flex;
    align-items: center;
    gap: 13px;
}

.host-project-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 1;
}

.host-project-identity > div {
    min-width: 0;
}

.host-project-identity small,
.host-pane-heading small,
.host-editor-toolbar small {
    display: block;
    color: var(--text-3);
    font-size: .5rem;
    font-weight: 800;
    letter-spacing: .09em;
}

#hostView .host-project-identity h3 {
    margin: 2px 0 !important;
    overflow: hidden;
    color: var(--text);
    font-size: .82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.host-project-identity a {
    display: block;
    overflow: hidden;
    color: #3974cb;
    font-size: .59rem;
    font-weight: 650;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.host-project-domain-note {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--text-3);
    font-size: .48rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.host-project-toolbar-actions {
    display: flex;
    gap: 7px;
}

.host-project-toolbar-actions button,
.host-editor-toolbar button,
.host-project-settings-actions button {
    min-height: 37px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 11px;
    color: var(--text-2);
    background: var(--surface-2);
    font: 700 .61rem "Space Grotesk", sans-serif;
    cursor: pointer;
}

.host-project-toolbar-actions button.primary,
.host-project-settings-actions button.primary {
    color: #17120e;
    background: var(--accent);
}

.host-project-toolbar-actions svg,
.host-editor-toolbar button svg,
.host-project-settings-actions svg {
    width: 13px;
    height: 13px;
}

.host-project-main {
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
    gap: 14px;
}

#hostView .host-file-manager,
#hostView .host-code-editor {
    padding: 0 !important;
    overflow: hidden !important;
}

.host-pane-heading,
.host-editor-toolbar {
    min-height: 65px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.host-pane-heading strong,
.host-editor-toolbar strong {
    display: block;
    max-width: 34vw;
    margin-top: 3px;
    overflow: hidden;
    color: var(--text);
    font-size: .72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.host-pane-heading > div:last-child,
.host-editor-toolbar > div:last-child {
    display: flex;
    gap: 6px;
}

.host-pane-heading button {
    width: 33px;
    height: 33px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: var(--text-2);
    background: var(--surface-2);
    cursor: pointer;
}

.host-pane-heading button:hover {
    color: var(--accent);
    background: var(--accent-subtle);
}

.host-pane-heading button svg {
    width: 14px;
    height: 14px;
}

.host-project-file-list {
    min-height: 398px;
    max-height: 398px;
    padding: 10px;
    overflow-y: auto;
}

.host-project-file {
    width: 100%;
    min-height: 52px;
    padding: 7px 8px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 12px;
    color: var(--text-2);
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.host-project-file:hover,
.host-project-file.active {
    color: var(--text);
    background: var(--surface-2);
}

.host-project-file.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.host-project-file > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border-radius: 10px;
    color: #7657c9;
    background: #f1edff;
}

.host-project-file > span svg {
    width: 15px;
    height: 15px;
}

.host-project-file > div {
    min-width: 0;
    flex: 1;
}

.host-project-file strong,
.host-project-file small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.host-project-file strong {
    font-size: .61rem;
    font-weight: 650;
}

.host-project-file small {
    margin-top: 3px;
    color: var(--text-3);
    font-size: .5rem;
}

.host-project-file > svg {
    width: 13px;
    height: 13px;
    color: var(--text-3);
}

.host-project-file-empty {
    min-height: 398px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    text-align: center;
}

.host-project-file-empty svg {
    width: 26px;
    height: 26px;
    margin-bottom: 10px;
}

.host-project-file-empty strong {
    color: var(--text);
    font-size: .65rem;
}

.host-project-file-empty span {
    margin-top: 4px;
    font-size: .54rem;
}

.host-storage-summary {
    padding: 14px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.host-storage-summary > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-3);
    font-size: .52rem;
}

.host-storage-summary strong {
    color: var(--text-2);
}

.host-storage-track {
    height: 5px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border);
}

.host-storage-track span {
    width: 0;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--accent);
    transition: width .25s ease;
}

.host-storage-summary > small {
    display: block;
    margin-top: 8px;
    color: var(--text-3);
    font-size: .48rem;
    line-height: 1.4;
}

.host-editor-placeholder {
    min-height: 510px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    text-align: center;
}

.host-editor-placeholder > span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 13px;
    border-radius: 16px;
    color: #7657c9;
    background: #f1edff;
}

.host-editor-placeholder svg {
    width: 21px;
    height: 21px;
}

.host-editor-placeholder strong {
    color: var(--text);
    font-size: .75rem;
}

.host-editor-placeholder p {
    max-width: 42ch;
    margin: 6px 0 0;
    font-size: .6rem;
    line-height: 1.5;
}

.host-editor-code {
    height: 455px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    overflow: hidden;
    background: #17171b;
}

.host-editor-code pre {
    height: 100%;
    margin: 0;
    padding: 17px 10px;
    overflow: hidden;
    border-right: 1px solid #2b2b31;
    color: #6e6e78;
    background: #1d1d22;
    font: 500 .7rem/1.65 "Courier New", monospace;
    text-align: right;
    user-select: none;
}

.host-editor-code textarea {
    width: 100%;
    height: 100%;
    padding: 17px;
    overflow: auto;
    resize: none;
    border: 0;
    outline: 0;
    color: #ededf0;
    caret-color: var(--accent);
    background: transparent;
    font: 500 .7rem/1.65 "Courier New", monospace;
    tab-size: 2;
    white-space: pre;
}

.host-editor-footer {
    min-height: 55px;
    padding: 0 13px 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #2b2b31;
    color: #a5a5ad;
    background: #1d1d22;
}

.host-editor-footer > span {
    color: #50c99a;
    font-size: .55rem;
    font-weight: 700;
}

.host-editor-footer > span.dirty {
    color: #ffad65;
}

.host-editor-footer small {
    color: #777780;
    font-size: .5rem;
}

.host-editor-footer button {
    min-height: 34px;
    margin-left: auto;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 10px;
    color: #17120e;
    background: var(--accent);
    font: 700 .56rem "Space Grotesk", sans-serif;
    cursor: pointer;
}

.host-editor-footer svg {
    width: 12px;
    height: 12px;
}

.host-editor-toolbar button.danger,
.host-project-settings-actions button.danger {
    color: #dc4651;
    background: #fff0f1;
}

.host-project-settings {
    margin-top: 14px;
    padding: 0 !important;
    overflow: hidden !important;
}

.host-project-settings summary {
    min-height: 62px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-2);
    cursor: pointer;
    list-style: none;
}

.host-project-settings summary::-webkit-details-marker {
    display: none;
}

.host-project-settings summary > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.host-project-settings summary svg {
    width: 15px;
    height: 15px;
}

.host-project-settings[open] summary > svg {
    transform: rotate(180deg);
}

.host-project-settings-grid {
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    border-top: 1px solid var(--border);
}

.host-project-settings-grid label > span {
    margin-bottom: 7px;
    display: block;
    color: var(--text-3);
    font-size: .52rem;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.host-project-settings-grid label > input,
.host-project-settings-grid select {
    width: 100%;
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: 0;
    color: var(--text);
    background: var(--surface-2);
    font: 650 .65rem "Space Grotesk", sans-serif;
}

.host-domain-input.compact {
    min-height: 43px;
    border-radius: 12px;
}

.host-domain-input.compact input {
    font-size: .65rem;
}

.host-project-settings-actions {
    padding: 0 18px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

body.dark-mode .host-project-intro-icon,
body.dark-mode .host-project-file > span,
body.dark-mode .host-editor-placeholder > span {
    background: rgba(118, 87, 201, .16);
}

body.dark-mode .host-editor-toolbar button.danger,
body.dark-mode .host-project-settings-actions button.danger {
    background: rgba(220, 70, 81, .13);
}

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

@media (max-width: 900px) {
    .host-project-onboarding,
    .host-project-main {
        grid-template-columns: 1fr;
    }

    .host-project-intro {
        min-height: 260px;
    }

    .host-project-file-list,
    .host-project-file-empty {
        min-height: 190px;
        max-height: 260px;
    }

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

@media (max-width: 560px) {
    #hostView .host-project-onboarding .host-surface,
    #hostView .host-project-console .host-surface {
        border-radius: 19px;
        box-shadow: none;
    }

    .host-project-onboarding {
        gap: 12px;
    }

    .host-project-intro {
        min-height: 230px;
        padding: 24px !important;
    }

    #hostView .host-project-intro h3 {
        font-size: 1.28rem !important;
    }

    .host-domain-input {
        padding: 0 11px;
    }

    .host-domain-input > span {
        font-size: .56rem;
    }

    .host-project-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .host-project-toolbar > .host-app-status {
        margin-left: auto;
    }

    .host-project-toolbar-actions {
        width: 100%;
    }

    .host-project-toolbar-actions button {
        flex: 1;
    }

    .host-project-main {
        margin-top: 12px;
        gap: 12px;
    }

    .host-pane-heading,
    .host-editor-toolbar {
        padding: 0 13px;
    }

    .host-pane-heading strong,
    .host-editor-toolbar strong {
        max-width: 180px;
    }

    .host-editor-toolbar button {
        width: 33px;
        padding: 0;
        font-size: 0;
    }

    .host-editor-code {
        height: 390px;
        grid-template-columns: 39px minmax(0, 1fr);
    }

    .host-editor-code pre {
        padding: 14px 7px;
        font-size: .62rem;
    }

    .host-editor-code textarea {
        padding: 14px 12px;
        font-size: .62rem;
    }

    .host-editor-footer {
        padding: 0 10px;
    }

    .host-editor-footer small {
        display: none;
    }

    .host-project-settings-actions {
        flex-direction: column-reverse;
    }

    .host-project-settings-actions button {
        width: 100%;
    }
}

/* ---------- Multi-project switcher + paid rename notes ---------- */
.host-project-switch {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.host-project-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 280px;
    padding: 9px 14px;
    border: 1px solid var(--border, #e4e4e7);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.host-project-chip:hover { transform: translateY(-1px); }

.host-project-chip.active {
    border-color: var(--accent, #f17d1f);
    box-shadow: 0 0 0 3px var(--accent-subtle, rgba(241, 125, 31, .14));
}

.host-project-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
    background: #b9b9c0;
}

.host-project-chip-dot.live { background: #22a06b; }
.host-project-chip-dot.deploying { background: #3974cb; animation: hostChipPulse 1.1s ease-in-out infinite; }
.host-project-chip-dot.failed { background: #e5484d; }
.host-project-chip-dot.waiting { background: #e6a23c; }

@keyframes hostChipPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.host-project-chip-name {
    font-weight: 700;
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.host-project-chip small {
    color: var(--text-3, #8e8e96);
    font-size: .68rem;
    white-space: nowrap;
}

.host-paid-note {
    margin: 4px 0 0;
    color: var(--accent, #f17d1f);
    font-size: .68rem;
    font-weight: 600;
}

button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .host-project-chip { max-width: 100%; }
}
