/* Project workspace: persistent conversation, working tools and a real file library. */
.project-stage-layout { display: flex; min-width: 0; min-height: 0; position: relative; }
.project-stage-layout > .stage-panel { flex: 1; min-width: 0; }
.project-sidebar { width: 286px; flex: none; display: flex; flex-direction: column; min-height: 0; background: #fbfcf8; border-left: 1px solid #d8e1ce; color: #354d2b; }
.project-sidebar[hidden], .sidebar-backdrop[hidden] { display: none; }
.project-sidebar > header { height: 59px; flex: none; display: flex; align-items: center; padding: 0 9px 0 14px; gap: 8px; border-bottom: 1px solid #dce3d3; }
.sidebar-tabs { display: flex; align-self: stretch; gap: 14px; flex: 1; }
.sidebar-tabs button { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #65755c; border-bottom: 2px solid transparent; }
.sidebar-tabs button.active { color: #254d3b; border-bottom-color: #254d3b; font-weight: 600; }
.sidebar-tabs svg { width: 14px; height: 14px; }
.project-sidebar .icon-button { width: 30px; height: 30px; color: #607653; flex: none; border-radius: 7px; }
.project-sidebar .icon-button:hover { background: #e8efdf; }
.project-sidebar .icon-button svg { width: 16px; height: 16px; }
#projectSidebarContent { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }
.sidebar-search { display: flex; gap: 5px; padding: 14px 12px 10px; }
.sidebar-search label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #d4dfc9; border-radius: 8px; padding: 7px 9px; }
.sidebar-search label svg { width: 14px; height: 14px; color: #708361; flex: none; }
.sidebar-search input { width: 100%; min-width: 0; background: transparent; border: 0; font: 12px var(--font); color: #354d2b; outline: 0; }
.sidebar-search label:focus-within { outline: 2px solid #4d6d3c; outline-offset: 2px; }
.sidebar-search input::placeholder { color: #6f7b66; }
.files-caption { display: flex; align-items: center; justify-content: space-between; padding: 2px 16px 12px; font-size: 10px; color: #6a7b5e; }
.files-caption button { font-size: 10px; color: #426336; padding: 3px; text-decoration: underline; text-underline-offset: 3px; }
.project-file-tree.file-tree { flex: 1; min-height: 100px; overflow: auto; width: 100%; border: 0; padding: 0 9px 14px; background: transparent; }
.file-folder summary { display: flex; align-items: center; gap: 5px; min-height: 32px; cursor: pointer; list-style: none; font-size: 12px; border-radius: 6px; padding: 3px 6px; }
.file-folder summary::-webkit-details-marker { display: none; }
.file-folder summary > svg { width: 12px; height: 12px; transform: rotate(0); }
.file-folder[open] > summary > svg { transform: rotate(90deg); }
.file-folder summary:hover { background: #edf2e7; }
.file-folder > div { margin-left: 13px; padding-left: 5px; border-left: 1px solid #dce5d2; }
.folder-glyph { color: #84976f; font-size: 19px; line-height: 1; }
.project-file-tree .project-file { gap: 8px; padding: 6px 8px; min-height: 32px; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; color: #536746; }
.project-file > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-file-tree .project-file.active { background: #e2ecd8; color: #254d3b; box-shadow: inset 2px 0 #527742; }
.file-kind { width: 26px; flex: none; font: 8px/18px var(--font); text-align: center; font-weight: 700; border-radius: 4px; background: #e9ede3; color: #54624b; }
.file-kind.kind-js { background: #f2edcf; color: #776017; }.file-kind.kind-css { background: #e0e9fa; color: #375a94; }.file-kind.kind-html { background: #f6e2d9; color: #97532e; }.file-kind.kind-py { background: #dfeef3; color: #346d82; }.file-kind.kind-json { background: #ebe3f3; color: #785093; }
.sidebar-file-note { border-top: 1px solid #dce4d3; padding: 14px 16px; color: #6d7c62; font-size: 10px; flex: none; }
.sidebar-file-note button { display: flex; gap: 7px; align-items: center; margin-top: 9px; font: 11px var(--font); color: #426336; }
.sidebar-file-note svg { width: 12px; height: 12px; transform: rotate(-90deg); }
.sidebar-empty { text-align: center; padding: 32px 12px; font-size: 12px; color: #617653; line-height: 1.6; }
.sidebar-empty > svg { display: block; width: 26px; height: 26px; margin: 0 auto 13px; color: #8ca47a; }
.sidebar-empty strong { display: block; font-weight: 500; color: #3b5d2d; }.sidebar-empty p { margin: 6px 0; }
.library-section { padding: 18px 15px; border-bottom: 1px solid #e0e7d8; }.library-section:last-child { border: 0; }
.library-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.library-heading h2 { font-size: 11px; font-weight: 600; margin: 0; }.library-heading > span { font-size: 9px; color: #6e7d63; }
.library-site { width: 100%; display: flex; align-items: center; text-align: left; gap: 10px; padding: 13px 10px; background: #edf2e6; border: 1px solid #d6e1ca; border-radius: 10px; }
.library-site > span:nth-child(2) { flex: 1; min-width: 0; }.library-site strong { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }.library-site small { display: block; font-size: 10px; margin-top: 4px; color: #667958; }
.library-site-icon { width: 32px; height: 32px; display: grid; place-items: center; background: #fff; border-radius: 7px; color: #517342; }.library-site-icon svg { width: 18px; height: 18px; }
.library-site > svg { width: 12px; height: 12px; }
.library-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; min-height: 35px; padding: 8px 4px; border-radius: 5px; font-size: 11px; color: #536a46; }
.library-row:hover { background: #edf2e7; }.library-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.library-row svg { width: 15px; height: 15px; flex: none; }.library-row svg:last-child { margin-left: auto; width: 12px; }
.library-published, .library-add { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #426735; padding: 10px 0 0; }.library-published svg, .library-add svg { width: 13px; height: 13px; }
.sidebar-note { font-size: 11px; line-height: 1.65; color: #687a5d; margin: 0; }
.sidebar-backdrop { display: none; }
.project-tools { flex: 1; overflow: auto; padding: 34px; background: #fafbf7; }.project-tools h2 { font-size: 26px; font-weight: 500; letter-spacing: -.8px; color: #34552a; margin: 10px 0; }.project-tools > p { color: #637754; font-size: 13px; line-height: 1.6; margin-bottom: 26px; }
.project-tools-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.project-tools-grid button { display: grid; grid-template-columns: 28px minmax(0,1fr) 15px; gap: 6px 9px; border: 1px solid #d8e2cd; border-radius: 10px; background: #fff; padding: 17px; text-align: left; color: #4f6a3f; }
.project-tools-grid button:hover { background: #f4f7ee; border-color: #9fb78e; }.project-tools-grid strong { color: #35572b; font-size: 12px; font-weight: 600; align-self: center; }.project-tools-grid span { font-size: 11px; line-height: 1.6; grid-column: 2; color: #65775a; }.project-tools-grid svg { width: 20px; height: 20px; }.project-tools-grid svg:last-child { grid-column: 3; grid-row: 1; width: 12px; height: 20px; transform: rotate(-90deg); }
.stack-languages { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }.stack-languages > span { display: flex; gap: 10px; border: 1px solid #d8e1cf; border-radius: 7px; padding: 9px; font-size: 12px; }.stack-languages b { color: #537643; }
.file-toolbar { gap: 7px; padding: 8px 12px; flex-wrap: wrap; }.file-toolbar > span { margin-right: auto; max-width: 55%; }.file-toolbar .icon-button { width: 28px; height: 28px; color: #5f7850; background: transparent; flex: none; }.file-toolbar .icon-button:hover { background: #e8efdf; }.file-toolbar .icon-button svg { width: 15px; height: 15px; }.file-toolbar .primary { margin-left: 0; }.file-toolbar .editor-language { border: 1px solid #d7e1cd; padding: 4px 5px; border-radius: 4px; }
.files-empty { display: grid; align-content: center; justify-items: start; height: 100%; color: #647955; padding: 36px; }.files-empty h2 { color: #35582a; font-weight: 500; font-size: 23px; margin: 0; }.files-empty p { font-size: 13px; line-height: 1.7; margin: 12px 0 20px; }
.agent-live { margin-top: 18px; }.agent-live .bubble-body { white-space: normal; }.agent-live .bubble-meta .spinner { width: 10px; height: 10px; }
.workspace[data-sidebar-open=true] .stage-toolbar { gap: 8px; padding-inline: 12px; flex-wrap: wrap; height: auto; min-height: 59px; }
.workspace[data-sidebar-open=true] .stage-tabs { min-height: 44px; gap: 12px; flex: 1; }
.workspace[data-sidebar-open=true] .device-picker { display: none; }
@media (min-width: 1600px) { .project-sidebar { width: 310px; }.project-sidebar > header { height: 65px; } }
@media (max-width: 1199px) {
 .project-sidebar { position: fixed; z-index: 41; top: 65px; right: 0; bottom: 0; width: min(320px,90vw); box-shadow: -12px 0 45px #23351b21; }
 .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 65px 0 0; background: #24341d26; z-index: 40; }
 .stage-toolbar { flex-wrap: wrap; height: auto; min-height: 59px; gap: 5px; }.stage-tabs { min-height: 44px; flex: 1; }
 .project-tools { padding: 24px; }.project-tools-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
 .project-stage-layout { position: static; }.project-stage-layout > .stage-panel { position: absolute; inset: 0 0 51px; }
 .project-sidebar { top: 60px; bottom: 51px; }.sidebar-backdrop:not([hidden]) { top: 60px; bottom: 51px; }
 .work-header .project-heading { min-width: 0; flex: 1; }.project-heading h1 { max-width: 100%; }.header-actions { flex: none; gap: 3px; }.work-header { gap: 5px; padding-inline: 8px; }
 .stage-tabs { gap: 10px; }.stage-tabs button { min-height: 44px; }.stage-toolbar { min-height: 50px; }.stage-toolbar .device-picker { display: none; }
 .project-sidebar .icon-button { width: 40px; height: 40px; }.sidebar-tabs button { min-height: 44px; }.project-file-tree .project-file, .file-folder summary, .library-row { min-height: 42px; }
 .sidebar-search input { font-size: 16px; }.file-toolbar .icon-button { width: 34px; height: 34px; }.file-toolbar .primary { min-height: 34px; }.file-toolbar .editor-language { display: none; }.file-toolbar > span { max-width: 100%; flex: 1 0 100%; }
 .project-tools { padding: 25px 20px; }.project-tools-grid { gap: 10px; }.files-empty { padding: 25px; }
}

.workspace:not([data-stage=preview]) .stage-toolbar :is(.device-picker,#selectElement,#reloadPreview,#openPreview) { display: none !important; }
@media (max-width: 640px) { .workspace .stage-toolbar .context-button { display: none !important; } }
