/* Project management shares the workspace palette and keeps chat actions reachable. */
#creative-history-drawer .creative-project-section { flex:none; min-height:0; padding-bottom:14px; }
.creative-project-section__head { display:flex; align-items:center; justify-content:space-between; color:var(--text-secondary); font-size:12px; font-weight:700; }
:is(#creative-history-drawer,#production-projects-drawer) .creative-project-create { margin:0; padding:0 10px; min-height:44px; color:var(--text-main); }
.creative-project-search { display:flex; align-items:center; gap:9px; height:42px; padding:0 12px; margin:3px 0 8px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-secondary); }
.creative-project-search input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:var(--text-main); font:inherit; font-size:12px; }
.creative-project-search:focus-within { outline:0; border-color:color-mix(in srgb,var(--text-secondary) 42%,var(--border-color)); box-shadow:0 0 0 1px rgba(255,255,255,.07); }
.creative-project-list { max-height:min(30dvh,270px); overflow-y:auto; padding:2px; scrollbar-gutter:stable; }
.project-group-label { margin:9px 9px 5px; color:var(--text-secondary); font-size:11px; font-weight:600; }
.project-row { display:grid; grid-template-columns:minmax(0,1fr) 44px; min-height:48px; margin-bottom:4px; border:1px solid transparent; border-radius:11px; }
.project-row.is-active { background:color-mix(in srgb,var(--project-color) 9%,var(--bg-input)); border-color:color-mix(in srgb,var(--project-color) 50%,var(--border-color)); }
.project-row button { min-height:44px; padding:8px; border:0; border-radius:10px; background:transparent; color:var(--text-secondary); }
.project-row [data-project-open] { display:flex; align-items:center; gap:10px; min-width:0; text-align:left; }
.project-row [data-project-open] > i { flex:none; width:18px; color:var(--project-color); text-align:center; }
.project-row [data-project-open] > span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:650; color:var(--text-main); }
.project-row [data-project-open] > small { flex:none; min-width:20px; font-size:11px; text-align:center; }
.project-row [data-project-menu]:hover,.project-row [data-project-menu][aria-expanded="true"] { background:var(--bg-input); }
.project-sidebar-empty { padding:14px 9px; margin:0; color:var(--text-secondary); font-size:12px; line-height:1.6; }
#creative-history-drawer .creative-chat-section-head { flex:none; align-items:center; margin:14px 0 10px; flex-wrap:nowrap; }
.creative-chat-section-head > div { min-width:0; display:grid; gap:4px; }
#creative-current-project-label { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#creative-chat-archive { display:flex; align-items:center; gap:6px; flex:none; padding:8px; min-height:44px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--text-secondary); font-size:12px; }
#creative-chat-archive[aria-pressed="true"] { border-color:var(--border-color); background:var(--bg-input); color:var(--primary); }
#creative-new-chat[hidden] { display:none !important; }
#creative-history-drawer .creative-chat-list { min-height:0; padding:2px; }
#creative-history-drawer .creative-chat-row > [data-chat-menu] { min-height:44px; align-self:stretch; }
#creative-history-drawer .creative-chat-row [data-chat-open]:disabled { opacity:.75; cursor:default; }
.project-action-menu { position:fixed; z-index:2600; isolation:isolate; width:min(264px,calc(100vw - 16px)); max-height:calc(100dvh - 16px); overflow-y:auto; padding:8px; border:1px solid color-mix(in srgb,var(--border-color) 88%,var(--text-secondary) 12%); border-radius:14px; background:color-mix(in srgb,var(--bg-main,#151515) 96%,transparent); color:var(--text-main); backdrop-filter:blur(22px) saturate(130%); -webkit-backdrop-filter:blur(22px) saturate(130%); box-shadow:0 16px 60px rgba(0,0,0,.55); }
.project-action-menu[hidden] { display:none !important; }
.project-action-menu > strong { display:block; padding:8px 10px 12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; border-bottom:1px solid var(--border-color); margin-bottom:5px; }
.project-action-menu > button { display:flex; align-items:center; gap:10px; width:100%; min-height:44px; padding:9px 10px; border:0; border-radius:8px; background:transparent; color:var(--text-main); text-align:left; font-size:13px; }
.project-action-menu > button i { width:18px; color:var(--text-secondary); }
.project-action-menu > button:hover { background:var(--bg-input); }
.project-action-menu > button.is-danger,.project-action-menu > button.is-danger i { color:#ff9299; }
.project-action-menu > button.is-danger { margin-top:6px; border-top:1px solid var(--border-color); border-radius:0 0 8px 8px; }
.project-color-label { padding:10px 10px 4px; color:var(--text-secondary); font-size:11px; }
.project-color-options { display:grid; grid-template-columns:repeat(4,1fr); gap:3px; padding:2px 4px 6px; }
.project-color-options button { position:relative; display:grid; place-items:center; height:44px; border:1px solid transparent; border-radius:9px; background:transparent; }
.project-color-options button span { width:22px; height:22px; border-radius:50%; background:var(--project-color); }
.project-color-options button i { position:absolute; color:#171717; font-size:12px; }
.project-color-options button:hover,.project-color-options button[aria-pressed="true"] { border-color:var(--border-color); background:var(--bg-input); }
.project-action-menu button:focus-visible,.project-editor :is(button,input,select):focus-visible { outline:2px solid var(--primary); outline-offset:1px; }
.project-editor { width:min(420px,calc(100vw - 28px)); max-height:calc(100dvh - 28px); padding:24px; border:1px solid var(--border-color); border-radius:18px; background:var(--bg-panel,#181818); color:var(--text-main); box-shadow:0 24px 80px rgba(0,0,0,.6); }
.project-editor::backdrop { background:rgba(0,0,0,.65); backdrop-filter:blur(4px); }
.project-editor h2 { margin:0 0 22px; font-size:19px; }
.project-editor label { display:block; margin-bottom:8px; color:var(--text-secondary); font-size:13px; }
.project-editor :is(input,select) { width:100%; min-height:46px; padding:10px 12px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-main); font:inherit; }
.project-editor form > div { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:22px; }
.project-editor button { min-height:44px; padding:10px 16px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-main); font-weight:700; }
.project-editor button[type="submit"] { border-color:var(--primary); background:var(--primary); color:var(--text-on-accent,#171717); }
@media(max-height:650px) { .creative-project-list { max-height:22dvh; } :is(#creative-history-drawer,#studio-references-panel) .creative-drawer__head { margin-bottom:8px; } }
@media(max-width:991px) {
    #creative-history-drawer { overflow:hidden; overscroll-behavior:contain; }
    #creative-history-drawer .creative-project-section { max-height:31dvh; overflow:hidden; }
    #creative-history-drawer .creative-project-list { max-height:19dvh; overscroll-behavior:contain; touch-action:pan-y; scrollbar-gutter:stable; }
    #creative-history-drawer .creative-chat-section-head { margin-top:10px; }
    #creative-history-drawer .creative-new-chat-button { flex:none; margin-bottom:8px; }
    #creative-history-drawer .creative-chat-list { flex:1 1 0; max-height:none; padding:2px 4px max(18px,env(safe-area-inset-bottom)) 2px; overflow-y:auto; overscroll-behavior:contain; touch-action:pan-y; scroll-padding-block:8px 24px; scrollbar-gutter:stable; -webkit-overflow-scrolling:touch; }
    #creative-history-drawer .creative-chat-row { min-height:56px; }
}
