/* Mari Cush working UI. Stageshow craft principles: readable type, shared insets,
   quiet surfaces, content-sized controls. Canvas/email content keeps its own geometry. */
:root {
  --studio-sidebar: 240px;
  --studio-topbar: 64px;
  --studio-gutter: clamp(20px, 2.4vw, 36px);
  --studio-radius: 10px;
  --olive: #394b35;
  --ink: #263029;
  --muted: #626d63;
  --line: #dfe5dc;
  --bg: #f6f7f3;
}
body { color:var(--ink); background:var(--bg); font-size:14px; line-height:1.5; }
#app { min-width:0; }
#app > aside {
  width:var(--studio-sidebar); height:100dvh; padding:26px 16px 16px;
  background:#fff; border-right:1px solid var(--line); overflow-y:auto; overscroll-behavior:contain;
  scrollbar-width:thin; z-index:60;
}
#app > aside .brand { padding:0 12px 26px; flex:none; }
#app > aside .brand img { width:154px; max-width:100%; }
#app > aside .brand small { font-size:9px; color:var(--muted); letter-spacing:2px; }
#app > aside nav { display:grid; gap:22px; }
.studio-nav-group { display:grid; gap:3px; }
.studio-nav-label { padding:0 12px 7px; font-size:10px; font-weight:650; color:#747e73; letter-spacing:.04em; }
#app > aside nav button {
  width:100%; min-width:0; min-height:40px; margin:0; padding:10px 12px;
  gap:10px; font-size:12px; line-height:1.4; font-weight:500; color:#566252; border-radius:7px;
}
#app > aside nav button span { min-width:0; overflow-wrap:anywhere; }
#app > aside nav button svg { flex:none; width:17px; height:17px; }
#app > aside nav button:hover { background:#f3f5ef; }
#app > aside nav button.active { color:#2e4427; background:#eaf0e3; font-weight:650; }
#app > aside .side-bottom { margin-top:auto; padding:24px 12px 0; flex:none; }
#app > aside .profile { margin:0; padding-top:16px; border-color:var(--line); }
#app > aside .profile strong { font-size:11px; }
#app > aside .profile small { font-size:10px; color:var(--muted); }
.studio-nav-close,.studio-nav-backdrop { display:none; }
.workspace { margin-left:var(--studio-sidebar); min-width:0; }
.workspace > .topbar {
  height:var(--studio-topbar); min-height:var(--studio-topbar); padding:0 var(--studio-gutter);
  gap:16px; background:#fff;
}
.topbar .breadcrumbs { min-width:0; font-size:11px; }
.topbar .breadcrumbs b { color:var(--ink); }
.top-actions { flex-shrink:0; gap:12px; }
.top-actions > .micro { display:none; }
.top-actions > button { min-height:34px; }
.content { max-width:1680px; margin-inline:auto; min-width:0; padding:0; }
.content[data-page]:is([data-page="overview"],[data-page="marketing"],[data-page="analytics"],[data-page="products"],[data-page="campaigns"],[data-page="create"],[data-page="recommendations"],[data-page="photobank"]) { padding:var(--studio-gutter); }
.content > :is(.kc-heading,.kc-editor-state,.kc-editor-layout,.kc-filterbar,.kc-template-gallery,.kc-journey,.kc-stats,.kc-clock,.panel,.kc-pagination) { margin-inline:0; }
.content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading) { gap:20px; align-items:flex-start; }
.content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading) h1 { font-size:clamp(24px,2.2vw,32px); line-height:1.25; letter-spacing:-.8px; }
.content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading) p { color:var(--muted); font-size:13px; }
:is(.heading-actions,.kc-actions,.ec-heading-actions,.wb-actions,.modal-actions,.ec-dialog-actions) { flex-wrap:wrap; gap:8px; }
:is(.btn,.wb-btn,.ec-btn) { min-height:38px; border-radius:7px; line-height:1.4; max-width:100%; }
:is(.btn,.wb-btn) { font-size:12px; white-space:normal; }
:is(.btn,.wb-btn,.ec-btn).primary { background:var(--olive); border-color:var(--olive); }
:is(.btn,.wb-btn,.ec-btn):focus-visible, :is(input,select,textarea):focus-visible { outline:2px solid #59764c; outline-offset:3px; }
:is(input,select,textarea) { min-width:0; max-width:100%; }
input[type=checkbox],input[type=radio] { flex:none; }
:where(.panel,.metric,.segment-card,.integration-card,.ec-dialog,.pb-product-card) { border-radius:var(--studio-radius); }
:is(.panel-head,.section-row,.kc-heading,.pb-detail-top,.pb-pager,.pagination) { flex-wrap:wrap; gap:12px; }
:is(.metrics,.main-grid,.catalog,.segment-grid,.integration-grid,.editor-grid,.kc-home-grid,.kc-audience-layout,.kc-editor-layout,.kc-profile-grid,.ec-library-grid,.ms-layout,.sp-grid) > * { min-width:0; }
:is(.table-wrap,.kc-table-wrap) { max-width:100%; overflow:auto; overscroll-behavior-x:contain; }
:is(.metric,.kc-stats) strong { font-variant-numeric:tabular-nums; }
:is(.review-list li,.flow-top,.product-bottom) { flex-wrap:wrap; }
:is(.review-list li b,.mail-row-main,.ms-detail,.rm-focus) { overflow-wrap:anywhere; }
:is(.steps,.kc-tabs,.mail-scopes,.pb-tabs,.wb-tabs) { max-width:100%; }
#toast { left:calc(50% + var(--studio-sidebar)/2); max-width:min(600px,calc(100vw - 32px)); }
dialog { max-height:calc(100dvh - 32px); overflow:auto; }
.modal-head { gap:16px; }
.modal-head h2 { overflow-wrap:anywhere; }
.close { flex:none; }
#cloud-state { left:calc(var(--studio-sidebar) + 16px); right:16px; max-width:calc(100vw - var(--studio-sidebar) - 32px); flex-wrap:wrap; border-radius:8px; }

/* Full-height workspaces: toolbars grow with their content, the canvas owns scrolling. */
.wb-shell { height:calc(100dvh - var(--studio-topbar)); min-height:540px; }
.wb-titlebar { height:auto; min-height:76px; padding:16px 24px; flex-wrap:wrap; }
.wb-titlebar h1 { line-height:1.35; }
.wb-titlebar small { color:var(--muted); font-size:11px; }
.wb-toolbar { height:auto; min-height:52px; padding:8px 16px; flex-wrap:wrap; }
.wb-tabs { flex-wrap:wrap; }
.wb-tabs .wb-btn { font-size:12px; }
.wb-body,.wb-editor,.wb-stage { min-width:0; }
.wb-rail-label,.wb-overline { color:#66745e; font-size:10px; }
.wb-chain span { font-size:12px; }
.wb-chain small,.wb-source-mini span { font-size:11px; color:#66745e; }
.wb-drawer { width:min(390px,100%); }
.wb-drawer-top { height:auto; min-height:48px; font-size:12px; }
.wb-drawer .lc-inspector :is(label,.muted) { font-size:12px; }
.wb-drawer .lc-inspector :is(input,select) { font-size:13px; min-height:40px; }
.kc-folders button { align-items:flex-start; }
.kc-folders button small { padding-top:2px; }
.cc-step { min-width:0; }
.cc-step > :is(div,p) { min-width:0; overflow-wrap:anywhere; }
.cc-step-actions { display:flex; flex-wrap:wrap; gap:8px; }
:is(.mail-library,.wb-dashboard,.demo-integrations,.history-page,.shared-review,.ec-studio) { padding:var(--studio-gutter); }
.mail-row { gap:16px; }
.mail-row-main { min-width:0; }
.mail-scopes { overflow-x:auto; }
.mail-scopes > * { flex:none; }
.kc-filterbar { flex-wrap:wrap; }
.kc-filterbar input { min-width:0; max-width:100%; }
.kc-letter-preview { left:calc(var(--studio-sidebar) + 16px); }

/* Photobank: consistent cards and a filter grid with room for long product names. */
#pb-page,#pb-catalog { max-width:none; }
.pb-heading > div:last-child { display:flex; flex-wrap:wrap; gap:8px; }
.pb-heading p { margin:6px 0 0; }
.pb-metrics { gap:24px; flex-wrap:wrap; padding:18px 0; margin:24px 0; border-color:var(--line); }
.pb-metrics span { color:var(--muted); font-size:12px; }
.pb-metrics b { color:var(--ink); font-size:26px; font-weight:600; }
.pb-filters { display:grid; grid-template-columns:minmax(150px,1.4fr) repeat(3,minmax(110px,1fr)); gap:14px; padding:20px; background:#eef1e8; border:1px solid #dfe5d6; border-radius:10px; }
.pb-filters label { min-width:0; font-size:12px; }
.pb-filters .pb-check { grid-column:1 / 3; flex-direction:row; padding:0; }
.pb-filters .pb-check input { width:17px; }
.pb-filters :is(input,select) { min-height:40px; width:100%; max-width:100%; border-color:#cbd5c3; }
.pb-filters button { justify-self:end; width:100%; }
.pb-grid { grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr)); gap:20px; }
.pb-photo { min-width:0; border-color:var(--line); border-radius:10px; }
.pb-thumbnail { height:auto; aspect-ratio:1; background:#f0f1eb; }
.pb-caption { padding:16px; gap:8px; line-height:1.5; }
.pb-caption :is(strong,span,small) { overflow-wrap:anywhere; }
.pb-caption small { font-size:11px; }
#pb-edit { min-width:0; }
#pb-edit h2 { margin-bottom:20px; }
.pb-product-checks label { align-items:flex-start; line-height:1.5; }
.pb-product-checks input { margin-top:3px; }
.pb-detail-top > span { overflow-wrap:anywhere; min-width:0; }
.pb-original { background:#eff1e9; }
#pb-catalog-search { flex-wrap:wrap; }
#pb-catalog-search label { flex:1; min-width:min(220px,100%); }

/* Scoped product/editor surfaces, not the HTML emails they produce. */
.content .rm-workspace { grid-template-columns:220px minmax(0,1fr); }
.content .rm-results span { min-width:0; overflow-wrap:anywhere; }
.content .rm-results img { flex:none; }
.content .rm-viewport { height:clamp(400px,65vh,680px); }
.content .ms-list button { display:block; line-height:1.5; }
.content .ms-list small { line-height:1.5; }
.content .ms-detail { min-width:0; }
.ec-heading-actions { flex-shrink:1; }
.ec-photo-search { flex-wrap:wrap; }
.ec-photo-search input { min-width:150px; }
.ec-dialog { max-height:calc(100dvh - 32px); }
.at-studio { min-height:0; }
.at-studio .at-library { transform:none; }
.at-topbar { min-height:72px; height:auto; padding-block:10px; flex-wrap:wrap; gap:14px; }
.at-topbar nav { min-height:40px; }
.at-topbar nav .at-btn { color:#595b52; }
.at-topbar nav .at-btn.is-active { color:#222; }
.at-top-actions { flex-wrap:wrap; }
.at-document-bar { flex-wrap:wrap; }
.at-document-title { flex-wrap:wrap; }
.at-library-tabs { flex-wrap:wrap; }
.at-library-tabs .at-btn { white-space:normal; }
.at-title-button { max-width:min(280px,45vw); }
.at-material strong { overflow-wrap:anywhere; }

@media (max-width:1200px) {
 .topbar .breadcrumbs { display:none; }
 .top-actions { margin-left:auto; }
 .pb-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .pb-filters .pb-check { grid-column:1 / -1; }
 .content .ms-layout { grid-template-columns:230px minmax(0,1fr); }
}
@media (max-width:900px) {
 :root { --studio-sidebar:0px; --studio-topbar:64px; --studio-gutter:20px; }
 #app > aside { width:260px; transform:translateX(-100%); visibility:hidden; transition:transform .18s,visibility .18s; }
 body.menu-open #app > aside { transform:none; visibility:visible; box-shadow:12px 0 60px #1e2c2029; }
 body.menu-open { overflow:hidden; }
 .studio-nav-close { display:block; position:absolute; right:10px; top:8px; width:36px; height:36px; font-size:24px; }
 body.menu-open .studio-nav-backdrop { display:block; position:fixed; inset:0; z-index:50; background:#1e2c2055; }
 .workspace { margin-left:0; }
 .mobile-menu { display:inline-flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; }
 #toast { left:50%; }
 #cloud-state { left:12px; right:12px; max-width:none; }
 .kc-letter-preview { left:16px; }
 .content .rm-workspace { grid-template-columns:185px minmax(0,1fr); }
 .at-topbar { gap:10px; padding-inline:16px; }
 .at-brand img { width:140px; }
 .at-topbar nav { gap:0; }
 .at-top-actions .at-save { margin-left:0; }
}
@media (max-width:650px) {
 :root { --studio-gutter:16px; }
 .topbar .tour-launch { display:none; }
 .top-actions { gap:8px; min-width:0; }
 .top-actions .demo-pill { font-size:9px; }
 .content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading) { flex-direction:column; align-items:stretch; gap:16px; }
 .content :is(.heading-actions,.kc-actions,.ec-heading-actions) { justify-content:flex-start; flex-direction:row; }
 .content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading) h1 { font-size:26px; }
 .content :is(.catalog,.segment-grid,.integration-grid,.editor-grid,.main-grid) { grid-template-columns:minmax(0,1fr); }
 .content .connection-strip { grid-template-columns:1fr; }
 .content .connection { flex-wrap:nowrap; padding:14px; gap:12px; }
 .content .connection div:nth-child(2) { width:auto; }
 .content .connection strong { font-size:13px; }
 .content .connection small { font-size:11px; }
 .content .featured { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
 .feature-copy { padding:20px 0 20px 20px; }
 .feature-copy h2 { font-size:28px; }
 .pb-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .pb-caption { padding:12px; font-size:11px; }
 .pb-caption strong { font-size:12px; }
 .pb-metrics { gap:12px 20px; }
 .pb-metrics b { font-size:23px; }
 .pb-filters { padding:16px; }
 .pb-filters label { grid-column:1 / -1; }
 .pb-filters .pb-check input { width:17px; min-height:17px; }
 .pb-detail-body { grid-template-columns:minmax(0,1fr); }
 .pb-tabs { flex-wrap:wrap; }
 .content .rm-workspace,.content .ms-layout { grid-template-columns:minmax(0,1fr); }
 .content .rm-catalog { border:0; padding:0; }
 .content .rm-catalog .rm-results { max-height:180px; }
 .content .ms-list { grid-template-columns:minmax(0,1fr); }
 .content .ms-facts { grid-template-columns:minmax(0,1fr); }
 .wb-shell { height:auto; min-height:calc(100dvh - var(--studio-topbar)); }
 .wb-body { min-height:500px; }
 .wb-stage { min-height:400px; }
 .wb-titlebar { padding:16px; }
 .wb-toolbar { overflow-x:auto; }
 .cc-shell .wb-tabs { flex-wrap:nowrap; }
 .cc-step-actions { margin-left:0; width:100%; }
 .cc-time { width:auto; }
 .cc-step { align-items:flex-start; }
 .cc-step > div { flex-basis:100%; }
 .kc-clock { flex-wrap:wrap; }
 .kc-filterbar :is(input,select) { width:100%; max-width:100%; }
 .ec-photo-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .at-topbar { position:relative; min-height:60px; padding:8px 12px; gap:6px; }
 .at-top-actions { gap:2px; }
 .at-top-actions .at-save { min-width:78px; padding-inline:10px; }
 .at-studio .at-brand img { width:112px; }
 .at-studio .at-library { top:60px; max-height:calc(100dvh - 60px); }
 .at-context { max-width:100%; white-space:normal; flex-wrap:wrap; }
 .ec-dialog-actions { flex-wrap:wrap; }
 .modal-head,.modal-body { padding:20px; }
 .modal-actions { flex-wrap:wrap; }
}
@media (prefers-reduced-motion:reduce) {
 #app > aside { transition:none; }
}
/* Page-level breathing room applies to the current communication views too. */
.content[data-page="automations"]:has(> .cw-layout),
.content[data-page="segments"],.content[data-page="dispatches"] { padding:var(--studio-gutter); }
.content .cw-heading { padding:0; gap:20px; flex-wrap:wrap; margin-bottom:24px; }
.content .cw-heading h1 { font-size:clamp(26px,2.2vw,32px); line-height:1.25; }
.content .cw-heading p { font-size:13px; color:var(--muted); }
.content .cw-groups button { line-height:1.5; }
.content .cw-groups strong { font-size:13px; }
.content .cw-step-heading { gap:12px; flex-wrap:wrap; }
.content .cw-tabs { gap:8px; }
.content .kc-pad > h2 { margin-top:24px; }
.content .kc-pad > h1 { font-size:clamp(26px,2.4vw,34px); line-height:1.25; }
.content .kc-pad > p { font-size:13px; }
.shared-review .sr-heading { gap:16px; flex-wrap:wrap; }
#local-environment { display:inline-flex; flex:none; align-items:center; padding:6px 9px; border:1px solid #d5dfca; border-radius:6px; background:#f1f5e9; color:#435a33; font:11px/1.4 Manrope,Arial,sans-serif; white-space:nowrap; }
body > #local-environment { position:fixed; bottom:16px; right:16px; }
.topbar > #local-environment { order:-1; }
#cloud-state { position:relative; inset:auto; margin:20px 16px 16px calc(var(--studio-sidebar) + 16px); width:auto; max-width:none; z-index:5; box-shadow:none; padding:12px 16px; }
#cloud-state > span { flex:1 1 200px; }
body:has(.ec-studio) #cloud-state { margin:20px 16px 16px calc(var(--studio-sidebar) + 16px); font-size:12px; }
body:has(.at-studio) #cloud-state { display:none; }
@media(max-width:1100px) { .topbar .tour-launch { display:none; } }
@media(max-width:650px) {
 .topbar > #local-environment { order:0; margin-right:auto; }
 .topbar .top-actions { order:1; margin-left:0; }
 .topbar .demo-pill { display:none; }
 .topbar { gap:8px; }
 #cloud-state { margin:16px; }
 .content .cw-timeline > li { grid-template-columns:24px minmax(0,1fr); }
 .content .cw-timeline article { padding:16px; }
 .content .cw-step-heading h3 { font-size:16px; }
 .content .cw-groups { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .content .cw-groups button { padding:14px; }
 .at-document-bar > #local-environment { font-size:10px; padding:4px 6px; }
}
.at-document-bar .at-history { font-size:11px; padding:4px 8px; min-height:28px; }
.at-document-bar .at-document-title { flex:1; }
@media(max-width:560px) {
 .at-topbar { height:60px; flex-wrap:nowrap; }
 .at-top-actions { flex-wrap:nowrap; }
 .at-document-bar { gap:8px; }
 .at-document-bar .at-history { order:2; }
 .at-document-bar > #local-environment { order:3; }
 .at-document-bar .at-document-title { flex:1 1 70%; }
}
@media(max-width:1100px) {
 .content .cw-layout:has(> .cw-editor) { grid-template-columns:minmax(0,1fr); }
 .content .cw-layout > .cw-editor { grid-row:1; position:static; max-height:none; }
 .content .cw-layout:has(> .cw-editor) > .cw-main { grid-row:2; }
}
@media(max-width:1100px) {
 .at-document-bar .at-document-title { flex:1 0 100%; order:-1; flex-wrap:nowrap; }
 .at-document-bar .at-history { order:0; }
 .at-document-bar .at-preview-toggle { order:1; margin-left:auto; }
 .at-document-bar > #local-environment { order:2; }
}

/* Studio workspace v2: task navigation, contextual library, restrained chrome. */
:root { --studio-sidebar:224px; --studio-topbar:56px; --studio-gutter:28px; --bg:#fafbf9; --line:#e5e8e2; }
#app > aside { padding:22px 12px 12px; overflow:hidden; background:#f0f2ec; border-right:1px solid #e0e5da; }
#app > aside .brand { padding:0 14px 22px; }
#app > aside .brand img { width:136px; }
#app > aside .brand small { margin-top:8px; font-size:8px; letter-spacing:2.3px; }
#app > aside nav { display:flex; flex-direction:column; gap:18px; min-height:0; overflow-y:auto; scrollbar-width:thin; padding:0 0 8px; flex:1; }
#app > aside nav button { min-height:36px; padding:8px 12px; font-size:12px; line-height:20px; gap:10px; border-radius:6px; color:#52604e; flex-shrink:0; }
#app > aside nav button span { overflow-wrap:normal; }
#app > aside nav button:hover { background:#e6ebdf; }
#app > aside nav button.active { background:#fff; color:#273d24; box-shadow:0 1px 3px #24351c10; }
#app > aside nav .studio-compose { background:#354a30; color:#fff; margin-bottom:2px; min-height:40px; }
#app > aside nav .studio-compose:hover { background:#253d22; }
.studio-compose span:last-child { margin-left:auto; font-size:18px; }
.studio-nav-group { gap:2px; }
.studio-nav-label { padding:0 12px 5px; font-size:9px; text-transform:uppercase; letter-spacing:1.2px; color:#85907d; }
.studio-nav-utilities { margin-top:auto; padding-top:12px; border-top:1px solid #dce2d6; }
#app > aside .side-bottom { display:flex; align-items:center; gap:8px; padding:12px; margin-top:4px; border-top:1px solid #dce2d6; font-size:10px; color:#778270; }
.studio-workspace-dot { width:6px; height:6px; border-radius:50%; background:#718265; }
.workspace > .topbar { background:#fff; padding-inline:28px; border-bottom:1px solid var(--line); gap:12px; }
.topbar .breadcrumbs { display:flex; align-items:center; gap:12px; font-size:12px; color:#8a9284; overflow:hidden; }
.topbar .breadcrumbs strong { color:#495442; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar .top-actions { gap:8px; margin-left:auto; }
.topbar .tour-launch { display:block; background:transparent; border:0; color:#6d7865; font-size:11px; padding:6px 10px; }
.topbar [data-workspace-logout] { border:0; background:transparent; color:#6d7865; padding:6px 10px; font-size:11px; }
.studio-context { display:flex; align-items:center; gap:24px; padding:0 var(--studio-gutter); height:52px; background:#fff; border-bottom:1px solid var(--line); overflow-x:auto; }
.studio-context button { flex:none; align-self:stretch; padding:0 2px; border-bottom:2px solid transparent; font-size:12px; color:#7b8475; }
.studio-context button[aria-current] { border-bottom-color:#354a30; color:#354a30; font-weight:650; }
.content { max-width:1600px; }
.content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading,.cw-heading) { margin-bottom:24px; }
.content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading,.cw-heading) h1 { font-size:26px; font-weight:550; letter-spacing:-.65px; }
.content .eyebrow { display:none; }
.content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading,.cw-heading) p { max-width:680px; line-height:1.6; }
.pb-metrics { margin:0 0 22px; padding:14px 0; gap:28px; border-top:0; }
.pb-metrics b { font-size:20px; font-weight:550; }
.pb-tabs { border-bottom:1px solid var(--line); gap:20px; margin-bottom:18px; }
.pb-tabs button { border:0; border-radius:0; background:transparent; padding:10px 0; font-size:12px; }
.pb-tabs button.active,.pb-tabs button:disabled { border-bottom:2px solid #354a30; color:#354a30; opacity:1; }
.pb-filters { padding:16px; gap:12px; background:#fff; border-color:var(--line); margin-bottom:20px; }
.pb-grid { gap:16px; }
.pb-caption { padding:12px; }
.content .cw-groups { gap:8px; }
.content .cw-groups button { background:#fff; border-radius:8px; }
.content .cw-tabs { gap:4px; border-bottom:1px solid var(--line); }
.content .cw-timeline article { background:#fff; }
.footer-note { display:none; }
#cloud-state { border:0; border-top:1px solid var(--line); border-radius:0; background:transparent; color:#7b8475; font-size:10px; padding:12px; }
@media(min-width:901px) and (max-height:760px) {
 #app > aside { padding-top:16px; }
 #app > aside .brand { padding-bottom:14px; }
 #app > aside .brand small { display:none; }
 #app > aside nav { gap:12px; }
 #app > aside nav button { min-height:32px; padding-block:6px; }
}
@media(max-width:1100px) { :root { --studio-gutter:22px; } }
@media(max-width:900px) {
 :root { --studio-sidebar:0px; --studio-gutter:20px; }
 #app > aside { width:264px; }
 .workspace > .topbar { padding-inline:16px; }
 .topbar .breadcrumbs { display:flex; }
 .studio-nav-close { top:12px; }
}
@media(max-width:650px) {
 :root { --studio-gutter:16px; }
 .topbar .breadcrumbs > span { display:none; }
 .topbar .breadcrumbs { font-size:11px; }
 .topbar .tour-launch { display:none; }
 .topbar .top-actions { margin-left:auto; }
 .topbar > #local-environment { display:none; }
 .studio-context { gap:24px; height:48px; }
 .content :is(.page-heading,.kc-heading,.ec-heading,.pb-heading,.cw-heading) h1 { font-size:24px; }
 .pb-metrics { gap:10px 18px; }
 .pb-metrics b { font-size:19px; }
 .pb-metrics span { font-size:10px; }
}
@media(max-width:650px) {
 .pb-filters label { grid-column:auto; }
 .pb-filters .pb-check { grid-column:1 / -1; }
 .pb-filters :is(input,select) { font-size:12px; }
 .pb-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
 .pb-metrics span { display:flex; flex-direction:column; align-items:flex-start; }
}

/* Audit fixes: preview sizing and small-screen controls. */
dialog.at-preview-dialog { width:min(940px,calc(100vw - 32px)); max-width:calc(100vw - 32px); }
.at-preview-dialog .ec-dialog-content { overflow-x:auto; }
.at-preview-dialog .ec-preview { max-width:none; border:0; outline:1px solid var(--line); }
.at-preview-dialog .at-desktop-frame { width:600px; }
.at-preview-dialog .at-phone-frame { width:375px; }
@media(max-width:650px) {
 .studio-context { height:auto; min-height:48px; flex-wrap:wrap; gap:0 18px; overflow:visible; padding-block:4px; }
 .studio-context button { min-height:40px; }
 .shared-review .sr-heading > div { flex:1 0 100%; }
 .shared-review .sr-heading { gap:8px; }
 .history-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .history-controls label,.history-controls select { min-width:0; width:100%; }
 .history-diff article > div { grid-template-columns:minmax(0,1fr); }
 .ec-library-layout:has(.ec-material-editor input) .ec-material-editor { grid-row:1; }
}
