.dashboard-view[hidden],
.builder-view[hidden] {
    display: none !important;
}

.editor-preview-grid[hidden],
.output-panel[hidden] {
    display: none !important;
}

.edit-route,
.remove-route {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 4px;
    color: #9da9bb;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
}

.edit-route:hover {
    color: #fff;
    background: #294361;
}

.remove-route:hover {
    color: #fff;
    background: #693b50;
}

.studio-title-button {
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.studio-title-button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.builder-view {
    --builder-bg: #0c1020;
    --builder-panel: #11182a;
    --builder-panel-raised: #172035;
    --builder-line: #29344c;
    --builder-text: #e7ebf5;
    --builder-muted: #9da8be;
    --builder-purple: #8b4dff;
    display: flex;
    height: 100dvh;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: auto;
    overscroll-behavior: contain;
    color: var(--builder-text);
    background: var(--builder-bg);
    font-family: Inter, sans-serif;
}

body.builder-open {
    overflow: hidden;
}

.builder-header {
    flex: 0 0 auto;
}

.builder-view,
.builder-view * {
    box-sizing: border-box;
}

.builder-view button,
.builder-view input,
.builder-view select,
.builder-view textarea {
    font: inherit;
}

.builder-view button {
    color: inherit;
}

.builder-view button:focus-visible,
.builder-view input:focus-visible,
.builder-view select:focus-visible,
.builder-view textarea:focus-visible {
    outline: 2px solid #a87aff;
    outline-offset: 2px;
}

.builder-header {
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 20px;
    min-height: 76px;
    padding: 7px 15px 0;
    border-bottom: 1px solid var(--builder-line);
    background: linear-gradient(105deg, #12162b, #151631 70%, #25134d);
}

.builder-brand,
.builder-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.builder-brand strong {
    flex: 0 0 auto;
    color: #f5f4ff;
    font-size: 15px;
    letter-spacing: -.3px;
}

.builder-logo {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(145deg, #bd8cff, #702aff);
    cursor: pointer;
    font-size: 17px;
    font-weight: 800;
}

.builder-divider {
    width: 1px;
    height: 25px;
    margin: 0 3px;
    background: #39405b;
}

.project-picker select {
    max-width: 190px;
    padding: 7px 26px 7px 10px;
    border: 1px solid #414a66;
    border-radius: 7px;
    color: #f0efff;
    background: #20243e;
    font-size: 12px;
}

.project-control {
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #414a66;
    border-radius: 6px;
    color: #e7eafa;
    background: #20243e;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    white-space: nowrap;
}

.project-control:hover {
    border-color: #9c72ef;
    background: #302750;
}

.delete-project-control:hover {
    border-color: #a64e67;
    color: #ffd2dc;
    background: #432536;
}

.project-status {
    padding: 4px 10px;
    border-radius: 999px;
    color: #e7eafa;
    background: #394564;
    font-size: 10px;
}

.save-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c4cfdf;
    font-size: 11px;
    white-space: nowrap;
}

.save-state > span,
.running-status i,
.connected i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #53d68a;
    box-shadow: 0 0 9px rgba(83, 214, 138, .42);
}

.save-state.saving > span {
    background: #f3c45f;
}

.save-state.error > span {
    background: #ff6a82;
}

.workflow-steps {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1.5vw, 22px);
    min-height: 34px;
    overflow-x: auto;
    border-top: 1px solid rgba(255, 255, 255, .04);
    scrollbar-width: thin;
}

.workflow-steps i {
    color: #656f87;
    font-size: 12px;
    font-style: normal;
}

.workflow-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 0;
    border-radius: 7px;
    color: #bbc3d5;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    transition: color .18s ease, background .18s ease;
}

.workflow-step > span {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1px solid #66718a;
    border-radius: 50%;
    color: #d7dced;
    font-size: 10px;
}

