:root{
  --panel-surface:#fff;
  --panel-border:#dfe7ef;
  --panel-text:#24374d;
  --panel-muted:#6b7d91;
  --panel-accent:#286fc6;
  --panel-accent-soft:#eaf2ff;
  --panel-radius:10px;
  --panel-space-1:.35rem;
  --panel-space-2:.65rem;
  --panel-space-3:1rem;
}
.sidebar a.brand { color: inherit; text-decoration: none; }
.sidebar a.brand:focus-visible { outline: 2px solid #82aff0; outline-offset: 3px; }
.panel-subject-symbol {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  margin-inline-end: .3rem;
  vertical-align: .035em;
  border-radius: .4rem;
  color: var(--record-ink, #2b5fa0);
  background: var(--record-tint, #e9f1fc);
}
.panel-subject-symbol svg { display: block; }

.sidebar #navigation{display:block;flex:1;min-height:0;overflow:auto;margin:1.2rem 0;padding-right:.15rem}
.workspace-nav-group{margin:0 0 .3rem}
.sidebar .workspace-nav-toggle{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;
  padding:.65rem .75rem;margin:0;background:transparent;border-radius:var(--panel-radius);color:#d9e7e6;
  text-align:left;font-size:.83rem;font-weight:750;line-height:1.25;letter-spacing:.015em}
.sidebar .workspace-nav-toggle:hover,.sidebar .workspace-nav-toggle:focus-visible{background:#294850;color:#fff}
.sidebar .workspace-nav-toggle[aria-expanded="true"]{background:#294850;color:#fff}
.workspace-nav-toggle .workspace-nav-chevron{display:inline-block;flex:none;transition:transform .16s ease}
.workspace-nav-toggle[aria-expanded="true"] .workspace-nav-chevron{transform:rotate(180deg)}
.sidebar .workspace-nav-items{padding:.15rem 0 .4rem .45rem}
.sidebar .workspace-nav-items[hidden]{display:none}
.sidebar .workspace-nav-items .nav-link{display:flex;align-items:center;gap:.5rem;min-height:38px;padding:.43rem .65rem;
  margin:.1rem 0;font-size:.86rem;line-height:1.25}
.sidebar .workspace-nav-label{display:inline-flex;align-items:center;gap:.55rem;min-width:0;overflow-wrap:anywhere}
.sidebar .workspace-nav-icon{display:inline-flex;justify-content:center;align-items:center;flex:none;width:1.25rem;font-size:1rem}
.sidebar .workspace-nav-count{margin-left:auto;font-size:.72rem;font-weight:700}
.sidebar .workspace-nav-future{color:#9aa9b5;cursor:default}
.sidebar .workspace-nav-future:hover{background:transparent;color:#9aa9b5}
.sidebar .workspace-nav-future-status{margin-left:auto;font-size:.66rem;white-space:nowrap}
.sidebar .nav-link:focus-visible,.sidebar .workspace-nav-toggle:focus-visible{outline:2px solid #82aff0;outline-offset:2px}
.workspace-manager-link{display:flex;align-items:center;gap:.5rem;color:inherit;text-decoration:none;min-width:0}
.workspace-manager-link:hover{color:#286fc6}
.workspace-manager-link>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workspace-manager-avatar{display:grid;place-items:center;flex:none;width:28px;height:28px;border-radius:50%;background:#dceafe;color:#245d9f;font-size:.76rem;font-weight:800}

.workspace-mode .sidebar .workspace-nav-toggle{color:var(--panel-muted)}
.workspace-mode .sidebar .workspace-nav-toggle:hover,
.workspace-mode .sidebar .workspace-nav-toggle:focus-visible,
.workspace-mode .sidebar .workspace-nav-toggle[aria-expanded="true"]{color:#205a9f;background:var(--panel-accent-soft)}
.workspace-mode .sidebar .workspace-nav-future{color:#8493a3}
.workspace-mode .sidebar .workspace-nav-future:hover{color:#8493a3;background:transparent}
.workspace-mode .sidebar .workspace-nav-items .nav-link{color:var(--panel-text)}
.workspace-mode .sidebar .workspace-nav-items .nav-link.active,
.workspace-mode .sidebar .workspace-nav-items a.nav-link:hover{color:#205a9f;background:var(--panel-accent-soft)}
.workspace-mode .sidebar .workspace-nav-items .workspace-nav-future{color:#8493a3}
.workspace-context-picker{display:flex;align-items:center;gap:.5rem;min-width:0}
.workspace-context-picker label{display:grid;gap:.1rem;margin:0;color:var(--panel-muted);font-size:.68rem;white-space:nowrap}
.workspace-mode #project-picker .workspace-context-picker select{width:auto;max-width:180px;min-width:120px;padding:.3rem 1.6rem .3rem .5rem;font-size:.78rem}
.workspace-context-picker .workspace-context-note{color:var(--panel-muted);font-size:.72rem;white-space:nowrap}
.workspace-mode .topbar{min-width:0}
.workspace-mode #breadcrumb{min-width:0;overflow:hidden;text-overflow:ellipsis}
.workspace-mode #project-picker{flex:0 1 auto}
.workspace-mode .sidebar #project-picker .workspace-context-picker{display:grid;grid-template-columns:minmax(0,1fr);gap:.4rem;width:100%}
.workspace-mode .sidebar #project-picker .workspace-context-picker label{min-width:0;white-space:normal}
.workspace-mode .sidebar #project-picker .workspace-context-picker label>span{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto;white-space:normal}
.workspace-mode .sidebar #project-picker .workspace-context-picker select{width:100%;max-width:none;min-width:0}

/* The workspace is the scroll container for ordinary pages. Keep their title and
   primary actions in that same scroll context; workbenches manage their own panes. */
.workspace-mode:not(.workspace-conversation-mode) #main :is(.workspace-page-head,.workspace-page-header,.page-head){
  position:sticky;top:0;z-index:5;background:#f5f6f8;padding:.45rem 0;
}
.workspace-mode:not(.workspace-conversation-mode) #main :is(.workspace-page-head,.workspace-page-header,.page-head)>div{min-width:0}
.workspace-mode:not(.workspace-conversation-mode) #main :is(.workspace-page-head,.workspace-page-header,.page-head) :is(button,a,select){scroll-margin-top:1rem}

/* One frame for ordinary subject pages. Their content remains independently
   owned, but the title, context and actions use the same component and sizes. */
.workspace-mode:not(.workspace-conversation-mode) #main .panel-ordinary-page>.workspace-page-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;
  min-width:0;margin:0 0 1rem;padding:.4rem 0 .7rem;border-bottom:1px solid var(--panel-border);
}
.workspace-mode:not(.workspace-conversation-mode) #main .panel-ordinary-page>.workspace-page-head h1{
  margin:.15rem 0 .3rem;font-size:clamp(1.4rem,2vw,1.8rem);line-height:1.2;color:#1c2c40;
}
.workspace-mode:not(.workspace-conversation-mode) #main .panel-ordinary-page>.workspace-page-head p:not(.workspace-kicker){
  margin:0;color:var(--panel-muted);font-size:.86rem;line-height:1.4;
}
.workspace-mode:not(.workspace-conversation-mode) #main .panel-ordinary-page>.workspace-page-head .workspace-page-actions{
  display:flex;align-items:center;justify-content:flex-end;gap:.5rem;flex-wrap:wrap;flex:none;min-width:0;
}

/* A single L-page frame for registers and dispatchers. Subjects own pane
   contents; this element owns column geometry and the responsive transition. */
panel-page-layout{display:grid;align-items:start;gap:.8rem;min-width:0;min-height:0}
panel-page-layout[data-columns="3"]{grid-template-columns:minmax(205px,23%) minmax(0,1fr) minmax(220px,26%)}
panel-page-layout[data-columns="2"]{grid-template-columns:minmax(270px,32%) minmax(0,1fr)}
panel-page-layout>*{min-width:0}
@media(max-width:1280px){
  panel-page-layout[data-columns="3"]{grid-template-columns:minmax(205px,27%) minmax(0,1fr)}
  panel-page-layout[data-columns="3"]>*:nth-child(3){grid-column:1/-1}
}
@media(max-width:850px){panel-page-layout[data-columns="2"]{display:flex;flex-direction:column}}
@media(max-width:780px){
  panel-page-layout[data-columns="3"]{grid-template-columns:minmax(0,1fr)}
  panel-page-layout[data-columns="3"]>*:nth-child(3){grid-column:auto}
}

/* Catalog workspaces fill the space below the top bar. Their panes own vertical
   scrolling, so fixed viewport subtractions cannot clip the bottom on mobile. */
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > :is(.media-workspace,.template-workspace,.project-assortment-workspace,.content-library-workspace,.project-trash-workspace,.workspace-channels-page)){
  display:flex;flex-direction:column;height:var(--workspace-viewport-height,100dvh);overflow:hidden;
}
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > :is(.media-workspace,.template-workspace,.project-assortment-workspace,.content-library-workspace,.project-trash-workspace,.workspace-channels-page))>.topbar{flex:none}
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > :is(.media-workspace,.template-workspace,.project-assortment-workspace,.content-library-workspace,.project-trash-workspace,.workspace-channels-page))>#main{
  flex:1;min-height:0;overflow:hidden;
}
.workspace-mode:not(.workspace-conversation-mode) #main > :is(.media-workspace,.template-workspace,.project-assortment-workspace,.content-library-workspace,.project-trash-workspace,.workspace-channels-page){height:100%;min-height:0}

/* The operations list and detail own their scroll; derive available height
   from the real topbar instead of subtracting guessed pixels. */
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .workspace-jobs-page){
  display:flex;flex-direction:column;height:var(--workspace-viewport-height,100dvh);overflow:hidden;
}
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .workspace-jobs-page)>.topbar{flex:none}
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .workspace-jobs-page)>#main{
  flex:1;min-height:0;overflow:hidden;
}
.workspace-mode:not(.workspace-conversation-mode) #main>.workspace-jobs-page{height:100%;min-height:0}

/* The hidden CORE journal is another list/detail page. Keep both panes in the
   available shell without relying on a fixed viewport subtraction. */
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .core-journal-page){
  display:flex;flex-direction:column;height:var(--workspace-viewport-height,100dvh);overflow:hidden;
}
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .core-journal-page)>.topbar{flex:none}
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .core-journal-page)>#main{
  flex:1;min-height:0;overflow:hidden;
}
.workspace-mode:not(.workspace-conversation-mode) #main>.core-journal-page{
  display:flex;flex-direction:column;height:100%;min-height:0;
}
.workspace-mode:not(.workspace-conversation-mode) .core-journal-page>.core-journal-layout{
  flex:1;min-height:0;height:auto;
}
@media(max-width:760px){
  .workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .core-journal-page)>#main{overflow:auto}
  .workspace-mode:not(.workspace-conversation-mode) #main>.core-journal-page{display:block;height:auto;min-height:100%}
  .workspace-mode:not(.workspace-conversation-mode) .core-journal-page>.core-journal-layout{height:auto}
}

