/* V7.1 keeps the V7 palette and gives every layout an explicit width policy. */
[hidden]{display:none!important}
.app{--bar-height:54px;--header-height:73px;--handle-top:calc(var(--header-height) + var(--bar-height) + 7px)}
.app.top-collapsed{--header-height:30px}
.main-inner{width:100%;max-width:1560px;padding:30px clamp(18px,2.3vw,48px) 90px}
.app[data-width="standard"] .main-inner{max-width:1250px}
.app[data-width="wide"] .main-inner{max-width:2100px}
.app[data-width="ultrawide"] .main-inner{max-width:none}
.app[data-width="auto"] .main-inner{max-width:1800px}
@media(min-width:2600px){.app[data-width="auto"] .main-inner{max-width:none}}
.bar71{display:flex;align-items:center;gap:12px;justify-content:space-between;min-height:54px;padding:8px 15px;background:var(--surface);border-bottom:1px solid var(--border);position:relative;z-index:21}
.bar71 .text-button{font-size:11px;white-space:nowrap;padding:6px}
.bar71 .segmented{display:flex;flex-wrap:wrap;gap:2px}
.bar71 .segmented button{font-size:10px;padding:7px 9px}
.drawer-buttons71{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
.drawer-trigger71{border:1px solid color-mix(in srgb,var(--identity) 40%,var(--border));border-radius:8px;background:var(--surface2);color:var(--identity);font-size:10px;font-weight:800;letter-spacing:.08em;padding:8px 10px}
.drawer-trigger71[aria-expanded="true"]{background:color-mix(in srgb,var(--identity) 16%,var(--surface));box-shadow:0 0 12px color-mix(in srgb,var(--identity) 18%,transparent)}
.drawer-rack71{position:fixed;top:calc(var(--header-height) + var(--bar-height) + 5px);right:16px;z-index:40;display:flex;gap:10px;max-width:calc(100vw - 32px);max-height:calc(100vh - var(--header-height) - var(--bar-height) - 20px);overflow:auto;align-items:flex-start}
.top-drawer71{min-width:285px;width:340px;flex:0 0 auto;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:18px;box-shadow:0 20px 60px #0008;max-height:65vh;overflow:auto}
.top-drawer71 .host71{padding:15px}.top-drawer71 .dialog-head h3{margin:0}.top-drawer71 .dialog-head{margin-bottom:15px}
.shell{min-height:calc(100vh - var(--header-height) - var(--bar-height))}
.top-collapsed .shell{min-height:calc(100vh - var(--header-height) - var(--bar-height))}
.edge,.left-collapsed .edge-left,.right-collapsed .edge-right{top:var(--handle-top);padding:7px 9px;height:34px;z-index:22}
.panel-head{height:48px}.panel-head .icon-button{height:34px}
.top-actions{flex-wrap:nowrap;gap:6px}.top-center{white-space:nowrap;min-width:0}.top-center .eyebrow{font-size:8px}
.brand{min-width:210px}.top{gap:10px;padding:0 18px}.top .pill,.sfx-button{white-space:nowrap}
.cards,.project-grid,.component-grid,.catalog-grid71,.matrix-grid71,.monitor-grid71{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));gap:16px}
.catalog-grid71{grid-template-columns:repeat(auto-fill,minmax(min(310px,100%),1fr))}
.matrix-grid71{grid-template-columns:repeat(auto-fill,minmax(min(310px,100%),1fr))}
.matrix-grid71.compact{grid-template-columns:repeat(auto-fill,minmax(min(235px,100%),1fr))}
.matrix-grid71.compact .project-card{padding:16px;gap:7px}.matrix-grid71.compact .project-card p{display:none}.matrix-grid71.compact .project-actions71{gap:5px}.matrix-grid71.compact .secondary,.matrix-grid71.compact .primary{font-size:10px;padding:8px}
.project-card.selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.host71{border-top:3px solid var(--identity);display:flex;flex-direction:column;gap:9px}.host71 h3{color:var(--identity);letter-spacing:.1em}.host71 .metric{gap:15px}.host71 .metric strong{font-size:11px;text-align:right;overflow-wrap:anywhere}
.status71{align-self:flex-start;max-width:100%;white-space:normal}.status71.online,.status71.ready{color:#86d8b0;background:#19352b}.status71.unknown,.status71.unavailable,.status71.files_only{color:#e0bc76;background:#342c20}.status71.degraded,.status71.offline{color:#f49aa5;background:#3b2228}
.project-browser71{display:grid;grid-template-columns:minmax(160px,220px) minmax(0,1fr);gap:18px;align-items:start}
.project-browser71>.tree71{grid-column:1/-1}
.project-selection71{border:1px solid var(--border);border-radius:var(--radius);padding:16px;background:var(--surface);min-width:0;position:sticky;top:10px}.project-selection71 h3{font-size:12px;color:var(--muted)}
.project-selection71 .side-action{overflow-wrap:anywhere;font-size:12px}.project-selection71 .active{color:var(--accent);background:var(--surface2);border-radius:7px}
.project-detail71{display:grid;gap:18px;min-width:0}.project-detail71>.project-card{box-shadow:none}.project-detail71>.project-card:hover{transform:none}
.project-actions71{margin-top:12px;gap:8px}.project-actions71 button,.project-actions71 a{font-size:11px;padding:9px 11px;display:inline-block;text-decoration:none}
.repository-preview71{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);overflow:auto;max-width:100%;padding:8px}
.repository-preview71 iframe{display:block;width:100%;height:640px;border:0;background:#fff;max-width:none;margin:auto}
.tree71{display:grid;gap:4px;font-size:12px;min-width:0}.tree71 details{padding:5px 0 5px 9px;min-width:0}.tree71 summary{padding:7px;cursor:pointer;color:var(--accent);overflow-wrap:anywhere}.tree71 a{display:block;padding:5px 10px;overflow-wrap:anywhere;text-decoration:none}.tree71 a:hover{text-decoration:underline}.files71>summary{cursor:pointer;margin-bottom:12px;color:var(--accent)}
.control71{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:12px;flex-wrap:wrap}.control71 input[type="number"]{width:90px}.control71 select{min-width:120px}
.catalog-grid71>.card{display:flex;flex-direction:column;gap:12px;min-width:0}.catalog-grid71 h3,.catalog-grid71 p{margin:0}.catalog-grid71>.card>.primary{margin-top:auto}.catalog-grid71 details>summary{cursor:pointer;color:var(--accent);font-size:12px}.catalog-grid71 details>.card{margin-top:12px;padding:15px;background:var(--surface2)}
.panel-template71{display:flex;flex-direction:column;gap:12px;min-width:0}.panel-template71>.metric{flex-wrap:wrap;gap:8px}.panel-preview71{border:1px solid var(--border);width:100%;height:300px;background:#fff}.panel-template71 pre{max-height:260px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}.split71{display:grid;grid-template-columns:1fr 1fr;gap:12px}.activity71{padding-left:18px;font-size:12px;line-height:1.8;overflow-wrap:anywhere}.palette71{font-size:9px;padding:10px;min-height:60px;text-shadow:0 1px 3px #000;color:white;border:1px solid var(--border);border-radius:8px}.static-stat71{font-size:28px;color:var(--accent)}
.custom-canvas{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px;align-items:start}.custom-canvas>.custom-section{grid-column:span 12;margin:0}.custom-canvas>[data-section-layout="half"]{grid-column:span 6}.custom-canvas>[data-section-layout="third"]{grid-column:span 4}.custom-canvas[data-viewport="phone"]>*{grid-column:span 12}.custom-canvas[data-viewport="tablet"]>[data-section-layout="third"]{grid-column:span 6}
#publishedPages71{margin-top:40px}#publishedReader71{margin-top:30px;padding-top:25px;border-top:1px solid var(--border)}
.toolbar{align-items:center;gap:10px}.toolbar .field{min-width:0}.project-meta{flex-wrap:wrap}.frame-row{max-width:100%;min-width:0}.top-drawer71 textarea{width:100%}
@media(max-width:1400px){.top-center .eyebrow{display:none}.top-center{font-size:12px}.brand{min-width:190px}.top-actions .pill{font-size:11px;padding:9px}.top-actions .icon-button{padding:5px}}
@media(max-width:1100px){.app{--left-width:220px}.top-center{display:none}.project-browser71{grid-template-columns:150px minmax(0,1fr)}.bar71{gap:6px}.bar71 .segmented button{font-size:9px;padding:7px}.drawer-buttons71{gap:4px}.drawer-trigger71{padding:8px;font-size:9px}}
@media(max-width:760px){.app{--bar-height:100px}.bar71{flex-wrap:wrap;padding:7px 12px;gap:7px;justify-content:center}.width71{order:0}.drawer-buttons71{order:2;justify-content:center;margin:0;width:100%}.bar71 #headerLeft71{margin-right:auto}.bar71 #headerRight71{margin-left:auto}.bar71 .segmented button{padding:6px 5px;font-size:8px}.bar71 .text-button{font-size:9px}.drawer-rack71{right:8px;left:8px;max-width:calc(100vw - 16px);flex-wrap:wrap;max-height:65vh}.top-drawer71{width:100%;min-width:0;max-height:55vh}.top{padding:0 14px}.brand{min-width:0;gap:7px}.brand strong{font-size:13px}.brand small{font-size:6px}.brand-mark{font-size:28px}.top-actions{gap:2px}.top-actions .pill{font-size:9px;padding:7px}.top-actions .sfx-button{font-size:8px;padding:7px}.top-actions .icon-button{font-size:17px;padding:4px}.top-actions #commandOpen{display:none}.project-browser71{grid-template-columns:1fr}.project-selection71{position:static;display:flex;gap:5px;flex-wrap:wrap}.project-selection71 h3{width:100%}.project-selection71 .side-action{width:auto;padding:7px}.repository-preview71 iframe{height:520px}.main-inner{padding:24px 18px 75px}.custom-canvas>[data-section-layout]{grid-column:span 12}.split71{grid-template-columns:1fr}.left,.right{top:calc(var(--header-height) + var(--bar-height));max-height:calc(100vh - var(--header-height) - var(--bar-height))}.edge{top:var(--handle-top)!important}.hero{padding:27px}.monitor-grid71{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.top-drawer71,.project-card{transition:none}}

.modal-backdrop{z-index:60}.toast{z-index:80}
@media(max-width:1100px){.app.inspector-open .right{top:calc(var(--header-height) + var(--bar-height));max-height:calc(100vh - var(--header-height) - var(--bar-height));z-index:30}}
@media(max-width:760px){.app.mobile-nav-open .left{top:calc(var(--header-height) + var(--bar-height));z-index:30}}


/* Header-only controls: existing elements are docked in the header center. */
.top{height:auto;min-height:73px;display:grid;grid-template-columns:minmax(220px,1fr) auto minmax(350px,1fr);align-items:center;gap:12px;padding:10px 18px}
.header-identity71{display:flex;align-items:center;gap:18px;min-width:0;justify-self:start}
.header-identity71 .brand{min-width:0}
.header-context71.top-center{display:flex;flex-direction:column;align-items:flex-start;gap:5px;white-space:nowrap;font-size:11px}
.header-context71.top-center .eyebrow{display:inline-block;font-size:8px;letter-spacing:.16em}
.top>.bar71{justify-self:center}
.bar71{position:static;z-index:auto;min-height:0;padding:0;border:0;background:transparent;display:flex;align-items:center;justify-content:center;gap:9px;flex-wrap:nowrap}
.bar71 .drawer-buttons71{margin:0;gap:6px;width:auto;order:0}
.bar71 .width71{width:auto;flex-wrap:nowrap;order:0;flex-shrink:0}
.bar71 .width71 button{flex:0 0 auto;font-size:9px;padding:7px}
.bar71 .drawer-trigger71{font-size:9px;padding:8px}
.bar71 .text-button{font-size:9px;white-space:nowrap;padding:4px}
.bar71 #headerLeft71,.bar71 #headerRight71{margin:0}
.top>.top-actions{justify-self:end;min-width:0}
.top-peek{height:auto;min-height:38px;padding:6px 14px;gap:12px}
.top-collapsed .top-peek{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap}
.top-peek>.bar71{flex:1}
.top-peek>#topRestore{flex-shrink:0}
.app .shell{min-height:calc(100vh - var(--header-height))}
@media(max-width:1600px){
 .top{grid-template-columns:220px minmax(0,1fr) auto;gap:8px;padding:10px 14px}
 .header-identity71{flex-direction:column;align-items:flex-start;gap:7px}
 .header-context71.top-center{flex-direction:row;align-items:center;gap:10px;font-size:10px}
 .header-context71.top-center .eyebrow{font-size:7px}
 .bar71{gap:5px}.bar71 .width71 button{font-size:8px;padding:6px 5px}
 .bar71 .drawer-trigger71{font-size:8px;padding:7px 6px}.bar71 .drawer-buttons71{gap:4px}
 .bar71 .text-button{font-size:8px;padding:3px}
}
@media(max-width:1250px){
 .top{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'identity actions' 'controls controls';row-gap:12px}
 .header-identity71{grid-area:identity;flex-direction:row;align-items:center;gap:18px}
 .header-context71.top-center{flex-direction:column;align-items:flex-start;gap:4px}
 .top>.bar71{grid-area:controls;justify-self:center}
 .top>.top-actions{grid-area:actions}
}
@media(max-width:760px){
 .top{min-height:62px;padding:10px 12px;gap:10px 5px}
 .header-identity71{flex-direction:column;align-items:flex-start;gap:5px}
 .header-context71.top-center{flex-direction:row;align-items:center;gap:7px;font-size:9px}
 .header-context71.top-center .eyebrow{font-size:6px;letter-spacing:.1em}
 .bar71{flex-wrap:wrap;gap:7px}
 .bar71 .drawer-buttons71{justify-content:center;flex-wrap:wrap;width:auto}
 .bar71 .width71{width:auto}
 .bar71 .width71 button{font-size:8px;padding:6px}
 .bar71 .drawer-trigger71{font-size:8px;padding:7px}
 .top-peek{gap:8px}.top-peek>.bar71{flex-basis:100%}
}


/* Keep folder expansion and project launch as separate actions. */
.tree71 summary .repo-folder-name71{vertical-align:middle;overflow-wrap:anywhere}
.tree71 summary .repo-launch71{display:inline-flex;align-items:center;justify-content:center;width:27px;height:27px;margin-left:7px;padding:4px;vertical-align:middle;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--accent);cursor:pointer}
.tree71 summary .repo-launch71 .core-icon{width:15px;height:15px;margin:0;flex:none}
.tree71 summary .repo-launch71:hover,.tree71 summary .repo-launch71.active{background:var(--surface2);border-color:var(--border);color:var(--cyan)}
.project-runner71{display:grid;gap:14px;min-width:0}
.runner-toolbar71{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.runner-title71{display:grid;gap:5px;min-width:0}.runner-title71 strong{font-size:18px;overflow-wrap:anywhere}.runner-title71 small{font-size:11px}
.runner-toolbar71 .secondary{font-size:11px;padding:9px 12px;text-decoration:none}
.runner-frame71{display:block;width:100%;height:calc(100dvh - var(--header-height) - 135px);min-height:480px;border:1px solid var(--border);border-radius:var(--radius);background:#fff}
@media(max-width:760px){.runner-toolbar71{align-items:flex-start}.runner-toolbar71 .row{gap:6px}.runner-frame71{min-height:500px;height:calc(100dvh - var(--header-height) - 160px)}}


/* Width selection lives with the right-side header actions. */
.top{grid-template-columns:minmax(220px,auto) minmax(0,1fr) auto}
.top>.top-actions{gap:8px}
.top-actions>.width71,.top-peek>.width71{display:flex;flex-wrap:nowrap;width:auto;max-width:100%;flex-shrink:0}
.top-actions>.width71 button,.top-peek>.width71 button{flex:0 0 auto;white-space:nowrap;font-size:9px;padding:8px}
.top-peek>.width71{margin-left:auto}

/* PHONE constrains the real workspace content; preferences and navigation remain usable. */
.app[data-width="phone"] .main-inner{width:100%;max-width:390px;padding-left:18px;padding-right:18px}
.app[data-width="phone"] .page-intro h1{font-size:34px}
.app[data-width="phone"] .hero{padding:26px 22px}
.app[data-width="phone"] .hero h1{font-size:36px}
.app[data-width="phone"] .hero-symbol{font-size:220px;right:-20px;top:0}
.app[data-width="phone"] .cards,.app[data-width="phone"] .project-grid,.app[data-width="phone"] .component-grid,.app[data-width="phone"] .catalog-grid71,.app[data-width="phone"] .matrix-grid71,.app[data-width="phone"] .monitor-grid71,.app[data-width="phone"] .project-browser71,.app[data-width="phone"] .split71{grid-template-columns:minmax(0,1fr)}
.app[data-width="phone"] .project-selection71{position:static}
.app[data-width="phone"] .custom-canvas>[data-section-layout]{grid-column:span 12}
.app[data-width="phone"] .section-title,.app[data-width="phone"] .custom-actions,.app[data-width="phone"] .preview-controls,.app[data-width="phone"] .frame-row{flex-wrap:wrap}
.app[data-width="phone"] .frame-row{flex-direction:column}
.app[data-width="phone"] .preview-controls>.field{min-width:0;width:100%;flex-basis:100%}
.app[data-width="phone"] .toolbar>.search{min-width:0;width:100%;flex-basis:100%}
.app[data-width="phone"] .compare-frame .field{width:calc(100% - 18px)}
.app[data-width="phone"] .link-row,.app[data-width="phone"] .bookmark-row{flex-wrap:wrap}
.app[data-width="phone"] .bookmark-actions{width:100%;justify-content:flex-start}
.app[data-width="phone"] .runner-title71{width:100%}

/* Independent windows are centered in the viewport, not attached to the right edge. */
.drawer-rack71{top:50%;left:50%;right:auto;transform:translate(-50%,-50%);width:max-content;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);justify-content:center;align-items:center}
@media(max-width:1600px){
 .top{grid-template-columns:220px minmax(0,1fr) auto;gap:8px}
 .top-actions>.width71 button,.top-peek>.width71 button{font-size:8px;padding:7px 5px}
 .top>.top-actions{gap:5px}
}
@media(max-width:1250px){
 .top{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'identity actions' 'controls controls'}
 .top>.top-actions{flex-wrap:wrap;justify-content:flex-end;max-width:min(640px,calc(100vw - 240px));gap:6px}
 .header-identity71{flex-wrap:wrap}
}
@media(max-width:760px){
 .top>.top-actions{max-width:220px;gap:5px}
 .top-actions>.width71{margin-left:auto;max-width:220px}
 .top-actions>.width71 button{font-size:7px;padding:7px 5px}
 .header-context71.top-center{flex-wrap:wrap;white-space:normal;gap:4px}
 .top-peek>.width71{margin-left:auto;flex-basis:auto}
 .drawer-rack71{top:50%;left:50%;right:auto;transform:translate(-50%,-50%);width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);align-items:center}
}

@media(max-width:380px){
 .top{grid-template-columns:minmax(0,1fr);grid-template-areas:'identity' 'actions' 'controls';row-gap:10px}
 .top>.top-actions{justify-self:stretch;max-width:100%;width:100%;justify-content:flex-end}
 .header-identity71{width:100%;flex-direction:row;align-items:center;gap:12px;flex-wrap:wrap}
 .top-actions>.width71{max-width:100%}
}