.workflow-step:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.workflow-step.active {
    color: #fff;
    background: linear-gradient(100deg, #7d3af3, #a04fff);
    box-shadow: 0 4px 12px rgba(130, 62, 255, .25);
}

.workflow-step.active > span,
.workflow-step.complete > span {
    border-color: #fff;
    color: #7c39ef;
    background: #fff;
    font-weight: 700;
}

.builder-action {
    padding: 7px 11px;
    border: 1px solid #434c66;
    border-radius: 7px;
    background: #1b2235;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}

.builder-action.primary {
    border-color: #914eff;
    background: linear-gradient(100deg, #7737ef, #9c45ff);
    font-weight: 650;
}

.builder-action.run {
    border-color: rgba(68, 203, 127, .5);
    color: #b6f2cf;
    background: rgba(33, 125, 75, .24);
}

.builder-action.run:hover {
    background: rgba(33, 150, 84, .4);
}

.builder-action:hover {
    filter: brightness(1.13);
}

.builder-layout {
    display: grid;
    grid-template-columns: 62px var(--explorer-width, 232px) 8px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    flex: 1 1 0;
    overflow: hidden;
}

.builder-layout.explorer-collapsed {
    grid-template-columns: 62px minmax(0, 1fr);
}

.builder-layout.explorer-collapsed .explorer-panel {
    display: none;
}

.builder-layout.explorer-collapsed .explorer-splitter {
    display: none;
}

.workspace-splitter {
    position: relative;
    z-index: 2;
    min-width: 0;
    min-height: 0;
    touch-action: none;
    user-select: none;
}

.workspace-splitter:focus-visible,
.ai-resize-handle:focus-visible {
    outline: 2px solid #a87aff;
    outline-offset: -2px;
}

.explorer-splitter,
.editor-preview-splitter {
    display: grid;
    place-items: center;
    cursor: col-resize;
    background: #101725;
}

.explorer-splitter {
    grid-column: 3;
    grid-row: 1;
    border-right: 1px solid var(--builder-line);
    border-left: 1px solid var(--builder-line);
}

.explorer-splitter::before,
.editor-preview-splitter::before {
    width: 2px;
    height: 34px;
    border-radius: 2px;
    background: #58657e;
    content: "";
}

.explorer-splitter:hover,
.editor-preview-splitter:hover,
.output-splitter:hover {
    background: #202a40;
}

.editor-preview-splitter {
    grid-column: 2;
    grid-row: 1;
    width: 8px;
    border-right: 1px solid #29344c;
    border-left: 1px solid #29344c;
}

.output-splitter {
    display: grid;
    place-items: center;
    cursor: row-resize;
    background: #101725;
}

.output-splitter::before {
    width: 36px;
    height: 2px;
    border-radius: 2px;
    background: #58657e;
    content: "";
}

.workspace-splitter[hidden] {
    display: none !important;
}

.builder-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 9px 5px;
    border-right: 1px solid var(--builder-line);
    background: #11162a;
}

.rail-item {
    width: 52px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 8px;
    color: #bbc4d7;
    background: transparent;
    cursor: pointer;
    transition: color .18s ease, background .18s ease;
}

.rail-item > span {
    font-size: 19px;
    line-height: 1;
}

.rail-item small {
    font-size: 9px;
}

.rail-item:hover {
    color: #fff;
    background: #202944;
}

.rail-item.active {
    color: #fff;
    background: linear-gradient(145deg, #873cff, #6331dc);
    box-shadow: 0 5px 14px rgba(96, 45, 205, .28);
}

.explorer-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
    border-right: 1px solid var(--builder-line);
    background: #111827;
    scrollbar-color: #3a4760 transparent;
    scrollbar-width: thin;
}

.panel-heading {
    position: sticky;
    z-index: 2;
    top: 0;
    min-height: 39px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 11px;
    border-bottom: 1px solid var(--builder-line);
    background: #151d2f;
}

.panel-heading h2 {
    color: #dce3f2;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .55px;
    text-transform: uppercase;
}

.panel-tools {
    display: flex;
    gap: 5px;
}

.panel-tools button,
.section-heading button {
    width: 23px;
    height: 23px;
    border: 0;
    border-radius: 5px;
    color: #cbd4e4;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
}

.panel-tools button:hover,
.section-heading button:hover {
    color: #fff;
    background: #2a3550;
}

.project-tree {
    padding: 8px 7px 10px;
    color: #c7d0e0;
    font-size: 11px;
}

.tree-project,
.tree-folder,
.tree-file {
    height: 24px;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 0 5px;
    border-radius: 5px;
    white-space: nowrap;
}

.tree-project {
    color: #eef2fa;
}

.tree-project.is-active {
    background: #252040;
}

.tree-project,
.tree-folder {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.tree-project:hover,
.tree-folder:hover {
    background: #202a3f;
}

.tree-project > span:first-child,
.tree-folder > span:first-child {
    color: #93a2bc;
}

.folder-chevron {
    width: 10px;
    flex: 0 0 10px;
    text-align: center;
}

.tree-folder-content[hidden] {
    display: none;
}

.tree-project strong,
.tree-folder strong {
    overflow: hidden;
    font-weight: 550;
    text-overflow: ellipsis;
}

.tree-file-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-menu {
    margin-left: auto;
    color: #8e9bb2;
}

.tree-folder {
    padding-left: 17px;
}

.tree-folder-row {
    display: flex;
    align-items: center;
    min-width: 0;
}

.tree-folder-row .tree-folder {
    width: auto;
    flex: 1;
}

.tree-folder.is-active {
    color: #fff;
    background: #252040;
}

.tree-folder.nested {
    padding-left: 31px;
}

.folder-icon {
    color: #8fbdff;
    font-size: 14px;
}

.tree-file {
    width: 100%;
    min-width: 0;
    padding-left: 52px;
    border: 0;
    color: #c2ccdd;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.tree-file.nested-file {
    padding-left: 65px;
}

.tree-file.folder-file {
    padding-left: 78px;
}

.tree-file-row {
    display: flex;
    min-width: 0;
    align-items: center;
}

.tree-file-row[hidden] {
    display: none;
}

.tree-file-row .tree-file {
    width: auto;
    flex: 1;
}

.explorer-new-file-row {
    padding: 1px 3px 1px 48px;
}

.explorer-new-file-row.nested {
    padding-left: 62px;
}

.explorer-create-file-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 23px;
    padding: 2px 6px;
    border: 1px solid #8e63e9;
    border-radius: 4px;
    outline: none;
    color: #eef2fa;
    background: #171d2d;
    font: inherit;
}

.explorer-create-file-input:focus {
    box-shadow: 0 0 0 2px rgba(142, 99, 233, .2);
}

.copy-code-button {
    padding: 2px 6px;
    border: 1px solid #39465f;
    border-radius: 4px;
    color: #c8d3e6;
    background: #1b2537;
    font: inherit;
    cursor: pointer;
}

.copy-code-button:hover {
    color: #fff;
    background: #293650;
}

.copy-file,
.remove-file {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 0;
    border-radius: 4px;
    color: #a8b3c7;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    opacity: .8;
}

.copy-file {
    font-size: 13px;
}

.copy-file:hover {
    color: #fff;
    background: #294361;
    opacity: 1;
}

.remove-file:hover {
    color: #fff;
    background: #693b50;
    opacity: 1;
}

.copy-file:disabled,
.remove-file:disabled {
    cursor: not-allowed;
    opacity: .35;
}

.tree-file:hover {
    background: #202a3f;
}

.tree-file.selected {
    color: #fff;
    background: #673bc2;
}

.file-icon {
    width: 17px;
    flex: 0 0 17px;
    color: #93c5fd;
    font-size: 11px;
    font-weight: 700;
}

.file-icon.css {
    color: #88a6ff;
}

.file-icon.component {
    color: #71d5cc;
}

.file-icon.json {
    color: #f2c56d;
}

.file-icon.js {
    color: #edcf69;
    font-size: 9px;
}

.explorer-section {
    padding: 10px 10px 11px;
    border-top: 1px solid var(--builder-line);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.section-heading h3 {
    color: #e2e8f4;
    font-size: 11px;
    font-weight: 650;
}

.section-caption,
.language-select-label {
    display: block;
    margin: 2px 0 7px;
    color: #8e9ab0;
    font-size: 9px;
}

.navigation-items {
    display: grid;
    gap: 3px;
    margin: 5px 0 0;
    padding: 0;
    list-style: none;
}

.navigation-items li {
    min-height: 25px;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto auto 18px 18px;
    align-items: center;
    gap: 3px;
    padding: 3px 5px;
    border-radius: 5px;
    color: #c4cee0;
    font-size: 10px;
}

.navigation-items li:hover {
    background: #1b263b;
}

.navigation-items code {
    max-width: 45px;
    overflow: hidden;
    color: #8795ad;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navigation-header-status {
    color: #9c83ef;
    font-size: 8px;
    white-space: nowrap;
}

.route-symbol {
    color: #a68bff;
    text-align: center;
}

.build-sequence ol {
    display: grid;
    gap: 2px;
    margin: 7px 0 0;
    list-style: none;
}

.build-sequence li {
    min-height: 23px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 5px;
    border-radius: 5px;
    color: #9da9bd;
    font-size: 10px;
}

.build-sequence li > span {
    width: 16px;
    height: 16px;
    display: grid;
    flex: 0 0 16px;
    place-items: center;
    border: 1px solid #53617b;
    border-radius: 50%;
    font-size: 9px;
}

.build-sequence li.complete {
    color: #b7c9d0;
}

.build-sequence li.complete > span {
    border-color: #42bd83;
    color: #071c17;
    background: #42bd83;
}

.build-sequence li.current {
    color: #fff;
    background: #252040;
}

.build-sequence li.current > span {
    border-color: #a981ff;
    color: #fff;
    background: #7d43ef;
}

.sequence-count {
    color: #aab4c7;
    font-size: 9px;
}

.language-manager select,
.builder-dialog input,
.builder-dialog select,
.builder-dialog textarea {
    width: 100%;
    min-height: 30px;
    padding: 6px 8px;
    border: 1px solid #35415a;
    border-radius: 6px;
    color: #e5eaf4;
    background: #171f31;
    font-size: 10px;
}

.translation-fields {
    display: grid;
    gap: 5px;
    margin-top: 9px;
}

.translation-fields[hidden] {
    display: none !important;
}

.translation-fields label {
    color: #aeb8ca;
    font-size: 9px;
}

.translation-fields input,
.translation-fields textarea {
    width: 100%;
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid #35415a;
    border-radius: 6px;
    color: #e6ebf4;
    background: #171f31;
    font-size: 10px;
}

.translation-fields textarea {
    resize: vertical;
}

.website-sequence-list {
    display: grid;
    gap: 3px;
    margin: 10px 0 0;
    padding: 0;
    counter-reset: website-section;
    list-style: none;
}

.website-sequence-list li {
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 6px;
    border-radius: 5px;
    color: #c2ccdd;
    font-size: 10px;
    counter-increment: website-section;
}

.website-sequence-list li::before {
    content: counter(website-section);
    width: 16px;
    height: 16px;
    display: grid;
    flex: 0 0 16px;
    place-items: center;
    border: 1px solid #53617b;
    border-radius: 50%;
    color: #aab4c7;
    font-size: 9px;
}

.sequence-item-label {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sequence-item-select {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sequence-item-select:hover,
.website-sequence-list li.is-selected .sequence-item-select {
    color: #fff;
}

.website-section-label {
    display: block;
    margin: 3px 0 6px;
    color: #8e9ab0;
    font-size: 9px;
}

#websiteSectionSelect {
    width: 100%;
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid #35415a;
    border-radius: 6px;
    color: #e6ebf4;
    background: #171f31;
    font-size: 10px;
}

.sequence-item-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
    margin-left: auto;
}

.sequence-item-actions button {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    color: #9da9bd;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.sequence-item-actions button:hover {
    color: #fff;
    background: #293650;
}

.sequence-rename-input {
    min-width: 0;
    height: 22px;
    flex: 1;
    padding: 2px 5px;
    border: 1px solid #8e63e9;
    border-radius: 4px;
    color: #eef2fa;
    background: #171d2d;
    font: inherit;
}

.explorer-actions {
    padding: 0 10px 12px;
}

.explorer-actions button {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #554078;
    border-radius: 6px;
    color: #decfff;
    background: rgba(123, 67, 218, .12);
    cursor: pointer;
    font-size: 10px;
    text-align: left;
}

.explorer-actions button:hover {
    background: rgba(123, 67, 218, .24);
}

.builder-main {
    display: grid;
    grid-template-rows: auto minmax(180px, 1fr) 8px var(--output-height, 173px);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 7px 8px 0;
    background: #0b1020;
}

.builder-main.tool-active {
    grid-template-rows: auto minmax(0, 1fr);
}

.builder-main.tool-active .output-splitter {
    display: none;
}

.builder-context {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 3px 7px;
}

.builder-context > div {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
}

.builder-context strong {
    color: #f0f2fa;
    font-size: 12px;
    white-space: nowrap;
}

.builder-context > div span,
.builder-context > span {
    color: #9ba8bf;
    font-size: 10px;
}

.builder-context > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-preview-grid {
    display: grid;
    grid-template-columns:
        minmax(220px, var(--editor-pane, 50fr))
        8px
        minmax(220px, var(--preview-pane, 50fr));
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    min-width: 0;
    min-height: 0;
}

.tool-view[hidden] {
    display: none !important;
}

.tool-view {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 18px;
    border: 1px solid #29344c;
    border-radius: 8px 8px 0 0;
    background:
        radial-gradient(ellipse at 86% 4%, rgba(119, 72, 196, .14), transparent 38%),
        #111827;
}

.tool-view-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.tool-view-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid #54417e;
    border-radius: 11px;
    color: #d7bcff;
    background: #2a2142;
    font-size: 19px;
}

.tool-view-heading h2 {
    margin-bottom: 3px;
    color: #f0f2f8;
    font-size: 17px;
}

.tool-view-heading p {
    color: #9eabc0;
    font-size: 11px;
}

.tool-view-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 11px;
    max-width: 950px;
}

.tool-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid #303c54;
    border-radius: 9px;
    background: rgba(25, 35, 54, .82);
}

