/* Scoped to the profile manager; the editor owns its own iframe styles. */
.profiles-dialog{width:min(1060px,calc(100vw - 40px));max-width:none;height:min(750px,calc(100dvh - 50px));max-height:none;padding:0;overflow:hidden;background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:12px}
.profiles-dialog::backdrop{background:var(--backdrop)}
#profiles-catalogue{height:100%;display:flex;flex-direction:column}
.profiles-heading{display:flex;justify-content:space-between;align-items:start;gap:20px;padding:23px 24px 17px;background:var(--panel);border-bottom:1px solid var(--line)}
.profiles-heading .eyebrow{margin:0 0 5px;font-size:10px;letter-spacing:1.2px}.profiles-heading h2{font-size:23px;margin:0 0 7px}.profiles-heading button{font-size:12px}
.profiles-controls{display:flex;gap:9px;padding:15px 20px 0}.profiles-search-label{flex:1;margin:0!important}.profiles-search-label input{margin:0!important;padding:9px 11px}.profiles-controls button{font-size:12px}
.profiles-status{min-height:34px;padding:10px 22px 4px;margin:0}.profiles-dialog #profiles-error{margin:10px 22px 0}
.profiles-layout{display:grid;grid-template-columns:360px minmax(0,1fr);flex:1;min-height:0;border-top:1px solid var(--line);margin-top:7px}
.profiles-list{overflow:auto;padding:15px 12px;background:var(--panel);border-right:1px solid var(--line)}
.profiles-group-title{font-size:10px!important;letter-spacing:1px;text-transform:uppercase;color:var(--muted);margin:1px 10px 10px!important;font-weight:600}
.profiles-group-title:not(:first-child){margin-top:24px!important}.profiles-row{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;border-color:transparent;background:transparent;text-align:left;padding:12px 10px;border-radius:7px;margin-bottom:4px;white-space:normal}.profiles-row.active{background:var(--accent-dark);border-color:var(--line)}.profiles-row.active strong{color:var(--accent)}.profiles-row-title{min-width:0}.profiles-row-title strong{display:block;font-size:13px;overflow-wrap:anywhere;font-weight:600}.profiles-row-title small{display:block;font-size:11px;margin-top:4px}.profiles-row-badge{font-size:10px;color:var(--muted);border:1px solid var(--line);border-radius:4px;padding:3px 5px;white-space:nowrap}.profiles-empty{padding:18px 10px;line-height:1.6}
.profiles-details{padding:25px 27px;overflow:auto}.profiles-details .eyebrow{font-size:10px;letter-spacing:1px;margin:0 0 8px}.profiles-details h3{font-size:21px;margin:0 0 12px}.profiles-description{font-size:12px;line-height:1.7;margin:0 0 19px}.profiles-facts{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:8px 0;margin-bottom:20px}.profiles-detail-row{display:flex;justify-content:space-between;font-size:12px;padding:7px 0;gap:15px}.profiles-detail-row strong{font-weight:500}.profiles-detail-actions{display:flex;flex-wrap:wrap;gap:8px}.profiles-detail-actions button,.profiles-use-actions button{font-size:12px}.profiles-use-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:23px;padding-top:19px;border-top:1px solid var(--line)}.profiles-version-note{margin-top:20px;line-height:1.65}
.profiles-foot{display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:13px 21px;font-size:10px;color:var(--muted);background:var(--panel)}
.profiles-dialog.editing{width:calc(100vw - 20px);height:calc(100dvh - 20px);border-radius:9px}.profiles-editor{height:100%;width:100%}.profiles-editor iframe{height:100%;width:100%;border:0;display:block;background:var(--bg)}
.profiles-dialog .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:750px){.profiles-dialog{width:calc(100vw - 20px);height:calc(100dvh - 20px)}.profiles-heading{padding:15px;gap:10px}.profiles-heading h2{font-size:20px}.profiles-heading .small{display:none}.profiles-controls{padding:12px 12px 0;flex-wrap:wrap}.profiles-search-label{flex-basis:100%}.profiles-layout{grid-template-columns:minmax(175px,42%) minmax(0,1fr)}.profiles-details{padding:18px 15px}.profiles-details h3{font-size:18px}.profiles-foot{flex-direction:column;padding:10px 15px;gap:3px}.profiles-row{padding:9px 7px}.profiles-row-badge{display:none}}
/* Profiles stays visible alongside the existing workspace actions. */
@media(max-width:1400px){
  #workspace>.topbar{gap:4px}
  #workspace>.topbar .wa-project-anchor{flex:0 1 165px;min-width:140px;max-width:170px}
  #workspace>.topbar .preset-select{flex:0 1 160px;min-width:140px;max-width:170px}
  #workspace>.topbar .workspace-modes{margin-left:0;gap:1px}
  #workspace>.topbar .workspace-modes button,#workspace>.topbar>button{padding-left:5px;padding-right:5px;font-size:12px}
}
@media(max-width:1100px){
  #workspace>.topbar{flex-wrap:wrap;height:auto;min-height:52px;padding:6px 10px;overflow-x:visible;row-gap:2px}
  #workspace>.topbar .workspace-modes{min-height:33px;align-self:auto}
  #workspace>.topbar .top-spacer{min-width:0}
}
@media(min-width:1401px) and (max-width:1500px){#workspace>.topbar{gap:6px}}
