/* C+Lab editorial workspace: native operations inside the shared paper layout. */
html[data-theme] .sw-workspace { --sw-accent:var(--cl-primary,#b44628); --sw-bg:var(--cl-surface,#fff); --sw-line:var(--cl-border,#e6e8ed); --sw-text:var(--cl-text,#20242d); --sw-muted:var(--cl-text-secondary,#6b7280); display:flex; flex-direction:column; min-width:0; color:var(--sw-text); height:calc(100dvh - 112px); min-height:540px; border:0; border-radius:0; overflow:hidden; background:var(--sw-bg); }
.sw-workspace [hidden] { display:none !important; }
.sw-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:73px; padding:3px 0 21px; border-bottom:1px solid var(--sw-line); flex-shrink:0; }
.sw-toolbar-title { display:flex; align-items:center; gap:12px; min-width:0; }
html[data-theme] .sw-toolbar h1 { margin:0; font-size:28px; line-height:1.2; font-weight:800; letter-spacing:-.02em; color:var(--sw-text); white-space:nowrap; }
.sw-toolbar-actions { display:flex; align-items:center; gap:6px; flex-shrink:0; }
html[data-theme] .sw-icon-button,html[data-theme] .sw-tool-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:34px; border:1px solid transparent; background:transparent; color:var(--sw-muted); font:inherit; font-size:12px; text-decoration:none; border-radius:var(--cl-radius-control); cursor:pointer; white-space:nowrap; }
html[data-theme] .sw-icon-button { padding:6px; width:34px; flex-shrink:0; }
html[data-theme] .sw-tool-button { padding:6px 9px; }
.sw-icon-button svg { transform:rotate(180deg); }
.sw-icon-button svg,.sw-tool-button svg { width:16px; height:16px; flex-shrink:0; }
html[data-theme] .sw-workspace :is(.sw-icon-button,.sw-tool-button):hover { background:var(--cl-surface-soft,#f7f8fa); border-color:var(--sw-line); color:var(--sw-text); }
.sw-connection { display:flex; align-items:center; gap:5px; color:var(--sw-muted); font-size:11px; white-space:nowrap; }
.sw-connection i { width:5px; height:5px; border-radius:50%; background:#a2a8b2; }
.sw-connection[data-state=ready] i { background:var(--sw-accent); }
.sw-connection[data-state=error] i { background:var(--cl-danger,#c44f4f); }
.sw-section-nav { display:flex; align-items:center; gap:15px; padding:0; min-height:50px; border-bottom:1px solid var(--sw-line); flex-shrink:0; overflow-x:auto; scrollbar-width:none; }
.sw-section-nav::-webkit-scrollbar { display:none; }
html[data-theme] .sw-section-nav button { position:relative; display:inline-flex; align-items:center; min-height:50px; padding:0 3px; border:0; background:transparent; color:var(--sw-muted); font:inherit; font-size:14px; white-space:nowrap; cursor:pointer; }
html[data-theme] .sw-section-nav button:hover { color:var(--sw-text); }
html[data-theme] .sw-section-nav button[aria-current=page] { color:var(--sw-accent); font-weight:600; }
.sw-section-nav button[aria-current=page]::after { content:''; position:absolute; height:2px; bottom:0; left:3px; right:3px; border-radius:2px 2px 0 0; background:var(--sw-accent); }
.sw-frame-area { position:relative; flex:1; min-height:0; display:flex; flex-direction:column; background:var(--cl-surface-soft,#f7f8fa); }
html[data-theme] .sw-workspace .sw-frame { display:block; width:100%; flex:1; min-height:0; height:100%; border:0; border-radius:0; background:var(--sw-bg); }
.sw-load-state { min-height:340px; flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:32px 24px; text-align:center; background:var(--sw-bg); }
html[data-theme] .sw-load-state h2 { margin:5px 0 0; font-size:18px; line-height:1.5; font-weight:600; color:var(--sw-text); }
.sw-load-state p { max-width:520px; margin:0; font-size:13px; line-height:1.7; color:var(--sw-muted); overflow-wrap:anywhere; }
.sw-loading-mark { display:block; width:25px; height:25px; border:2px solid var(--sw-line); border-top-color:var(--sw-accent); border-radius:50%; animation:sw-spin 1s linear infinite; }
.sw-state-symbol { display:inline-flex; color:var(--sw-muted); }
.sw-state-symbol svg { width:28px; height:28px; }
html[data-theme] .sw-retry { margin-top:10px; padding:9px 15px; min-height:38px; border:1px solid var(--sw-line); border-radius:var(--cl-radius-control); font:inherit; font-size:13px; color:var(--sw-text); background:var(--sw-bg); cursor:pointer; }
html[data-theme] .sw-retry:hover { border-color:var(--sw-accent); color:var(--sw-accent); }
.sw-workspace :is(button,a):focus-visible { outline:2px solid var(--sw-accent); outline-offset:-2px; }
@keyframes sw-spin { to { transform:rotate(360deg); } }
@media (max-width:1100px) { .sw-connection { display:none; } .sw-toolbar { gap:10px; padding:9px 12px; } }
@media (max-width:760px) {
 html[data-theme] .sw-workspace { height:calc(100dvh - 92px); min-height:480px; border-radius:10px; }
 .sw-toolbar { align-items:center; flex-wrap:wrap; gap:4px 10px; min-height:56px; padding:7px 9px; }
 .sw-toolbar-title { gap:6px; }
 html[data-theme] .sw-toolbar h1 { font-size:15px; }
 .sw-toolbar-actions { gap:2px; margin-left:auto; }
 html[data-theme] .sw-tool-button { min-height:34px; padding:7px; }
 .sw-tool-button span { display:none; }
 .sw-tool-button svg { width:17px; height:17px; }
 .sw-section-nav { padding:0 7px; gap:2px; min-height:43px; }
 html[data-theme] .sw-section-nav button { padding:0 10px; min-height:43px; font-size:12px; }
 .sw-section-nav button[aria-current=page]::after { left:10px; right:10px; }
 .sw-load-state { min-height:280px; padding:24px 18px; }
 .sw-load-state p { font-size:12px; }
}
@media (prefers-reduced-motion:reduce) { .sw-loading-mark { animation:none; } }
html[data-motion=reduce] .sw-loading-mark { animation:none; }
