/* Workspace chrome only. Document/PDF/signature renderers retain their own styles. */
#workspace-shell {
  --workspace-surface: #ffffff;
  --workspace-subtle: #f5f7f8;
  --workspace-border: #d6dfe4;
  --workspace-text: #233241;
  --workspace-muted: #62717e;
  --workspace-accent: #176d65;
  --workspace-focus: #2871b8;
  letter-spacing: 0;
  background: #f7f8f9;
}
#workspace-shell :is(.primary-action, .secondary-action, .quiet-action, .icon-button, .calendar-today) {
  min-height: 34px;
  border-radius: 4px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0;
  transform: none;
}
#workspace-shell :is(.primary-action, .secondary-action, .quiet-action) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#workspace-shell .primary-action { border: 1px solid #176d65; background: #176d65; color: #fff; }
#workspace-shell .primary-action:hover:not(:disabled) { border-color: #11564f; background: #11564f; }
#workspace-shell :is(.secondary-action, .icon-button, .calendar-today) { border: 1px solid #bfccd4; background: #fff; color: #304759; }
#workspace-shell :is(.secondary-action, .icon-button, .calendar-today):hover:not(:disabled) { border-color: #7f9caa; background: #edf4f4; }
#workspace-shell .quiet-action { border: 1px solid transparent; background: transparent; color: #466174; }
#workspace-shell .quiet-action:hover:not(:disabled) { background: #edf2f5; }
#workspace-shell :is(button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--workspace-focus); outline-offset: 2px; }
#workspace-shell :is(button, input, select, textarea):disabled { cursor: not-allowed; opacity: .55; }
#workspace-shell .ui-icon { flex: 0 0 auto; width: 18px; height: 18px; }
#workspace-shell .icon-button { flex: 0 0 auto; width: 34px; height: 34px; padding: 7px; }
#workspace-shell .danger-button { color: #a03737; }
#workspace-shell .topbar { min-height: 82px; gap: 16px; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--workspace-border); }
.workspace-header-context { flex-wrap: wrap; gap: 12px 20px; }
.workspace-header-copy { min-width: 0; }
#workspace-shell .workspace-header-copy h1 { font-size: 21px; line-height: 1.3; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.workspace-header-copy .eyebrow { color: #7a651c; font-size: 10px; letter-spacing: 0; }
.workspace-path { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; color: var(--workspace-muted); font-size: 11px; }
.workspace-path button { padding: 0; border: 0; background: transparent; color: #466174; font: inherit; }
.workspace-path button:hover { color: #176d65; text-decoration: underline; }
.workspace-path [aria-current] { color: #233241; }
.workspace-path-separator { color: #9aa9b4; }
.notification-source-error { display: grid; gap: 7px; padding: 12px; border-bottom: 1px solid #e2d3b2; background: #fff8e9; color: #735b26; font-size: 12px; overflow-wrap: anywhere; }
.notification-source-error button { justify-self: start; }
#workspace-shell .view { padding: 22px 24px 36px; }
#workspace-shell :is(.admin-page, .calendar-page) { border: 0; border-radius: 0; box-shadow: none; padding: 0; background: transparent; }
#workspace-shell .calendar-page { max-width: none; }
#workspace-shell .sidebar { min-width: 0; padding: 18px 12px 12px; }
#workspace-shell .brand { gap: 9px; padding: 2px 8px 20px; }
#workspace-shell .brand-symbol { width: 34px; height: 40px; }
#workspace-shell .brand-lockup img { max-width: 132px; }
#workspace-shell .brand-lockup strong { letter-spacing: 0; }
#workspace-shell .primary-nav { display: grid; gap: 15px; }
[data-nav-group] { display: grid; min-width: 0; gap: 2px; }
[data-nav-group] > :is(h2, h3, p, .sidebar-section-label) {
  margin: 0 8px 5px;
  color: #9faebb;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}
#workspace-shell .nav-item {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  color: #d1d9e1;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
}
#workspace-shell .nav-item > [data-ui-icon] { display: flex; flex: 0 0 18px; width: 18px; color: #d9b744; }
#workspace-shell .nav-item:hover { background: #20344b; color: #fff; }
#workspace-shell .nav-item.is-active { background: #2c465c; color: #fff; box-shadow: inset 3px 0 #d9b744; }
#workspace-shell .sidebar :is(button, a):focus-visible { outline-color: #a6d6ed; }
#workspace-shell .nav-state { width: auto; padding: 2px 4px; margin-left: auto; color: #ffda7b; font-size: 9px; }
#workspace-shell .nav-count { width: auto; min-width: 20px; margin-left: auto; padding: 1px 5px; border-radius: 4px; background: #314d62; color: #fff; font-size: 10px; text-align: center; }
#workspace-shell .sidebar-teams { margin: 8px 0 0; padding: 9px 0 0; border-top: 1px solid #3a4c5b; }
#workspace-shell .sidebar-team-button { min-height: 35px; padding: 7px 7px; }
#workspace-shell .sidebar-team-button b { white-space: normal; overflow-wrap: anywhere; }
#workspace-shell .sidebar-team-button small { max-width: 72px; white-space: normal; text-align: right; }
.sidebar-department { min-width: 0; }
.sidebar-department + .sidebar-department { margin-top: 5px; }
.sidebar-department-toggle { display: grid; width: 100%; min-width: 0; grid-template-columns: 16px minmax(0, 1fr) 16px; align-items: center; gap: 7px; min-height: 36px; padding: 7px; border: 0; border-radius: 4px; background: transparent; color: #dae3e9; text-align: left; }
.sidebar-department-toggle strong { font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.sidebar-department-toggle:hover, .sidebar-department-toggle.is-active { background: #243d50; color: #fff; }
.sidebar-department-toggle[aria-expanded="true"] .sidebar-team-chevron { transform: rotate(90deg); }
.sidebar-department-content { min-width: 0; margin-left: 8px; border-left: 1px solid #415361; padding: 1px 0 3px 7px; }
.sidebar-scope-label { margin: 9px 7px 4px; color: #a6b4bf; font-size: 10px; font-weight: 600; }
.sidebar-department-modules { display: grid; gap: 1px; }
.sidebar-department-modules button { display: flex; min-width: 0; width: 100%; align-items: center; gap: 7px; min-height: 32px; padding: 6px 8px; border: 0; border-radius: 3px; background: transparent; color: #bdcbd6; font-size: 11px; text-align: left; }
.sidebar-department-modules button:hover, .sidebar-department-modules [aria-current="page"] { background: #2b4558; color: #fff; }
.sidebar-department-modules .ui-icon { width: 15px; height: 15px; }
.sidebar-unassigned-teams { border-top: 1px solid #3a4c5b; margin-top: 9px; padding-top: 2px; }
.sidebar-navigation-status { display: grid; gap: 6px; margin: 7px; color: #c4d2dc; font-size: 11px; }
.sidebar-navigation-status button { justify-self: start; border: 1px solid #6b8393; border-radius: 3px; background: transparent; padding: 4px 7px; color: #fff; font: inherit; }
#workspace-shell .workspace-navigation-toggle, #workspace-shell [data-secondary-nav-toggle] { display: none; }
#workspace-context-actions:empty { display: none; }

/* Explorer navigation is docked to the application boundary, not floating. */
#workspace-shell #documents-view { padding: 0; }
#documents-view .document-layout { min-height: calc(100dvh - 82px); border: 0; border-radius: 0; box-shadow: none; background: #fff; }
#documents-view .file-tree { align-self: start; border-right: 0; padding: 18px 12px; background: #f9fbfc; }
#documents-view .tree-top { flex-wrap: wrap; gap: 8px; padding: 0 0 12px; border-bottom: 1px solid var(--workspace-border); }
#documents-view .tree-top .eyebrow { font-size: 10px; letter-spacing: 0; }
#documents-view .tree-actions { display: flex; gap: 4px; flex-wrap: nowrap; }
#documents-view .tree-actions .icon-button { width: 30px; height: 30px; min-height: 30px; padding: 6px; }
#documents-view .tree-item { border-radius: 3px; padding: 9px 8px; font-size: 12px; }
#documents-view .tree-item.is-selected { background: #e5f0ef; box-shadow: inset 3px 0 #176d65; }
#documents-view .tree-item small { color: #60727e; line-height: 1.4; }
#documents-view .reader { padding: 24px 28px 36px; }
#documents-view .reader-header { border-bottom: 1px solid var(--workspace-border); padding-bottom: 18px; }
#documents-view .reader-header h2 { font-size: 25px; line-height: 1.35; }
#documents-view .reader-actions { align-items: center; flex-wrap: wrap; gap: 6px 12px; }
#documents-view .reader-body { width: 100%; max-width: 1100px; }
#documents-view .reader-actions .text-button { min-height: 32px; border-bottom: 0; padding: 5px 4px; }
.attachment-preview-stack { gap: 0; padding: 0; border: 1px solid #d6dfe4; border-radius: 4px; background: #f5f7f8; }
.attachment-preview-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #d6dfe4; background: #fff; }
.attachment-preview-toolbar label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; color: #405568; font-size: 11px; font-weight: 650; }
.attachment-preview-toolbar select { width: min(100%, 360px); max-width: 100%; min-height: 34px; border: 1px solid #bfccd4; border-radius: 4px; padding: 6px 8px; background: #fff; color: #233241; font: inherit; }
.attachment-preview-toolbar > span { color: #62717e; font-size: 11px; }
.attachment-preview-stack .attachment-document-preview { min-width: 0; padding: 0; border: 0; }
.attachment-preview-stack .document-reader-loading { min-height: 320px; padding: 20px; }
.attachment-preview-stack .reader-state { margin: 16px; border-left-color: #bf7747; background: #fff8ed; }
.attachment-preview-stack .detail-command-group { display: flex; gap: 7px; flex-wrap: wrap; }

/* The date and period commands remain one local toolbar. */
#workspace-shell .calendar-toolbar { justify-content: flex-start; align-items: center; flex-direction: row; flex-wrap: wrap; gap: 12px 18px; border-bottom: 1px solid var(--workspace-border); padding: 0 0 14px; }
#workspace-shell .calendar-toolbar h2 { margin: 0; font-size: 22px; }
#workspace-shell .calendar-controls { flex: 0 0 auto; display: inline-flex; width: auto; align-items: center; gap: 5px; }
#workspace-shell .calendar-today { min-width: 56px; padding: 6px 10px; }
#workspace-shell .calendar-views { display: inline-flex; max-width: 100%; gap: 0; border: 1px solid #bfccd4; border-radius: 4px; overflow: hidden; }
#workspace-shell .calendar-views button { min-height: 32px; border: 0; border-right: 1px solid #bfccd4; background: #fff; padding: 5px 12px; color: #4a6170; }
#workspace-shell .calendar-views button:last-child { border-right: 0; }
#workspace-shell .calendar-views button.is-active { background: #e3efed; color: #155c56; }
.team-calendar-toolbar { justify-content: flex-start; gap: 14px; }
.team-calendar-toolbar > div { display: flex; align-items: center; gap: 5px; }
.dept-calendar-toolbar { justify-content: flex-start; gap: 12px; }
.dept-calendar-toolbar > .calendar-views { margin-left: auto; }

.permission-bulk-toolbar { display: flex; grid-column: 1 / -1; min-width: 0; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 8px; border-bottom: 1px solid #dce4e8; padding: 7px 0 10px; }
.permission-bulk-toolbar > label { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: #264353; font-size: 12px; font-weight: 650; }
.permission-bulk-toolbar input { flex: 0 0 16px; width: 16px; height: 16px; margin: 0; accent-color: #176d65; }
.permission-bulk-toolbar > [data-permission-selection-count] { color: #62717e; font-size: 11px; font-variant-numeric: tabular-nums; }
.permission-bulk-toolbar > button { margin-left: auto; }
.org-caps > .permission-bulk-toolbar { grid-column: 1 / -1; }
#workspace-shell .org-caps { align-items: start; }
#workspace-shell .org-check { display: flex; align-items: flex-start; gap: 8px; min-height: 32px; padding: 5px 2px; overflow-wrap: anywhere; }
#workspace-shell .org-check input { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; accent-color: #176d65; }
#workspace-shell .admin-tabs { overflow-x: auto; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid #d6dfe4; }
#workspace-shell .admin-tabs button { flex: 0 0 auto; border-bottom-color: transparent; color: #62717e; }
#workspace-shell .admin-tabs button.is-active { border-bottom-color: #176d65; background: #eaf3f1; color: #155c56; }
#workspace-shell .control-split { min-width: 0; gap: 0; border-top: 1px solid #d6dfe4; }
#workspace-shell .control-master-list { padding-right: 14px; border-right: 1px solid #d6dfe4; }
#workspace-shell .control-detail { min-width: 0; padding-left: 20px; }

@media (min-width: 851px) {
  #workspace-shell .sidebar { position: sticky; top: 0; max-height: 100dvh; min-height: 100dvh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #577184 transparent; }
  #documents-view .file-tree { position: sticky; top: 0; max-height: calc(100dvh - 82px); min-height: calc(100dvh - 82px); overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 1100px) and (min-width: 851px) {
  #workspace-shell .topbar { gap: 10px; padding-inline: 18px; }
  #workspace-shell .top-actions { gap: 5px; }
  #workspace-shell .profile-button b { display: none; }
  #documents-view .reader { padding-inline: 20px; }
}
@media (max-width: 850px) {
  #workspace-shell { grid-template-rows: auto minmax(0, 1fr); align-content: start; }
  #workspace-shell .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: auto; padding: 10px 14px; }
  #workspace-shell .brand { padding: 0; gap: 8px; }
  #workspace-shell .brand-symbol { width: 26px; height: 32px; }
  #workspace-shell .brand-lockup img { width: 112px; max-width: 100%; }
  #workspace-shell .brand-lockup strong { font-size: 8px; }
  #workspace-shell .workspace-navigation-toggle { display: grid; border-color: #6b8393; background: transparent; color: #fff; }
  #workspace-shell .workspace-navigation-toggle:hover:not(:disabled) { background: #274459; color: #fff; }
  #workspace-shell .primary-nav { display: none; grid-template-columns: minmax(0, 1fr); grid-column: 1 / -1; max-height: calc(100dvh - 84px); overflow-y: auto; padding-top: 18px; gap: 18px; }
  #workspace-shell .sidebar[data-nav-open="true"] .primary-nav { display: grid; }
  #workspace-shell .sidebar-teams { display: block; }
  #workspace-shell .sidebar :is(.source-panel, .sidebar-bottom, .sidebar-resize-handle) { display: none; }
  #workspace-shell .nav-item { min-height: 40px; }
  #workspace-shell .topbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; min-height: 76px; align-items: start; padding: 12px 14px; gap: 10px; }
  #workspace-shell .workspace-header-context { min-width: 0; gap: 8px; }
  #workspace-shell .workspace-header-copy h1 { font-size: 19px; }
  #workspace-shell .top-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 132px; gap: 5px; }
  #workspace-shell .icon-button { width: 36px; height: 36px; min-height: 36px; }
  #workspace-shell .profile-button { min-height: 36px; }
  #workspace-shell .profile-button b { display: none; }
  #workspace-shell .view { padding: 16px 14px 26px; }
  #workspace-shell [data-secondary-nav-toggle]:not([hidden]) { display: inline-flex; margin: 10px 14px; }
  #documents-view .document-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  #documents-view .file-tree { display: none; width: 100%; max-height: 52dvh; overflow-y: auto; padding: 14px; border-bottom: 1px solid #d6dfe4; }
  #documents-view[data-secondary-nav-open="true"] .file-tree { display: block; }
  #documents-view .reader { padding: 20px 14px 30px; }
  #documents-view .reader-header h2 { font-size: 22px; }
  #documents-view .tree-resizer { display: none; }
  .attachment-preview-toolbar { align-items: flex-start; padding: 10px; }
  .attachment-preview-toolbar label { flex: 1 1 100%; }
  .attachment-preview-toolbar select { width: 100%; }
  #workspace-shell .calendar-toolbar { gap: 10px; }
  #workspace-shell .calendar-toolbar h2 { font-size: 20px; }
  #workspace-shell .calendar-controls { gap: 4px; }
  #workspace-shell .calendar-controls .icon-button { width: 32px; height: 34px; min-height: 34px; }
  #workspace-shell .calendar-today { min-width: 48px; }
  #workspace-shell .calendar-writing { flex-direction: row; flex-wrap: wrap; }
  #workspace-shell .calendar-views button { padding-inline: 10px; }
  #workspace-shell .control-master-list { max-height: 250px; overflow-y: auto; padding: 0 0 12px; border-right: 0; border-bottom: 1px solid #d6dfe4; }
  #workspace-shell .control-detail { padding: 16px 0 0; }
  .permission-bulk-toolbar { gap: 8px; }
  .permission-bulk-toolbar > button { margin-left: 0; }
  #workspace-shell .org-caps { grid-template-columns: minmax(0, 1fr); }
  .dept-calendar-toolbar > .calendar-views { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #workspace-shell :is(button, a, .ui-icon) { transition: none; scroll-behavior: auto; }
}