/* BOT scenarios use the ordinary page scroll. On narrow screens the block
   workspace otherwise grows with its content and scrolls the whole document. */
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .bot-workspace){
  display:flex;flex-direction:column;height:var(--workspace-viewport-height,100dvh);overflow:hidden;
}
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .bot-workspace)>.topbar{flex:none}
.workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .bot-workspace)>#main{
  flex:1;min-height:0;overflow:auto;
}

/* The variable workbench has three independent scroll panes on desktop. Let
   the shell size them below the actual topbar instead of subtracting a fixed
   number of pixels from the viewport. */
@media(min-width:1101px){
  .workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .variable-workspace){
    display:flex;flex-direction:column;height:var(--workspace-viewport-height,100dvh);overflow:hidden;
  }
  .workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .variable-workspace)>.topbar{flex:none}
  .workspace-mode:not(.workspace-conversation-mode) .workspace:has(#main > .variable-workspace)>#main{
    flex:1;min-height:0;overflow:hidden;
  }
  .workspace-mode:not(.workspace-conversation-mode) #main > .variable-workspace{height:100%;min-height:0}
}

@media (min-width:851px) and (max-width:1180px){
  .workspace-mode .app-shell,.workspace-conversation-mode .app-shell{grid-template-columns:244px minmax(0,1fr)}
  .workspace-mode .sidebar,.workspace-conversation-mode .sidebar{padding:.75rem .55rem}
  .workspace-mode .sidebar .brand,.workspace-conversation-mode .sidebar .brand{font-size:.88rem;padding:.2rem .35rem}
  .workspace-mode .sidebar .brand small,.workspace-conversation-mode .sidebar .brand small{font-size:.62rem}
  .workspace-mode .sidebar .workspace-nav-label,
  .workspace-conversation-mode .sidebar .workspace-nav-label{font-size:inherit}
}
@media (min-width:851px) and (max-width:950px){
  .workspace-mode #breadcrumb{display:none}
}
@media(max-width:850px){
  #client-back-toggle:not([hidden]){display:inline-grid;place-items:center;width:42px;height:42px;
    padding:0;border:1px solid #dce6f1;border-radius:9px;background:#fff;color:#2b66a2;
    font-size:2rem;line-height:1;text-decoration:none}
  .sidebar{width:min(290px,85vw)}
  .sidebar #navigation{margin:.8rem 0}
  .workspace-mode .topbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.75rem;row-gap:.35rem}
  .workspace-conversation-mode .topbar{height:auto;min-height:52px}
  .workspace-mode #breadcrumb{grid-column:2;grid-row:1}
  .workspace-mode .connection{grid-column:3;grid-row:1;margin-left:0}
  .workspace-mode .sidebar #project-picker{width:auto}
  .workspace-context-picker .workspace-context-note{display:none}
  .workspace-mode:not(.workspace-conversation-mode) #main :is(.workspace-page-head,.workspace-page-header,.page-head){
    flex-wrap:wrap;gap:.55rem;
  }
  .workspace-mode:not(.workspace-conversation-mode) #main .panel-ordinary-page>.workspace-page-head .workspace-page-actions{
    width:100%;justify-content:flex-start;
  }
}
@media(max-width:560px){
  .workspace-conversation-mode .topbar{height:auto;min-height:48px}
}
@media(prefers-reduced-motion:reduce){.workspace-nav-toggle .workspace-nav-chevron{transition:none}}