.tool-card h3 {
    margin-bottom: 6px;
    color: #e7ebf4;
    font-size: 12px;
}

.tool-card p {
    margin-bottom: 10px;
    color: #9eabc0;
    font-size: 10px;
    line-height: 1.55;
}

.tool-card a {
    color: #c5a6ff;
    font-size: 10px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tool-card .tool-warning {
    margin-top: 10px;
    color: #edcc7b;
}

.tool-card label {
    display: block;
    margin: 9px 0 5px;
    color: #b7c1d2;
    font-size: 10px;
}

.tool-card input,
.tool-card textarea,
.tool-card select {
    width: 100%;
    min-height: 32px;
    padding: 7px 8px;
    border: 1px solid #39465f;
    border-radius: 6px;
    color: #e4e9f2;
    background: #121b2c;
    font-size: 10px;
}

.tool-card textarea {
    resize: vertical;
}

.tool-card button {
    min-height: 29px;
    margin-top: 9px;
    padding: 6px 10px;
    border: 1px solid #7543c6;
    border-radius: 6px;
    color: #f0e9ff;
    background: #59329a;
    cursor: pointer;
    font-size: 10px;
}

.tool-card button:hover {
    background: #7040bd;
}

.tool-list {
    display: grid;
    gap: 6px;
    margin: 0;
    list-style: none;
}

.tool-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 9px;
    border: 1px solid #303c54;
    border-radius: 6px;
    color: #d1d8e6;
    background: #141d2e;
    font-size: 10px;
}

.tool-list small {
    color: #93a2b8;
}

.editor-panel,
.preview-panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #29344c;
    border-radius: 8px 8px 0 0;
    background: #111827;
}

.editor-tabs {
    min-height: 31px;
    display: flex;
    align-items: stretch;
    gap: 2px;
    overflow-x: auto;
    border-bottom: 1px solid #29344c;
    background: #141d2e;
}

.editor-tabs[hidden] {
    display: none;
}

.editor-tab,
.editor-overflow {
    flex: 0 0 auto;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid #29344c;
    color: #aeb9ca;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
}

.editor-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.editor-tab.active {
    border-bottom: 2px solid #9a5dff;
    color: #fff;
    background: #20283a;
}

