/* Shared visual rhythm for the project studio and the existing user pages. */
:root{--studio-control-height:38px;--studio-control-radius:10px;--studio-panel-radius:14px;--studio-panel-padding:20px}
.studio-shell.user-shell{--paper:#f5f3ed;--white:#fffefa;--ink:#2c302d;--muted:#7c8076;--line:#e3e2d9;--soft:#eeeee6;--orange:#b9633e;--orange-dark:#9c4c2a;--peach:#f1d0b7;--shadow:0 2px 8px #32352a05;max-width:none;grid-template-columns:112px minmax(0,1fr);gap:20px;padding:16px;align-items:start}
.studio-shell.user-shell .rail{background:#2c302d;border:1px solid #2c302d;border-radius:26px;min-height:0;box-shadow:var(--shadow);top:16px;height:calc(100dvh - 32px);padding:22px 10px 16px;gap:18px;color:#eeeee4}
.studio-shell.user-shell .brand-name{color:#eeeee4;font-size:12px;letter-spacing:2px}
.studio-shell.user-shell .brand-orbit{color:var(--peach)}
.studio-shell.user-shell .nav-button{background:transparent;color:#b3b9ad;border-radius:11px;min-width:0;transition:background .15s,color .15s}
.studio-shell.user-shell .nav-button:hover{background:#ffffff08;color:#f5f3ed}
.studio-shell.user-shell .nav-button.active{background:#f1d0b712;color:#f1d0b7}
.studio-shell.user-shell .nav-icon{border:0;background:transparent;box-shadow:none}
.studio-shell.user-shell .rail-foot small{color:#a6aea2}
.studio-shell.user-shell .main{padding:0;min-width:0}
.studio-shell.user-shell .topbar{min-height:62px;border:1px solid var(--line);border-radius:14px;background:#fffefa;padding:12px 18px;margin:0 0 18px;gap:12px}
.studio-shell.user-shell .breadcrumb{color:var(--muted);min-width:0}
.studio-shell.user-shell .balance-button,.studio-shell.user-shell .env-tag,.studio-shell.user-shell .icon-btn{border-radius:10px}
.studio-shell.user-shell .content{min-width:0}
.studio-shell.user-shell .card,.studio-shell.user-shell .stat,.studio-shell.user-shell .project-card,.studio-shell.user-shell .manual-code-card{border-radius:14px;background:#fffefa;box-shadow:var(--shadow)}
.studio-shell.user-shell .project-card{border-color:var(--line)}
.studio-shell.user-shell .btn{border-radius:10px;min-height:38px}
.studio-shell.user-shell .btn.primary,.studio-shell.user-shell .btn.accent{background:#f1d0b7;border-color:#e3bfa4;color:#2c302d}
.studio-shell.user-shell input,.studio-shell.user-shell select,.studio-shell.user-shell textarea{border-radius:10px}
.studio-shell.user-shell .footer{margin-top:20px;font-size:10px;color:#8e9186}
.studio-shell.user-shell .page-head h1{font-size:26px;letter-spacing:-.4px}
.studio-shell.user-shell .video-workspace{--vw-bg:#f5f3ed;--vw-card:#fffefa;--vw-ink:#2c302d;--vw-muted:#7c8076;--vw-line:#e3e2d9;--vw-orange:#b9633e}
.studio-shell.user-shell .vw-editor,.studio-shell.user-shell .vw-settings,.studio-shell.user-shell .vw-history-toolbar,.studio-shell.user-shell .vw-task{border-radius:14px;background:#fff}
.studio-shell.user-shell .vw-materials-grid>.vw-material{background:#f5f3ed;border-radius:12px}
.studio-shell.user-shell .iw-controls,.studio-shell.user-shell .iw-results,.studio-shell.user-shell .iw-panel,.studio-shell.user-shell .library-workspace .lw-card{background:#fffefa;border-radius:14px}
@media(min-width:681px) and (max-height:740px){.studio-shell.user-shell .rail{gap:12px;padding-top:14px}.studio-shell.user-shell .rail nav{grid-auto-rows:51px;gap:4px}.studio-shell.user-shell .rail .nav-button{height:51px;min-height:51px}}
@media(max-width:1100px){.studio-shell.user-shell{grid-template-columns:92px minmax(0,1fr);gap:14px;padding:12px}.studio-shell.user-shell .rail{top:12px;height:calc(100dvh - 24px);padding-inline:6px}.studio-shell.user-shell .topbar{padding:10px 14px}}
@media(max-width:680px){.studio-shell.user-shell{display:block;padding:10px}.studio-shell.user-shell .rail{position:static;height:auto;border-radius:12px;padding:12px;margin-bottom:12px;gap:10px;overflow:visible}.studio-shell.user-shell .rail nav{grid-auto-columns:100px;gap:5px}.studio-shell.user-shell .rail .nav-button{height:38px;min-height:38px;white-space:nowrap}.studio-shell.user-shell .brand-name{font-size:11px}.studio-shell.user-shell .rail-foot small{color:#a6aea2}.studio-shell.user-shell .topbar{margin-bottom:12px;min-height:56px;flex-wrap:wrap;padding:10px 12px}.studio-shell.user-shell .top-actions{gap:6px}.studio-shell.user-shell .env-tag{display:none}.studio-shell.user-shell .balance-button{padding:8px 10px}.studio-shell.user-shell .page-head h1{font-size:23px}.studio-shell.user-shell .footer{flex-wrap:wrap;gap:5px}}
@media(prefers-reduced-motion:reduce){.studio-shell *{scroll-behavior:auto;transition:none!important}}
/* Keep the mobile navigation in normal flow; its original absolute anchor
   cannot be retained after changing the desktop rail geometry. */
@media(max-width:680px){.studio-shell.user-shell .rail{position:relative;top:auto;display:flex;flex-wrap:wrap;align-items:center}.studio-shell.user-shell .rail>.brand{order:1}.studio-shell.user-shell .rail .rail-foot{order:2}.studio-shell.user-shell .rail nav{position:static;inset:auto;order:3;flex:0 0 100%;width:100%;display:grid;grid-auto-flow:column;grid-template-rows:38px;grid-auto-columns:100px;overflow-x:auto;padding:0 0 4px;margin:0}.studio-shell.user-shell .rail .nav-button{width:100%}}
#toast{position:fixed;inset:auto;top:max(16px,env(safe-area-inset-top,0px));right:max(16px,env(safe-area-inset-right,0px));bottom:auto;left:auto;margin:0;max-width:min(360px,calc(100vw - 32px));max-height:min(220px,35dvh);overflow:auto;border-radius:12px;box-shadow:0 8px 24px #0f172a18;z-index:2147483647}
#toast::backdrop{background:transparent;backdrop-filter:none;pointer-events:none}
#toast[popover]:not(:popover-open){display:none}
body:has(.studio-shell) #toast{border:1px solid #ffffff22;font-size:12px}

/* Shared warm controls and project entry, scoped to the user environment. */
.studio-shell.user-shell :is(input,select):not([type=checkbox]):not([type=radio]){min-height:38px}
.studio-shell.user-shell select{appearance:none;padding-right:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%237c8076' stroke-width='1.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center}
.studio-shell.user-shell .btn.primary:hover,.studio-shell.user-shell .btn.accent:hover{background:#e9c0a4;border-color:#d4ac90}
body:has(.studio-shell.user-shell) #modal{background:#fffefa;border-color:#e3e2d9;color:#2c302d}
.project-start-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0}
.project-start-grid>*{min-width:0}
.project-import-source{min-width:0}
.project-import-source textarea{width:100%;min-height:100px;height:140px;max-height:280px;resize:vertical;padding:12px;border:1px solid #e3e2d9;border-radius:10px;background:#fffefa;line-height:1.7}
.project-import-preview{max-height:260px;overflow:auto;padding:0 0 0 24px;margin:12px 0;overflow-wrap:anywhere}
.project-import-preview li{padding:8px 0;border-bottom:1px solid #e3e2d9}
.project-import-preview p{white-space:pre-wrap}
.project-import-summary{padding:10px 12px;border:1px solid #e3e2d9;border-radius:10px;background:#f5f3ed;margin:12px 0;color:#7c8076;font-size:12px}
.project-start-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:16px}
.project-start-actions button{height:38px;min-height:38px;display:inline-flex;align-items:center;justify-content:center}
@media(max-width:560px){.project-start-grid{grid-template-columns:1fr}.project-start-actions>*{flex:1;min-width:120px}.project-import-preview{max-height:220px}}

.studio-shell.user-shell .iw-button:not(.is-quiet),.studio-shell.user-shell .vw-button.is-accent{background:#f1d0b7;border-color:#e3bfa4;color:#2c302d}
.studio-shell.user-shell .iw-button:not(.is-quiet):hover:not(:disabled),.studio-shell.user-shell .vw-button.is-accent:hover:not(:disabled){background:#e9c0a4;border-color:#d4ac90}

body:has(.studio-shell.user-shell) #modal :is(input:not([type=checkbox]):not([type=radio]),select){height:38px;min-height:38px;padding-block:0}
body:has(.studio-shell.user-shell) #modal select{appearance:none;padding-right:34px;background-repeat:no-repeat;background-position:right 12px center;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%237c8076' stroke-width='1.5'/%3E%3C/svg%3E")}
body:has(.studio-shell.user-shell) #modal .btn{min-height:38px}

.studio-shell.user-shell .nav-button.active .nav-icon{background:#f1d0b718;box-shadow:inset 0 0 0 1px #f1d0b72b}