.panel-section-heading { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.panel-section-heading > div { min-width: 0; }
.panel-section-heading h1 { overflow-wrap: anywhere; }
.panel-heading-menu { display: none; }
.panel-heading-icon, .panel-heading-menu:not([hidden]) {
  place-items: center; flex: none; width: 36px; height: 36px; padding: 0;
  border: 1px solid #cadcf0; border-radius: 8px; background: #f3f7fd; color: #2b61a0;
}
.panel-heading-icon { display: inline-grid; }
.panel-heading-icon:hover, .panel-heading-menu:hover { background: #e5effb; }
.overview-priorities, .overview-directory { display: grid; gap: .65rem; min-width: 0; }
.overview-priorities { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.overview-priorities:not(:empty) { margin-bottom: .65rem; }
.overview-directory { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); }
.overview-section {
  display: grid; align-content: start; min-width: 0; padding: .65rem .8rem;
  border: 1px solid #dfe8f2; background: #fff; border-radius: 12px;
}
.overview-section[hidden] { display: none; }
.overview-section h2 { display: flex; align-items: center; gap: .45rem; font-size: .98rem; margin: 0 0 .32rem; color: #244e83; }
.overview-section h2 svg { flex: none; }
.overview-section > p { margin: .2rem 0 .45rem; }
.overview-section .management-related-link { margin: 0; padding-block: .27rem; }
.overview-action { border-color: #ead7bd; }
.overview-action h2 { color: #815922; }
@media (max-width: 850px) {
  .workspace:has(#main [data-panel-heading-menu]) > .topbar { display: none !important; }
  .panel-heading-menu:not([hidden]) { display: inline-grid; }
  .workspace-mode:not(.workspace-conversation-mode) #main .panel-ordinary-page > .workspace-page-head .workspace-page-actions:has(> .panel-heading-icon) {
    width: auto; margin-left: auto;
  }
  .workspace-mode:not(.workspace-conversation-mode) #main .panel-ordinary-page > .workspace-page-head {
    padding-block: .35rem; margin-bottom: .6rem; align-items: center;
  }
  .workspace-mode:not(.workspace-conversation-mode) #main .panel-ordinary-page > .workspace-page-head h1 {
    font-size: clamp(1rem, 4.3vw, 1.35rem); margin-bottom: .15rem;
  }
}

.workspace-area-picker{font-size:.8rem}
.workspace-area-level{min-width:0;border-bottom:1px solid var(--panel-line,#d5e2f4)}
.workspace-area-level>summary{display:flex;justify-content:space-between;gap:.4rem;align-items:center;cursor:pointer;padding:.25rem;color:#e5eff4}
.workspace-area-level>summary>span:last-child{display:inline-flex;align-items:center;gap:.3rem;color:#b9d5e1}
.workspace-area-level[open]>summary svg{transform:rotate(180deg)}
.workspace-area-options{display:grid;gap:.18rem;max-height:min(12rem,32dvh);overflow:auto;padding:.15rem .25rem .35rem;color:#e5eff4}
.workspace-mode .sidebar #project-picker .workspace-area-options label{display:flex;align-items:center;gap:.4rem;font-size:inherit;color:#e5eff4;cursor:pointer;min-height:1.75rem}
.workspace-mode .sidebar #project-picker .workspace-area-options input{flex:none;inline-size:1rem;block-size:1rem;margin:0;accent-color:var(--panel-accent,#347bd0)}
.workspace-area-options label>span{overflow-wrap:anywhere}
.workspace-area-actions{display:flex;justify-content:flex-end;gap:.3rem}
.workspace-area-actions button{min-height:1.9rem;padding:.25rem .5rem;font-size:inherit}
.workspace-area-actions [data-area-apply]{background:var(--panel-accent,#347bd0);border-color:var(--panel-accent,#347bd0);color:white}