.editor-tab span {
    color: #8d99ad;
}

.editor-tab > button {
    width: 17px;
    height: 19px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    color: #8d99ad;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.editor-tab > button:hover {
    color: #fff;
    background: #39445a;
}

.editor-overflow {
    margin-left: auto;
}

.editor-breadcrumb {
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border-bottom: 1px solid #202b40;
    color: #91a0b7;
    font-size: 9px;
}

.editor-breadcrumb strong {
    color: #dbe2ef;
    font-weight: 500;
}

.editor-breadcrumb #websiteCodeLanguage {
    min-height: 21px;
    margin-left: auto;
    padding: 1px 5px;
    border: 1px solid #394663;
    border-radius: 4px;
    color: #e2e8f4;
    background: #182237;
    font-size: 9px;
}

.editor-breadcrumb #websiteCodeLanguage[hidden] {
    display: none;
}

.code-editor-wrap {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    flex: 1;
    overflow: hidden;
    background:
        linear-gradient(90deg, #111827 0, #111827 35px, #0f1725 35px, #0f1725 100%);
}

.line-numbers,
.code-editor-wrap textarea {
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 10px 0;
    border: 0;
    color: #74839b;
    background: transparent;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.65;
    tab-size: 2;
    white-space: pre;
}

.line-numbers {
    overflow: hidden;
    padding-right: 8px;
    text-align: right;
    user-select: none;
}

.code-editor-wrap textarea {
    width: 100%;
    min-width: 0;
    resize: none;
    overflow: auto;
    padding-left: 9px;
    outline: 0;
    color: #d7e1f1;
    caret-color: #c394ff;
    scrollbar-color: #34425d transparent;
}

.code-surface {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.code-highlight {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 10px 0 10px 9px;
    overflow: visible;
    color: #d7e1f1;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.65;
    tab-size: 2;
    white-space: pre;
    pointer-events: none;
    will-change: transform;
}

.code-editor-wrap .code-surface textarea {
    position: absolute;
    inset: 0;
    height: 100%;
    padding-left: 9px;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background: transparent;
    white-space: pre;
}

.code-editor-wrap .code-surface textarea::selection {
    color: transparent;
    background: rgba(91, 112, 153, .52);
}

.syntax-tag { color: #569cd6; }
.syntax-attribute { color: #9cdcfe; }
.syntax-string { color: #ce9178; }
.syntax-comment { color: #6a9955; }
.syntax-keyword { color: #c586c0; }
.syntax-function { color: #dcdcaa; }
.syntax-number { color: #b5cea8; }
.syntax-property { color: #9cdcfe; }
.syntax-punctuation { color: #d4d4d4; }

.code-editor-wrap textarea:focus-visible {
    outline: 0;
}

.editor-footer {
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 9px;
    border-top: 1px solid #29344c;
    color: #99a5ba;
    background: #151e2f;
    font-size: 9px;
}

.editor-footer span:last-child {
    margin-left: auto;
}

.preview-heading {
    min-height: 31px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0 8px;
    border-bottom: 1px solid #29344c;
    background: #151e2f;
}

.preview-heading > div:first-child {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.preview-eye {
    color: #b6c0d0;
    font-size: 14px;
}

.preview-heading strong {
    color: #f1f3f9;
    font-size: 10px;
    white-space: nowrap;
}

.running-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(83, 214, 138, .25);
    border-radius: 999px;
    color: #a9eec7;
    background: rgba(39, 130, 81, .2);
    font-size: 9px;
    white-space: nowrap;
}

.running-status.requires-dev-server,
.running-status.is-starting {
    border-color: rgba(251, 191, 36, .3);
    color: #fcd34d;
    background: rgba(180, 83, 9, .18);
}

.running-status.is-error {
    border-color: rgba(239, 98, 108, .35);
    color: #ef7f86;
    background: rgba(127, 29, 29, .2);
}

.running-status.is-error i {
    background: #ef626c;
}

.running-status i {
    width: 6px;
    height: 6px;
}

.running-status.requires-dev-server i,
.running-status.is-starting i {
    background: #fbbf24;
}

.device-tools {
    display: flex;
    align-items: center;
    gap: 3px;
}

.device-tools button {
    min-width: 25px;
    height: 23px;
    border: 0;
    border-radius: 4px;
    color: #b7c2d5;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
}

.device-tools button:hover,
.device-tools button.active {
    color: #fff;
    background: #51358e;
}

.device-tools button[aria-pressed="true"] {
    color: #fff;
    background: #51358e;
}

.device-tools button:last-child {
    margin-left: 4px;
    border-left: 1px solid #39455c;
    border-radius: 0;
    font-size: 18px;
}

.preview-address {
    min-height: 25px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 3px 8px;
    color: #b1bdd0;
    background: #121b2c;
    font-size: 11px;
}

.preview-address > div {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    padding: 4px 8px;
    border: 1px solid #35415a;
    border-radius: 5px;
    color: #d7dfec;
    background: #0e1625;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-address button {
    border: 0;
    color: #bbc5d5;
    background: transparent;
    cursor: pointer;
}

.canvas-shell {
    display: flex;
    min-height: 0;
    flex: 1;
    justify-content: center;
    overflow: auto;
    padding: 8px;
    background: #d9deea;
    scrollbar-color: #8792a4 transparent;
}

.canvas-shell iframe {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    flex: 1;
    border: 0;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(12, 19, 34, .18);
    transition: width .22s ease, flex .22s ease;
}

.canvas-shell.device-tablet iframe {
    width: 768px;
    max-width: 100%;
    flex: 0 0 768px;
}

.canvas-shell.device-mobile iframe {
    width: 390px;
    max-width: 100%;
    flex: 0 0 390px;
}

.preview-status {
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border-top: 1px solid #29344c;
    color: #9ca9be;
    background: #151e2f;
    font-size: 9px;
}

.preview-status button {
    margin-left: auto;
    padding: 3px 7px;
    border: 1px solid #46536b;
    border-radius: 5px;
    color: #d7dfec;
    background: #202a3d;
    cursor: pointer;
    font-size: 9px;
}

.preview-status button[hidden] {
    display: none;
}

.preview-status #installProjectDependencies {
    margin-left: 4px;
    border-color: #6941c6;
    color: #f3eaff;
    background: #5b2bbd;
}

.output-panel {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    margin-top: 0;
    border: 1px solid #29344c;
    border-radius: 8px 8px 0 0;
    background: #101725;
}

.output-panel.is-minimized {
    grid-template-rows: minmax(0, 1fr);
}

.output-panel.is-minimized .output-content,
.output-panel.is-minimized .builder-statusbar,
.output-panel.is-minimized .suggestion-card {
    display: none !important;
}

.output-tabs {
    min-width: 0;
    min-height: 30px;
    display: flex;
    align-items: stretch;
    gap: 3px;
    overflow-x: auto;
    padding: 0 8px;
    border-bottom: 1px solid #29344c;
    background: #151e2f;
    scrollbar-width: thin;
}

.output-tabs > button {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 7px;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #abb6c9;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    white-space: nowrap;
}

.output-tabs > button.active {
    border-bottom-color: #a06cff;
    color: #fff;
}

.problem-count {
    min-width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #d95368;
    font-size: 9px;
}

.output-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
    margin-left: auto;
}

.output-actions button {
    align-self: center;
    height: 22px;
    padding: 0 8px;
    border: 1px solid #414c65;
    border-radius: 5px;
    color: #c7d0df;
    background: #1b2538;
    cursor: pointer;
    font-size: 9px;
    white-space: nowrap;
}

.output-actions button:last-child {
    border-color: #7440dc;
    color: #fff;
    background: #6d39ca;
}

.output-size-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
}

.output-size-controls button {
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid #414c65;
    border-radius: 5px;
    color: #c7d0df;
    background: #1b2538;
    cursor: pointer;
    font-size: 10px;
    white-space: nowrap;
}

.output-size-controls button:hover {
    border-color: #8d68d1;
    color: #fff;
    background: #282443;
}

.output-size-controls #resetWorkspaceLayout {
    padding: 0 8px;
}

.output-content {
    min-height: 0;
    overflow: auto;
    padding: 9px 11px;
    color: #c5d0e0;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.6;
}

.output-content p {
    margin: 0 0 2px;
    font-family: inherit;
}

.output-content.is-runner {
    display: grid;
    grid-template-rows: minmax(150px, 1fr) auto;
    gap: 7px;
    overflow: hidden;
}

.integrated-terminal {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 5px;
    overflow: hidden;
}

.integrated-terminal-toolbar,
.terminal-tabs {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

.integrated-terminal-toolbar {
    color: #dce5f3;
    font: 10px Inter, sans-serif;
}

.integrated-terminal-toolbar #terminalSessionStatus {
    overflow: hidden;
    margin-left: auto;
    color: #9daac0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integrated-terminal-toolbar button,
.terminal-tab {
    border: 1px solid #414c65;
    border-radius: 5px;
    color: #e4e9f2;
    background: #1b2538;
    font: 10px Inter, sans-serif;
}

.integrated-terminal-toolbar button {
    padding: 4px 8px;
    cursor: pointer;
}

.integrated-terminal-toolbar button:disabled { opacity: .5; cursor: default; }

.terminal-tabs { overflow-x: auto; }

.terminal-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    cursor: pointer;
}

.terminal-tab.active { border-color: #7650bb; background: #30234e; }
.terminal-tab-state { color: #9daac0; }
.terminal-tab-close { color: #d6aab0; font-size: 13px; }

.integrated-terminal-output {
    min-width: 0;
    min-height: 60px;
    overflow: auto;
    margin: 0;
    padding: 9px;
    border: 1px solid #29344c;
    border-radius: 5px;
    color: #c5d0e0;
    background: #0c121d;
    font: 10px/1.5 Consolas, 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.integrated-terminal-output[data-status="error"] { border-color: #874656; }
.integrated-terminal-output .xterm { height: 100%; }
.integrated-terminal-output .xterm-viewport { scrollbar-width: thin; }

.approved-task-panel {
    min-height: 28px;
    overflow: auto;
    border-top: 1px solid #29344c;
    padding-top: 4px;
}

.approved-task-panel summary {
    color: #aebbd0;
    cursor: pointer;
    font: 10px Inter, sans-serif;
}

.approved-task-panel[open] { display: grid; gap: 5px; }

.runner-toolbar {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.runner-toolbar label,
.runner-toolbar span {
    color: #aebbd0;
    font: 10px Inter, sans-serif;
}

.runner-toolbar select,
.runner-toolbar button {
    min-height: 26px;
    border: 1px solid #414c65;
    border-radius: 5px;
    color: #e4e9f2;
    background: #1b2538;
    font: 10px Inter, sans-serif;
}

.runner-toolbar select {
    max-width: min(270px, 100%);
    padding: 3px 6px;
}

.runner-toolbar button {
    padding: 3px 9px;
    cursor: pointer;
}

.runner-toolbar button:disabled {
    cursor: default;
    opacity: .5;
}

.runner-toolbar #runnerStartButton {
    border-color: #7650bb;
    background: #6034a4;
}

.runner-toolbar span {
    margin-left: auto;
}

.workspace-command-form {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid #35415a;
    border-radius: 5px;
    background: #0c121d;
}

.workspace-command-prompt {
    max-width: 38%;
    overflow: hidden;
    color: #9dc7a8;
    font: 10px Consolas, 'Courier New', monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-command-form input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 2px;
    border: 0;
    outline: 0;
    color: #e7edf8;
    background: transparent;
    font: 10px Consolas, 'Courier New', monospace;
}

.workspace-command-form input::placeholder {
    color: #77859d;
}

.workspace-command-form button {
    min-height: 25px;
    padding: 3px 9px;
    border: 1px solid #7650bb;
    border-radius: 5px;
    color: #fff;
    background: #6034a4;
    cursor: pointer;
    font: 10px Inter, sans-serif;
}

.workspace-command-form button:disabled {
    cursor: default;
    opacity: .5;
}

.runner-safety-note {
    color: #8290a8;
    font: 9px/1.35 Inter, sans-serif !important;
}

.runner-log {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    margin: 0;
    padding: 8px;
    border: 1px solid #29344c;
    border-radius: 5px;
    color: #c5d0e0;
    background: #0c121d;
    font: 10px/1.5 Consolas, 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.runner-log[data-status="passed"] {
    border-color: #326c4c;
}

.runner-log[data-status="failed"] {
    border-color: #874656;
}

.runner-build-log {
    min-height: 60px;
    max-height: 60vh;
    overflow: auto;
    margin: 6px 0 0;
    padding: 8px;
    border: 1px solid #29344c;
    border-radius: 5px;
    color: #c5d0e0;
    background: #0c121d;
    font: 10px/1.5 Consolas, 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.terminal-prompt {
    color: #bd8eff;
}

.terminal-muted {
    color: #8290a8;
}

.success-line {
    color: #75dfa1;
}

.warning-line {
    color: #f2c75e;
}

.output-content .issue-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 0;
    color: #e7c56e;
    font-family: Inter, sans-serif;
}

.output-content .activity-row {
    color: #aab5c7;
    font-family: Inter, sans-serif;
}

.suggestion-card {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 36px;
    width: min(320px, calc(100% - 24px));
    padding: 13px;
    border: 1px solid #985eff;
    border-radius: 9px;
    background: #191a35;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.suggestion-card > button:first-child {
    position: absolute;
    top: 5px;
    right: 7px;
    border: 0;
    color: #b9c1d0;
    background: transparent;
    cursor: pointer;
    font-size: 17px;
}

.suggestion-card strong {
    color: #decaff;
    font-size: 11px;
}

.suggestion-card p {
    margin: 7px 0 10px;
    color: #c0c6d5;
    font-size: 10px;
}

.suggestion-card > button:last-child {
    padding: 6px 9px;
    border: 1px solid #5b6681;
    border-radius: 5px;
    color: #eff2f8;
    background: #252d43;
    cursor: pointer;
    font-size: 9px;
}

.builder-statusbar {
    position: static;
    min-height: 21px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 9px;
    border-top: 1px solid #29344c;
    color: #9ca9be;
    background: #151e2f;
    font-size: 9px;
}

.builder-statusbar .connected {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    color: #b7d8c5;
}

.builder-statusbar .connected i {
    width: 6px;
    height: 6px;
}

#builderPreviewConnectionStatus[data-status="starting"],
#builderPreviewConnectionStatus[data-status="stopped"] {
    color: #d8b56f;
}

#builderPreviewConnectionStatus[data-status="error"] {
    color: #f08b9b;
}

.builder-toast {
    position: fixed;
    z-index: 10;
    right: 18px;
    bottom: 18px;
    max-width: min(380px, calc(100vw - 36px));
    padding: 10px 14px;
    transform: translateY(12px);
    border: 1px solid #42506d;
    border-radius: 8px;
    opacity: 0;
    color: #f2f4fa;
    background: #202a40;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .25);
    font-size: 11px;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.builder-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.builder-dialog {
    width: min(420px, calc(100vw - 28px));
    margin: auto;
    padding: 0;
    border: 1px solid #3d4962;
    border-radius: 13px;
    color: #e5eaf4;
    background: #151e30;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

.builder-dialog::backdrop {
    background: rgba(4, 8, 18, .72);
    backdrop-filter: blur(3px);
}

.builder-dialog form {
    display: grid;
    gap: 8px;
    padding: 20px;
}

.builder-dialog h2 {
    margin-bottom: 1px;
    color: #f5f5fc;
    font-size: 17px;
}

.builder-dialog p {
    margin-bottom: 5px;
    color: #aab5c8;
    font-size: 11px;
    line-height: 1.5;
}

.builder-dialog .vite-preview-warning {
    padding: 9px;
    border: 1px solid rgba(251, 191, 36, .28);
    border-radius: 7px;
    color: #fcd34d;
    background: rgba(180, 83, 9, .12);
}

.builder-dialog .vite-preview-error:not([hidden]) {
    color: #ff9da7;
}

.builder-dialog label {
    margin-top: 4px;
    color: #c6cfde;
    font-size: 10px;
}

.builder-dialog input,
.builder-dialog select,
.builder-dialog textarea {
    min-height: 36px;
    font-size: 12px;
}

.builder-dialog textarea {
    resize: vertical;
}

.visual-design-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.visual-design-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.visual-design-grid input[type="color"] {
    width: 100%;
    min-height: 36px;
    padding: 3px;
}

.visual-design-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.visual-design-toggle input {
    min-height: auto;
}

.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 9px;
}

.dialog-actions button {
    padding: 8px 12px;
    border: 1px solid #414d66;
    border-radius: 6px;
    background: #202a3d;
    cursor: pointer;
    font-size: 11px;
}

.dialog-actions .dialog-submit {
    border-color: #8445f1;
    background: #7136d4;
    font-weight: 650;
}

.dialog-actions .dialog-apply-header {
    border-color: #8445f1;
    color: #f5f0ff;
    background: linear-gradient(135deg, #7d3de0, #5c36c8);
    font-weight: 650;
}

.dialog-actions .dialog-apply-top {
    border-color: #376b95;
    color: #edf7ff;
    background: linear-gradient(135deg, #246a9d, #2856a4);
    font-weight: 650;
}

@media (max-width: 1120px) {
    .builder-header {
        gap: 0 10px;
        padding-right: 9px;
        padding-left: 9px;
    }

    .builder-layout {
        grid-template-columns: 55px var(--explorer-width, 205px) 8px minmax(0, 1fr);
    }

    .builder-brand {
        gap: 7px;
    }

    .builder-brand strong {
        font-size: 13px;
    }

    .open-browser-action {
        display: none;
    }

    .workflow-steps {
        justify-content: flex-start;
        gap: 8px;
    }

    .workflow-step {
        gap: 4px;
        padding-right: 5px;
        padding-left: 5px;
        font-size: 10px;
    }

}

@media (max-width: 820px) {
    .builder-view {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    body.builder-open {
        overflow: auto;
    }

    .builder-header {
        position: sticky;
        top: 0;
        min-height: 78px;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .builder-brand {
        overflow-x: auto;
    }

    .builder-header-actions .secondary {
        display: none;
    }

    .workflow-steps {
        min-height: 34px;
    }

    .builder-layout {
        position: relative;
        grid-template-columns: 52px minmax(0, 1fr);
        grid-template-rows: auto;
        min-height: 0;
        flex: 1 0 auto;
        overflow: visible;
    }

    .explorer-splitter {
        display: none;
    }

    .explorer-panel {
        display: none;
    }

    .builder-layout.explorer-open .explorer-panel {
        position: absolute;
        z-index: 4;
        top: 0;
        bottom: 0;
        left: 52px;
        width: min(250px, calc(100vw - 105px));
        display: block;
        max-height: 100%;
        border: 1px solid #39465f;
        box-shadow: 12px 0 28px rgba(0, 0, 0, .35);
    }

    .builder-main {
        min-height: 0;
        overflow: visible;
        grid-template-rows: auto minmax(650px, 1fr) 8px var(--output-height, 173px);
    }

    .editor-preview-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows:
            minmax(260px, var(--editor-pane, 50fr))
            8px
            minmax(320px, var(--preview-pane, 50fr));
        min-height: 650px;
    }

    .editor-preview-splitter {
        grid-column: 1;
        grid-row: 2;
        width: auto;
        height: 8px;
        cursor: row-resize;
        border: 0;
        border-top: 1px solid #29344c;
        border-bottom: 1px solid #29344c;
    }

    .editor-preview-splitter::before {
        width: 36px;
        height: 2px;
    }

    .output-size-controls {
        margin-left: 4px;
    }

    .output-size-controls #resetWorkspaceLayout {
        padding: 0 6px;
    }

    .editor-panel {
        min-height: 250px;
    }
}

@media (max-width: 560px) {
    .builder-header {
        grid-template-columns: minmax(0, 1fr) auto;
        padding-top: 5px;
    }
}

.ai-studio-panel {
    position: fixed;
    z-index: 8;
    top: 76px;
    right: 12px;
    display: flex;
    width: min(var(--ai-width, 440px), calc(100vw - 32px));
    height: min(var(--ai-height, calc(100dvh - 100px)), calc(100dvh - 100px));
    min-height: 0;
    flex-direction: column;
    border: 1px solid #35415a;
    border-radius: 10px;
    color: #e7ebf5;
    background: #101725;
    box-shadow: -16px 0 42px rgba(0, 0, 0, .35);
    transition: width .16s ease, height .16s ease, border-radius .16s ease;
}

.ai-studio-panel[aria-hidden="true"],
.ai-studio-panel [hidden] {
    display: none;
}

.ai-studio-panel.is-collapsed {
    top: auto;
    bottom: 14px;
    height: 48px;
    border: 1px solid #414c66;
    border-radius: 9px 0 0 9px;
}

.ai-studio-panel.is-maximized {
    inset: 12px;
    width: auto;
    height: auto;
    max-width: none;
    border-radius: 12px;
}

.ai-resize-handle {
    position: absolute;
    z-index: 2;
    display: block;
    touch-action: none;
    user-select: none;
}

.ai-width-resizer {
    top: 52px;
    bottom: 24px;
    left: -4px;
    width: 8px;
    cursor: col-resize;
}

.ai-height-resizer {
    right: 24px;
    bottom: -4px;
    left: 24px;
    height: 8px;
    cursor: row-resize;
}

.ai-width-resizer::before,
.ai-height-resizer::before {
    position: absolute;
    border-radius: 2px;
    background: #64718a;
    content: "";
    opacity: .7;
}

.ai-width-resizer::before {
    top: 50%;
    left: 3px;
    width: 2px;
    height: 34px;
    transform: translateY(-50%);
}

.ai-height-resizer::before {
    top: 3px;
    left: 50%;
    width: 36px;
    height: 2px;
    transform: translateX(-50%);
}

.ai-width-resizer:hover::before,
.ai-height-resizer:hover::before {
    background: #bd8cff;
    opacity: 1;
}

.ai-studio-panel.is-collapsed .ai-resize-handle,
.ai-studio-panel.is-maximized .ai-resize-handle {
    display: none;
}

    .ai-studio-header {
        display: flex;
        min-height: 53px;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px;
        border-bottom: 1px solid #2b354b;
        background: #171f30;
    }

    .ai-studio-header > div:first-child {
        display: grid;
        grid-template-columns: 24px auto;
        align-items: center;
        gap: 0 7px;
    }

    .ai-studio-mark {
        grid-row: span 2;
        color: #be9bff;
        font-size: 19px;
    }

    .ai-studio-header strong {
        color: #f3efff;
        font-size: 13px;
    }

    .ai-studio-header small {
        max-width: 260px;
        overflow: hidden;
        color: #9da9bd;
        font-size: 9px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ai-studio-header-actions {
        display: flex;
        gap: 5px;
    }

    .ai-studio-header-actions button,
    .ai-session-bar button {
        width: 27px;
        height: 27px;
        border: 1px solid #3b4660;
        border-radius: 6px;
        color: #cbd4e4;
        background: #202a3e;
        cursor: pointer;
    }

    .ai-studio-body {
        display: grid;
        min-height: 0;
        flex: 1;
        grid-template-rows: auto minmax(0, 1fr) auto;
        gap: 8px;
        overflow: hidden;
        padding: 0 12px 12px;
        scrollbar-color: #3a4760 transparent;
    }

    .ai-workbench-toolbar {
        display: grid;
        max-height: min(34vh, 260px);
        flex: 0 0 auto;
        gap: 7px;
        overflow: auto;
        padding-top: 10px;
        scrollbar-color: #3a4760 transparent;
    }

    .ai-response-scroll {
        display: flex;
        min-height: 0;
        flex-direction: column;
        gap: 10px;
        overflow: auto;
        overscroll-behavior: contain;
        padding: 9px;
        border: 1px solid #2e3a51;
        border-radius: 8px;
        background: #0d1420;
        scrollbar-color: #3a4760 transparent;
    }

    .ai-context-box summary,
    .ai-action-details summary {
        color: #e2e8f4;
        cursor: pointer;
        font-size: 10px;
        font-weight: 650;
    }

    .ai-action-details {
        padding: 8px 10px;
        border: 1px solid #2e3a51;
        border-radius: 8px;
        background: #151e2f;
    }

    .ai-workbench-toolbar .ai-context-box {
        padding: 8px 10px;
    }

    .ai-workbench-toolbar .ai-action-grid {
        margin-top: 8px;
    }

    .ai-studio-panel.is-collapsed .ai-studio-body {
        display: none;
    }

    .ai-auth-card,
    .ai-context-box,
    .ai-change-preview {
        padding: 10px;
        border: 1px solid #2e3a51;
        border-radius: 8px;
        background: #151e2f;
    }

    .ai-auth-card > strong,
    .ai-preview-heading strong {
        color: #eef0f8;
        font-size: 11px;
    }

    .ai-auth-card p,
    .ai-context-box small {
        margin: 4px 0 0;
        color: #97a5bc;
        font-size: 9px;
        line-height: 1.45;
    }

    .ai-auth-card label,
    .ai-context-box label {
        display: block;
        margin: 8px 0 4px;
        color: #bbc5d8;
        font-size: 9px;
    }

    .ai-auth-card input,
    .ai-auth-card select,
    .ai-context-box select,
    .ai-chat-form textarea {
        width: 100%;
        border: 1px solid #3a4760;
        border-radius: 6px;
        color: #ecf0f9;
        background: #0e1522;
    }

    .ai-auth-card input,
    .ai-auth-card select {
        min-height: 30px;
        padding: 5px 7px;
        font-size: 10px;
    }

    .ai-auth-card button,
    .ai-chat-form button,
    .ai-preview-actions button {
        min-height: 30px;
        padding: 6px 10px;
        border: 1px solid #7650bb;
        border-radius: 6px;
        color: #fff;
        background: #6034a4;
        cursor: pointer;
        font-size: 10px;
        font-weight: 600;
    }

    .ai-auth-card [hidden] {
        display: none;
    }

    .ai-auth-status {
        color: #f1c97b !important;
    }

    .ai-session-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #83e3ac;
        font-size: 9px;
    }

    .ai-session-bar span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .ai-session-bar i {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #53d68a;
    }

    .ai-session-bar button {
        width: auto;
        padding: 4px 8px;
        font-size: 9px;
    }

    .ai-context-box select {
        min-height: 78px;
        padding: 5px;
        font-size: 9px;
    }

    .ai-context-box option {
        padding: 3px;
    }

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

    .ai-action-grid button {
        min-height: 28px;
        padding: 5px 6px;
        border: 1px solid #39465f;
        border-radius: 6px;
        color: #cbd5e7;
        background: #182236;
        cursor: pointer;
        font-size: 9px;
        text-align: left;
    }

    .ai-action-grid button:hover {
        border-color: #7956bd;
        color: #fff;
        background: #282443;
    }

    .ai-chat-log {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 2px 1px;
    }

    .ai-message {
        max-width: 100%;
        padding: 10px 12px;
        border: 1px solid #2c394f;
        border-radius: 9px;
        background: #172235;
    }

    .ai-message.user {
        align-self: flex-end;
        border-color: #55417d;
        background: #241e3d;
    }

    .ai-message strong {
        color: #c7a8ff;
        font-size: 9px;
    }

    .ai-message p {
        margin: 4px 0 0;
        color: #d3d9e6;
        font-size: 12px;
        line-height: 1.65;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }

    .ai-chat-form {
        padding: 10px;
        border: 1px solid #35415a;
        border-radius: 10px;
        background: #151d2b;
        box-shadow: 0 -8px 22px rgba(0, 0, 0, .13);
    }

    .ai-chat-form textarea {
        min-height: 76px;
        max-height: 220px;
        padding: 10px;
        resize: vertical;
        font-size: 12px;
        line-height: 1.5;
    }

    .ai-chat-form > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        margin-top: 5px;
    }

    .ai-chat-form small {
        color: #8492a8;
        font-size: 8px;
    }

    .ai-chat-form button:disabled,
    .ai-auth-card button:disabled {
        opacity: .55;
        cursor: wait;
    }

    .ai-change-preview {
        min-height: 0;
        padding: 10px;
        overflow: visible;
        overscroll-behavior: contain;
    }

    .ai-plan-card {
        flex: 0 0 auto;
        padding: 12px;
        border: 1px solid #7650bb;
        border-radius: 9px;
        background: #17172a;
    }

.project-manager-list {
    max-height: 420px;
    overflow: auto;
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.project-manager-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #dde1ec;
    border-radius: 8px;
}

.project-manager-row strong,
.project-manager-row small {
    display: block;
}

.project-manager-actions {
    display: flex;
    gap: 6px;
}

    .ai-plan-card ol {
        margin: 9px 0;
        padding-left: 22px;
        color: #cbd4e4;
        font-size: 11px;
        line-height: 1.6;
    }

    .ai-plan-card li + li {
        margin-top: 5px;
    }

    .ai-plan-card button {
        min-height: 32px;
        padding: 6px 11px;
        border: 1px solid #7650bb;
        border-radius: 6px;
        color: #fff;
        background: #6034a4;
        cursor: pointer;
        font-size: 10px;
        font-weight: 650;
    }

    .ai-preview-heading,
    .ai-preview-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .ai-preview-heading span {
        color: #9faac0;
        font-size: 9px;
    }

    .ai-diff-file {
        margin-top: 8px;
    }

    .ai-diff-file > strong {
        display: block;
        overflow-wrap: anywhere;
        color: #ccd5e5;
        font-size: 9px;
    }

    .ai-diff-file pre {
        max-height: min(300px, 32vh);
        overflow: auto;
        margin: 4px 0 0;
        padding: 7px;
        border-radius: 5px;
        color: #cdd6e5;
        background: #0c121d;
        font: 9px/1.45 Consolas, monospace;
        white-space: pre;
    }

    .ai-diff-file .diff-add {
        color: #91e6ab;
    }

    .ai-diff-file .diff-remove {
        color: #ff9aab;
    }

    .ai-preview-actions {
        justify-content: flex-start;
        margin-top: 8px;
    }

    .ai-preview-actions button:last-child {
        border-color: #46516a;
        background: #252f43;
    }

@media (max-width: 560px) {
    .ai-studio-panel {
        z-index: 9;
        top: 78px;
        right: 10px;
        width: min(var(--ai-width, 440px), calc(100vw - 24px));
        height: min(var(--ai-height, calc(100dvh - 92px)), calc(100dvh - 92px));
    }

    .ai-studio-panel.is-collapsed {
        top: auto;
        bottom: 10px;
    }

    .ai-studio-panel.is-maximized {
        inset: 8px;
        width: auto;
        height: auto;
    }
}

@media (max-width: 560px) {
    .builder-brand strong,
    .builder-divider {
        display: none;
    }

    .project-picker select {
        max-width: 135px;
    }

    .project-status {
        display: none;
    }

    .save-state {
        font-size: 0;
    }
}

.builder-layout.ai-studio-docked {
    grid-template-columns: 62px var(--explorer-width, 232px) 8px minmax(0, 1fr) minmax(280px, var(--ai-width, 440px));
}

.builder-layout.explorer-collapsed.ai-studio-docked {
    grid-template-columns: 62px minmax(0, 1fr) minmax(280px, var(--ai-width, 440px));
}

.builder-layout.ai-studio-docked .ai-studio-panel {
    position: relative;
    z-index: 3;
    inset: auto;
    grid-column: -2 / -1;
    grid-row: 1;
    width: 100%;
    height: min(var(--ai-height, 100%), 100%);
    min-width: 0;
    max-width: none;
    align-self: stretch;
    border-radius: 8px;
    box-shadow: none;
}

.builder-layout.ai-studio-docked .ai-studio-panel.is-collapsed {
    bottom: auto;
    height: 48px;
    align-self: end;
}

.builder-layout.ai-studio-docked .ai-height-resizer {
    bottom: 2px;
}

.builder-layout.ai-studio-docked .ai-studio-panel.is-maximized {
    position: fixed;
    z-index: 20;
    inset: 12px;
    width: auto;
    height: auto;
    border-radius: 12px;
}

@media (max-width: 1120px) and (min-width: 821px) {
    .builder-layout.ai-studio-docked {
        grid-template-columns: 55px var(--explorer-width, 205px) 8px minmax(0, 1fr) minmax(280px, var(--ai-width, 440px));
    }

    .save-state > span {
        width: 9px;
        height: 9px;
    }

    .builder-header-actions {
        gap: 5px;
    }

    .builder-action {
        padding: 7px 8px;
        font-size: 10px;
    }

    .workflow-steps {
        gap: 5px;
    }

    .workflow-step {
        gap: 4px;
        font-size: 9px;
    }

    .workflow-step > span {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }

    .builder-layout {
        grid-template-columns: 47px minmax(0, 1fr);
    }

    .builder-rail {
        padding-right: 3px;
        padding-left: 3px;
    }

    .rail-item {
        width: 42px;
    }

    .builder-main {
        padding-right: 5px;
        padding-left: 5px;
    }

    .builder-context {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
        padding-bottom: 6px;
    }

    .output-tabs {
        overflow-x: auto;
        padding-right: 4px;
        padding-left: 4px;
    }

    .output-tabs > button {
        padding-right: 5px;
        padding-left: 5px;
        font-size: 9px;
    }

    .output-actions {
        display: none;
    }

    .builder-statusbar {
        gap: 7px;
        font-size: 8px;
    }
}
