/* 0068: shared workspace presentation, built from the verified supervisor primitives. */
body.workspace-theme {
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: var(--font-body);
  line-height: 1.5;
  min-height: 100dvh;
}
.mgr-line-icon {
  display: none;
}
.workspace-theme .mgr-line-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  vertical-align: middle;
  color: currentColor;
}
.workspace-theme #workspace {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 216px minmax(0, 1fr);
}
.workspace-theme .app-shell {
  margin-left: 0;
  min-width: 0;
  background: var(--bg-base);
}
.workspace-theme .sidebar {
  position: sticky;
  top: 0;
  width: auto;
  height: 100dvh;
  background: var(--bg-sidebar);
  border-color: var(--border-subtle);
  padding: var(--mgr-s6) var(--mgr-s3);
}
.workspace-theme .brand {
  margin-bottom: var(--mgr-s8);
  gap: var(--mgr-s3);
}
.workspace-theme .brand-mark {
  background: var(--accent-blue-soft);
  color: var(--accent-blue-strong);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  width: 32px;
  height: 32px;
  box-shadow: var(--glow-blue);
}
.workspace-theme .brand small {
  color: var(--text-muted);
  font-weight: 400;
}
.workspace-theme .nav-button {
  display: flex;
  align-items: center;
  gap: var(--mgr-s3);
  color: var(--text-secondary);
  border: 1px solid transparent;
  font-weight: 400;
  min-height: 42px;
  transition:
    background var(--transition-ui),
    color var(--transition-ui);
}
.workspace-theme .nav-button .mgr-line-icon {
  color: var(--text-muted);
}
.workspace-theme .nav-button:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.workspace-theme .nav-button[aria-current="page"] {
  background: var(--accent-blue-soft);
  color: var(--accent-blue-strong);
  border-color: var(--border-default);
  box-shadow: inset 2px 0 var(--accent-blue);
  font-weight: 550;
}
.workspace-theme .nav-button[aria-current="page"] .mgr-line-icon {
  color: var(--accent-blue);
}
.workspace-theme .sidebar-bottom {
  padding-bottom: 86px;
  color: var(--text-muted);
}
.workspace-theme .app-header {
  background: var(--bg-base);
  border-bottom-color: var(--border-subtle);
  min-height: 56px;
}
.workspace-theme .account-controls > button {
  color: var(--text-secondary);
}
.workspace-theme .account-controls > button:hover {
  background: var(--bg-hover);
}
.workspace-theme #breadcrumb {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--mgr-s3);
}
.workspace-theme #breadcrumb::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-blue);
}
.workspace-theme main {
  padding: var(--mgr-s6);
  max-width: 1840px;
}
.workspace-theme .page-heading {
  margin-bottom: var(--mgr-s6);
  gap: var(--mgr-s4);
}
.workspace-theme h1 {
  color: var(--text-primary);
  font-size: var(--font-title);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--mgr-s1);
}
.workspace-theme h2 {
  font-size: var(--font-section);
  font-weight: 550;
}
.workspace-theme .page-heading p {
  color: var(--text-muted);
}
.workspace-theme .mgr-updated {
  color: var(--text-muted);
}
.workspace-theme :is(button, summary, input, select, textarea) {
  transition:
    background-color var(--transition-ui),
    border-color var(--transition-ui),
    color var(--transition-ui);
}
.workspace-theme :is(button, summary, input, select, textarea, a):focus-visible,
.workspace-theme :is(input, select, textarea):focus {
  outline: 2px solid var(--border-highlight);
  outline-offset: 2px;
  border-color: var(--border-highlight);
}
.workspace-theme :is(input, select, textarea) {
  background: var(--bg-base);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-s);
}
.workspace-theme input::placeholder,
.workspace-theme textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.workspace-theme input[type="checkbox"] {
  accent-color: var(--accent-blue);
}
.workspace-theme button {
  color: var(--text-on-accent);
}
.workspace-theme button:disabled {
  opacity: 0.5;
}
.workspace-theme .mgr-button {
  color: var(--text-primary);
  border-radius: var(--radius-s);
}
.workspace-theme :is(.mgr-button-secondary, .secondary) {
  background: var(--bg-surface-raised);
  border-color: var(--border-default);
  color: var(--text-primary);
}
.workspace-theme :is(.mgr-button-ghost, .quiet) {
  color: var(--text-secondary);
  background: transparent;
}
.workspace-theme :is(.mgr-button-link, .link-button) {
  color: var(--accent-blue);
  background: transparent;
}
.workspace-theme .mgr-button:hover,
.workspace-theme :is(.secondary, .quiet, .link-button):hover {
  filter: none;
  background: var(--bg-hover);
  color: var(--text-primary);
}
.workspace-theme .mgr-button-primary {
  color: var(--text-on-accent);
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  font-weight: 600;
  box-shadow: var(--glow-blue);
}
.workspace-theme .mgr-button-primary:hover {
  background: var(--accent-blue-strong);
  color: var(--text-on-accent);
}
.workspace-theme :is(.mgr-button-danger, .danger) {
  color: var(--danger);
  background: transparent;
}
.workspace-theme :is(.mgr-button-danger, .danger):hover {
  background: var(--danger-soft);
}
.workspace-theme .mgr-section,
.workspace-theme .mgr-table-wrap {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-soft);
}
.workspace-theme .mgr-section-head {
  min-height: 52px;
  padding: var(--mgr-s3) var(--mgr-s4);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-m) var(--radius-m) 0 0;
}
.workspace-theme .mgr-section-head h2 {
  display: flex;
  align-items: center;
  gap: var(--mgr-s2);
}
.workspace-theme .mgr-section-head h2 .mgr-line-icon {
  color: var(--accent-blue);
  width: 16px;
  height: 16px;
}
.workspace-theme .mgr-panel-work {
  border-top-color: var(--border-highlight);
}
.workspace-theme .mgr-home-sales .mgr-panel-work > .mgr-section-head {
  background: var(--bg-surface-raised);
  box-shadow: var(--glow-blue);
}
.workspace-theme .mgr-panel-attention > .mgr-section-head h2 .mgr-line-icon {
  color: var(--accent-gold);
}
.workspace-theme .manager-home {
  gap: var(--mgr-s4);
}
.workspace-theme .mgr-home-grid {
  gap: var(--mgr-s4);
  grid-template-columns: minmax(0, 1.85fr) minmax(292px, 1fr);
}
.workspace-theme .mgr-home-sales .mgr-home-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
}
.workspace-theme .mgr-home-side {
  gap: var(--mgr-s4);
}
.workspace-theme .mgr-home-grid.mgr-home-full {
  grid-template-columns: minmax(0, 1fr);
}
.workspace-theme .manager-work-row {
  min-height: 72px;
  padding: var(--mgr-s3) var(--mgr-s4);
  background: var(--bg-surface);
  gap: var(--mgr-s3);
}
.workspace-theme .manager-work-row:hover,
.workspace-theme .mgr-table tbody tr:hover {
  background: var(--bg-hover);
}
.workspace-theme .manager-work-row.is-selected,
.workspace-theme .mgr-table tr.is-selected {
  background: var(--bg-selected);
  box-shadow: inset 2px 0 var(--accent-blue);
}
.workspace-theme .mgr-object > .mgr-button {
  color: var(--text-primary);
  font-weight: 550;
}
.workspace-theme
  :is(.mgr-object small, .mgr-sub, .mgr-row-state small, .mgr-time) {
  color: var(--text-muted);
}
.workspace-theme :is(.mgr-mono, .mgr-time, .manager-count strong) {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.workspace-theme .mgr-status {
  border-radius: var(--radius-s);
  padding: 3px 7px;
  font-weight: 450;
}
.workspace-theme .mgr-status-neutral {
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
}
.workspace-theme .mgr-status-info {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}
.workspace-theme .mgr-status-success {
  background: var(--success-soft);
  color: var(--success);
}
.workspace-theme .mgr-status-attention {
  background: var(--warning-soft);
  color: var(--warning);
}
.workspace-theme .mgr-status-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.workspace-theme .mgr-status-muted {
  background: var(--bg-base);
  color: var(--text-muted);
}
.workspace-theme .mgr-tabs {
  gap: var(--mgr-s6);
  margin-bottom: var(--mgr-s4);
}
.workspace-theme .mgr-panel-work .mgr-tabs {
  padding: 0 var(--mgr-s4);
  margin-bottom: 0;
}
.workspace-theme .mgr-button-tab {
  color: var(--text-muted);
  min-height: 44px;
}
.workspace-theme .mgr-button-tab:hover {
  background: transparent;
  color: var(--text-primary);
}
.workspace-theme .mgr-button-tab[aria-selected="true"] {
  color: var(--accent-blue-strong);
  border-bottom-color: var(--accent-blue);
}
.workspace-theme .mgr-stats {
  padding: var(--mgr-s2) var(--mgr-s4);
  gap: var(--mgr-s1) var(--mgr-s4);
}
.workspace-theme .mgr-panel-members > div:has(> .mgr-stats) {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
}
.workspace-theme .manager-count {
  color: var(--text-muted);
}
.workspace-theme .manager-count strong {
  color: var(--text-primary);
  font-weight: 550;
}
.workspace-theme .manager-count:hover {
  color: var(--accent-blue);
  background: transparent;
}
.workspace-theme .mgr-summary {
  border-top: 0;
  padding: var(--mgr-s1) 0;
}
.workspace-theme .mgr-table th {
  background: var(--bg-surface-raised);
  color: var(--text-muted);
  padding: var(--mgr-s3);
  font-weight: 450;
}
.workspace-theme .mgr-table td {
  padding: var(--mgr-s3);
  color: var(--text-primary);
  border-bottom-color: var(--border-subtle);
}
.workspace-theme .mgr-table {
  background: transparent;
}
.workspace-theme .mgr-table-wrap {
  overflow: visible;
}
.workspace-theme
  .mgr-home-host
  .mgr-members-table
  .mgr-table
  :is(th, td):last-child {
  width: 144px;
}
.workspace-theme .mgr-members-table .mgr-table :is(th, td):first-child {
  width: 22%;
}
.workspace-theme
  .mgr-home-sales
  .mgr-home-side
  .mgr-table
  :is(th, td):first-child {
  width: 35%;
}
.workspace-theme .mgr-home-sales .mgr-table :is(th, td):not(:first-child) {
  width: auto;
}
.workspace-theme .mgr-home-side .manager-work-row {
  padding: var(--mgr-s3);
}
.workspace-theme .mgr-pending-heading {
  padding: var(--mgr-s3) var(--mgr-s3) var(--mgr-s2);
}
.workspace-theme .mgr-filter-area {
  margin-bottom: var(--mgr-s4);
}
.workspace-theme .mgr-filter > input {
  max-width: 440px;
}
.workspace-theme .mgr-filter-more > summary {
  color: var(--text-secondary);
}
.workspace-theme :is(.mgr-filter-fields, .mgr-menu-items, .mgr-user-items) {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  box-shadow: var(--shadow-elevated);
  border-radius: var(--radius-m);
}
.workspace-theme .mgr-menu > summary {
  color: var(--text-muted);
}
.workspace-theme .mgr-menu[open] > summary,
.workspace-theme .mgr-menu > summary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.workspace-theme .mgr-button-chip {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}
.workspace-theme .mgr-empty {
  min-height: 64px;
  color: var(--text-muted);
}
.workspace-theme .mgr-pager {
  border-top: 0;
  color: var(--text-muted);
}
.workspace-theme .mgr-skeleton > div {
  background: var(--bg-surface);
}
.workspace-theme .mgr-skeleton span {
  background: var(--bg-surface-raised);
}
.workspace-theme .mgr-user-menu {
  border-color: var(--border-subtle);
}
.workspace-theme .mgr-avatar {
  background: var(--accent-blue-soft);
  color: var(--accent-blue-strong);
  border: 1px solid var(--border-default);
}
.workspace-theme :is(.mgr-hint, .mgr-inline-alert) {
  color: var(--warning);
}
.workspace-theme .mgr-inline-alert {
  background: var(--warning-soft);
}
.workspace-theme :is(.error, #workspace-error) {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-soft);
}
.workspace-theme #notice {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-soft);
}
.workspace-theme #editor {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-elevated);
}
.workspace-theme #editor::backdrop {
  background: var(--overlay);
}
.workspace-theme #editor.mgr-drawer {
  background: var(--bg-surface-raised);
  box-shadow: var(--shadow-elevated);
  border-left: 1px solid var(--border-default);
}
.workspace-theme #editor .dialog-head {
  background: var(--bg-surface-raised);
  border-color: var(--border-subtle);
}
.workspace-theme
  #editor
  :is(.summary, .panel, .mgr-detail-context, .table-wrap) {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: none;
}
.workspace-theme #editor :is(table, td) {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.workspace-theme #editor th {
  background: var(--bg-surface-raised);
  color: var(--text-muted);
}
.workspace-theme #editor .mgr-detail-context {
  border-left: 2px solid var(--border-highlight);
}
.workspace-theme #editor .mgr-detail-actions {
  background: var(--surface-glass);
  backdrop-filter: blur(6px);
  border-color: var(--border-default);
}
.workspace-theme #editor .actions {
  border-color: var(--border-subtle);
}
.workspace-theme #editor :is(.toolbar, .empty, .tab-button) {
  color: var(--text-secondary);
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  border-radius: var(--radius-m);
}
.workspace-theme #editor .toolbar {
  padding: var(--mgr-s3);
  margin-bottom: var(--mgr-s4);
}
.workspace-theme #editor .tab-button[aria-selected="true"] {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-color: var(--border-highlight);
}
.workspace-theme #editor .badge {
  color: var(--success);
  background: var(--success-soft);
  border-color: transparent;
}
.workspace-theme #editor .badge.inactive {
  color: var(--text-muted);
  background: var(--bg-base);
}
.workspace-theme #editor .badge.warning {
  color: var(--warning);
  background: var(--warning-soft);
}
.workspace-theme .mgr-user-items {
  background: var(--surface-glass);
  backdrop-filter: blur(6px);
}
/* The existing conversation can remain floating while a pilot page is open. */
.workspace-theme #conversation-panel {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-elevated);
}
.workspace-theme
  #conversation-panel
  :is(.chat-floating-header, .chat-composer) {
  border-color: var(--border-subtle);
}
.workspace-theme
  #conversation-panel
  :is(.chat-messages, .chat-composer textarea) {
  background: var(--bg-base);
  color: var(--text-primary);
}
.workspace-theme
  #conversation-panel
  :is(.chat-message, .chat-composer, .conversation-emoji) {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: none;
}
.workspace-theme
  #conversation-panel
  :is(.chat-message.own, .conversation-context button) {
  background: var(--accent-blue-soft);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.workspace-theme
  #conversation-panel
  :is(.conversation-task-card, .conversation-message-avatar) {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.workspace-theme #conversation-panel .own .conversation-message-avatar {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}
.workspace-theme
  #conversation-panel
  :is(.small, small, #conversation-status, .conversation-tools button) {
  color: var(--text-secondary);
}
.workspace-theme #conversation-panel .conversation-tools button:hover {
  background: var(--bg-hover);
}
.workspace-theme #conversation-panel .conversation-upload {
  background: var(--warning-soft);
  color: var(--warning);
}
.workspace-theme #manager-mobile-nav {
  background: var(--bg-sidebar);
  border-color: var(--border-default);
}
.workspace-theme #manager-mobile-nav [aria-current="page"] {
  background: var(--accent-blue-soft);
  color: var(--accent-blue-strong);
}
.workspace-theme ::selection {
  background: var(--bg-selected);
  color: var(--text-primary);
}
.workspace-theme {
  scrollbar-color: var(--border-default) var(--bg-base);
}
@media (min-width: 761px) {
  .workspace-theme .mgr-user-menu {
    position: fixed;
    left: var(--mgr-s4);
    bottom: var(--mgr-s4);
    width: 184px;
    padding: var(--mgr-s3) 0 0;
    border: 0;
    border-top: 1px solid var(--border-subtle);
    z-index: 31;
  }
  .workspace-theme .mgr-user-menu > summary {
    gap: var(--mgr-s2);
  }
  .workspace-theme .mgr-user-menu #greeting {
    max-width: 148px;
    color: var(--text-secondary);
  }
  .workspace-theme .mgr-user-items {
    inset: auto auto calc(100% + 12px) 0;
    min-width: 248px;
  }
}
@media (max-width: 1150px) {
  .workspace-theme #workspace {
    grid-template-columns: 184px minmax(0, 1fr);
  }
  .workspace-theme .mgr-home-grid,
  .workspace-theme .mgr-home-sales .mgr-home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-theme .mgr-home-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workspace-theme .mgr-user-menu {
    width: 152px;
  }
}
@media (max-width: 760px) {
  .workspace-theme #workspace {
    display: block;
  }
  .workspace-theme main {
    padding: var(--mgr-s4) var(--mgr-s3) 88px;
  }
  .workspace-theme .page-heading {
    margin-bottom: var(--mgr-s4);
  }
  .workspace-theme h1 {
    font-size: 21px;
  }
  .workspace-theme .mgr-home-side {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-theme .mgr-user-menu {
    position: relative;
    width: auto;
  }
  .workspace-theme .mgr-filter > input {
    max-width: none;
  }
  .workspace-theme .mgr-filter-fields {
    border-radius: var(--radius-m) var(--radius-m) 0 0;
  }
  .workspace-theme .mgr-table td {
    padding: var(--mgr-s1) 0;
  }
  .workspace-theme .mgr-table td:first-child {
    padding-bottom: var(--mgr-s2);
  }
  .workspace-theme .mgr-section-head {
    min-height: 48px;
    padding: var(--mgr-s3);
  }
  .workspace-theme .manager-work-row {
    padding: var(--mgr-s3);
  }
  .workspace-theme #editor.mgr-drawer {
    border: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-theme :is(button, summary, input, select, textarea) {
    transition: none;
  }
}

/* Global shell and common primitives: one hierarchy for every role. */
.workspace-theme {
  font-variant-numeric: tabular-nums;
}
.workspace-theme #workspace {
  align-items: start;
}
.workspace-theme .sidebar {
  overflow: hidden;
  padding-bottom: 100px;
}
.workspace-theme .sidebar nav {
  min-height: 0;
  overflow-y: auto;
  flex: 1;
  gap: 4px;
  padding-bottom: 16px;
}
.workspace-theme .sidebar-bottom {
  flex: none;
  margin-top: 12px;
  padding: 8px 8px 0;
}
.workspace-theme .sidebar-bottom .live-dot {
  display: none;
}
.workspace-theme .brand {
  color: var(--text-primary);
  font-size: 14px;
  padding: 0 8px;
  margin-bottom: 24px;
}
.workspace-theme .brand small {
  font-size: 12px;
}
.workspace-theme .nav-button {
  font-size: 14px;
  padding: 9px 12px;
  min-height: 40px;
  border-radius: var(--radius-s);
}
.workspace-theme .workspace-nav-group {
  border: 0;
  margin: 2px 0;
  padding: 0;
}
.workspace-theme .workspace-nav-group > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-s);
}
.workspace-theme .workspace-nav-group > summary::-webkit-details-marker {
  display: none;
}
.workspace-theme .workspace-nav-group > summary::after {
  content: "›";
  margin-left: auto;
  transform: rotate(90deg);
}
.workspace-theme .workspace-nav-group[open] > summary::after {
  transform: rotate(-90deg);
}
.workspace-theme .workspace-nav-group:has([aria-current="page"]) > summary {
  color: var(--text-primary);
}
.workspace-theme .workspace-nav-group > div {
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--border-subtle);
  margin-left: 20px;
}
.workspace-theme .workspace-nav-group .nav-button {
  padding: 8px;
  font-size: 13px;
}
.workspace-theme .workspace-nav-group .nav-button .mgr-line-icon {
  display: none;
}
.workspace-theme .app-header {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: 0 24px;
  min-height: 56px;
  height: 56px;
  background: var(--bg-base);
}
.workspace-theme main {
  width: 100%;
  margin: 0 auto;
}
.workspace-theme .workspace-page {
  min-width: 0;
}
.workspace-theme .page-heading {
  align-items: flex-start;
}
.workspace-theme .page-heading p {
  max-width: 78ch;
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.workspace-theme .actions {
  align-items: center;
  gap: 8px;
}
.workspace-theme h3 {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 550;
}
.workspace-theme strong {
  font-weight: 600;
}
.workspace-theme
  :is(.small, .muted, .cell-small, .code-note, .host-number-context) {
  color: var(--text-secondary);
  font-size: 13px;
}
.workspace-theme :is(small, .form-hint) {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.workspace-theme :is(.workflow-phone, .code-note) {
  font-variant-numeric: tabular-nums;
}
.workspace-theme a {
  color: var(--accent-primary);
}
.workspace-theme button:hover {
  filter: none;
}
.workspace-theme button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.35;
  border-radius: var(--radius-s);
}
.workspace-theme button:disabled {
  opacity: 1;
  color: var(--text-disabled);
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  cursor: not-allowed;
}
.workspace-theme .secondary,
.workspace-theme .button-link {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.workspace-theme :is(.quiet, .link-button) {
  color: var(--accent-primary);
  background: transparent;
  border-color: transparent;
}
.workspace-theme :is(.danger, .mgr-button-danger) {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger);
}
.workspace-theme :is(.quiet, .secondary, .link-button):hover {
  background: var(--bg-hover);
}
.workspace-theme
  :is(button.primary, button:not([class]), .form-footer button[type="submit"]) {
  color: var(--text-on-accent);
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
.workspace-theme :is(button.primary, button:not([class])):hover {
  background: var(--accent-primary-hover);
}
.workspace-theme :is(input, select, textarea) {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 14px;
}
.workspace-theme :is(input, select, textarea):disabled {
  color: var(--text-disabled);
  background: var(--bg-surface);
}
.workspace-theme input[type="checkbox"],
.workspace-theme input[type="radio"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent-primary);
}
.workspace-theme label {
  color: var(--text-secondary);
  font-weight: 500;
  margin: 16px 0 8px;
  font-size: 13px;
}
.workspace-theme .form-grid {
  gap: 0 16px;
}
.workspace-theme .form-grid label {
  margin-top: 12px;
}
.workspace-theme .form-footer {
  gap: 8px;
  padding: 16px 0 0;
  margin-top: 24px;
}
.workspace-theme .computed {
  background: var(--bg-surface-raised);
  padding: 12px 16px;
  border-radius: var(--radius-s);
}
.workspace-theme .computed strong {
  font-size: 20px;
}
.workspace-theme .upload-box {
  padding: 20px;
  border: 1px dashed var(--border-default);
  background: var(--bg-base);
  border-radius: var(--radius-m);
}
.workspace-theme .panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 16px;
  margin: 0 0 16px;
  border-radius: var(--radius-m);
  box-shadow: none;
  min-width: 0;
}
.workspace-theme .panel .panel {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 16px 0 0;
  background: transparent;
  margin-bottom: 12px;
}
.workspace-theme .panel-head {
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.workspace-theme .panel-head h2 {
  margin: 0;
}
.workspace-theme .panel-head .actions {
  margin-left: auto;
}
.workspace-theme .panel > .table-wrap {
  margin: 0;
}
.workspace-theme .table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-m);
}
.workspace-theme .panel > .table-wrap {
  border: 0;
  border-radius: 0;
}
.workspace-theme table {
  font-size: 13px;
}
.workspace-theme th {
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  padding: 10px 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
}
.workspace-theme td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: top;
}
.workspace-theme tbody tr:last-child td {
  border-bottom: 0;
}
.workspace-theme tbody tr:hover > td {
  background: var(--bg-hover);
}
.workspace-theme .workspace-table:not(.workspace-table-wide) table {
  min-width: 0;
  width: 100%;
}
.workspace-theme .workspace-table td:first-child {
  font-weight: 550;
}
.workspace-theme
  .workspace-table
  td:first-child
  :is(.small, small, .cell-small) {
  font-weight: 400;
}
.workspace-theme .workspace-table .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-start;
}
.workspace-theme .workspace-row-more {
  position: relative;
}
.workspace-theme .workspace-row-more > summary {
  cursor: pointer;
  list-style: none;
  color: var(--text-secondary);
  padding: 8px;
  min-height: 36px;
}
.workspace-theme .workspace-row-more > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 0;
}
.workspace-theme .workspace-row-more:not([open]) > div {
  display: none;
}
.workspace-theme .toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-m);
  padding: 12px;
  gap: 8px 12px;
  margin-bottom: 16px;
  align-items: end;
}
.workspace-theme .toolbar label {
  margin: 0 0 4px;
}
.workspace-theme .toolbar :is(select, input) {
  max-width: 100%;
}
.workspace-theme .toolbar input[type="search"] {
  min-width: 160px;
}
.workspace-theme .toolbar .field {
  min-width: 0;
}
.workspace-theme :is(.tabs, .host-filters, .manager-tabs) {
  gap: 4px;
  margin: 0 0 16px;
  padding: 0;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  flex-wrap: nowrap;
}
.workspace-theme :is(.tabs, .host-filters) button {
  flex: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 12px;
}
.workspace-theme
  :is(.tabs, .host-filters)
  button:is(.active, [aria-selected="true"]) {
  background: transparent;
  color: var(--accent-primary-hover);
  border-bottom-color: var(--accent-primary);
}
.workspace-theme .pager {
  margin: 0;
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.workspace-theme :is(.badge, .lead-status) {
  border-radius: var(--radius-s);
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  padding: 3px 7px;
  font-weight: 500;
  white-space: normal;
  line-height: 1.45;
}
.workspace-theme
  :is(
    .badge.warning,
    .lead-status-result,
    .lead-status-evidence,
    .lead-status-submitted,
    .lead-status-paused
  ) {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}
.workspace-theme
  :is(.badge.inactive, .lead-status-cancelled, .lead-status-expired) {
  background: var(--bg-surface);
  color: var(--text-muted);
}
.workspace-theme .lead-status-running {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
}
.workspace-theme .lead-status-aborted {
  background: var(--danger-soft);
  color: var(--danger);
}
.workspace-theme .lead-status-confirmed {
  background: var(--success-soft);
  color: var(--success);
}
.workspace-theme .lead-next {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 8px;
}
.workspace-theme :is(.empty, .empty-state, .mgr-empty) {
  color: var(--text-secondary);
  background: transparent;
  padding: 20px 16px;
  border: 0;
  margin: 0;
  text-align: left;
  font-size: 13px;
}
.workspace-theme .empty h2 {
  margin-bottom: 8px;
}
.workspace-theme .notice {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-m);
}
.workspace-theme .error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-m);
  overflow-wrap: anywhere;
}
.workspace-theme #notice {
  position: sticky;
  top: 64px;
  z-index: 26;
  box-shadow: var(--shadow-soft);
}
.workspace-theme #workspace-error {
  margin-bottom: 16px;
}
.workspace-theme .loading {
  color: var(--text-secondary);
  padding: 24px;
}
.workspace-theme .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-m);
  background: var(--bg-surface);
  margin-bottom: 16px;
  overflow: hidden;
}
.workspace-theme .metric,
.workspace-theme .metric.primary {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 14px 16px;
  box-shadow: none;
  color: var(--text-primary);
}
.workspace-theme .metric:last-child {
  border-right: 0;
}
.workspace-theme .metric :is(.label, span, small),
.workspace-theme .metric.primary :is(.label, small) {
  color: var(--text-secondary);
  font-size: 12px;
}
.workspace-theme .metric strong {
  display: block;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 550;
  margin: 4px 0;
}
.workspace-theme .metric.primary strong {
  color: var(--accent-primary);
}
.workspace-theme .rate-grid {
  margin: 0;
  gap: 16px;
}
.workspace-theme .rate-grid dd {
  color: var(--text-primary);
  font-size: 21px;
}
.workspace-theme .trend-bar {
  background: var(--chart-primary);
}
.workspace-theme .trend-bar.target {
  background: var(--chart-secondary);
}
.workspace-theme .legend span:before {
  background: var(--chart-primary);
}
.workspace-theme .legend span:last-child:before {
  background: var(--chart-secondary);
}
.workspace-theme .trend {
  border-color: var(--border-subtle);
}
.workspace-theme .summary {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}
.workspace-theme .ai-copy {
  color: var(--text-primary);
}
.workspace-theme [data-page="ai"] > .panel:first-of-type {
  border-top-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}
.workspace-theme .login-layout {
  width: min(430px, calc(100% - 32px));
  margin: 8vh auto;
}
.workspace-theme .login-card {
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-elevated);
}
.workspace-theme .login-brand {
  color: var(--text-primary);
}
.workspace-theme .login-card h1 {
  font-size: 24px;
}
.workspace-theme .login-card input {
  min-height: 42px;
}
.workspace-theme .login-card .muted {
  font-size: 13px;
}
.workspace-theme dialog {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
}
.workspace-theme dialog::backdrop {
  background: var(--overlay);
}
.workspace-theme .dialog-head {
  background: var(--bg-elevated);
  padding: 16px 20px;
}
.workspace-theme #editor-body {
  padding: 12px 20px 20px;
}
.workspace-theme .detail-grid {
  gap: 16px;
  margin: 16px 0;
}
.workspace-theme .detail-grid dd {
  font-size: 14px;
  line-height: 1.5;
}
.workspace-theme .detail-grid dt {
  font-size: 12px;
}
.workspace-theme pre {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 16px;
  border-radius: var(--radius-s);
}
.workspace-theme .entry-grid :is(th, td) {
  padding: 6px;
}
.workspace-theme .entry-grid :is(input, select, textarea) {
  background: var(--bg-base);
  color: var(--text-primary);
}
.workspace-theme .entry-grid .grid-invalid {
  background: var(--danger-soft);
}
.workspace-theme .entry-grid .grid-row-errors td {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Role workspaces use the same surfaces while preserving their business units. */
.workspace-theme .sales-workbench .sales-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr);
  gap: 16px;
  align-items: start;
}
.workspace-theme .sales-home-grid > * {
  min-width: 0;
}
.workspace-theme .sales-home-grid .sales-number-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.workspace-theme .sales-number {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 0;
  border-radius: 0;
}
.workspace-theme .sales-number:last-child {
  border-bottom: 0;
}
.workspace-theme .sales-number > div {
  margin: 6px 0;
  font-variant-numeric: tabular-nums;
}
.workspace-theme .sales-quota {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  margin: 0 0 16px;
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  border-radius: var(--radius-s);
  font-size: 13px;
}
.workspace-theme .lead-publish {
  gap: 12px;
}
.workspace-theme .lead-publish > :is(.field, p, .toolbar) {
  margin: 0;
}
.workspace-theme .publish-numbers {
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.workspace-theme .publish-number {
  margin: 0;
  padding: 8px 12px;
  border-color: var(--border-subtle);
  border-radius: var(--radius-s);
  background: var(--bg-base);
}
.workspace-theme .publish-number:has(input:checked) {
  background: var(--accent-primary-soft);
  border-color: var(--border-highlight);
}
.workspace-theme .publish-selected {
  gap: 12px;
  border-color: var(--border-subtle);
}
.workspace-theme .publish-selected:empty {
  display: none;
}
.workspace-theme .publish-selected .field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  overflow-wrap: anywhere;
}
.workspace-theme .publish-more {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}
.workspace-theme .publish-more > summary {
  cursor: pointer;
  padding: 4px 0;
}
.workspace-theme .publish-more .field {
  margin-top: 12px;
}
.workspace-theme .host-workbench {
  max-width: none;
}
.workspace-theme .host-stats {
  margin: 16px 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  gap: 0;
  border-radius: var(--radius-m);
}
.workspace-theme .host-stat {
  background: transparent;
  padding: 12px 16px;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
  gap: 12px;
}
.workspace-theme .host-stat:last-child {
  border-right: 0;
}
.workspace-theme .host-stat strong {
  color: var(--accent-primary);
  font-size: 24px;
  font-weight: 550;
}
.workspace-theme .host-stat span {
  color: var(--text-secondary);
  font-size: 12px;
}
.workspace-theme .host-live-layout {
  gap: 16px;
}
.workspace-theme .host-chat-slot {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  border-radius: var(--radius-m);
  top: 72px;
}
.workspace-theme .host-chat-slot .conversation-panel {
  max-height: calc(100dvh - 96px);
}
.workspace-theme .host-number-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-primary);
  border-radius: var(--radius-m);
  padding: 16px;
}
.workspace-theme .host-number-title strong {
  color: var(--text-primary);
  font-size: 17px;
}
.workspace-theme .host-request-card {
  background: var(--bg-surface);
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  margin: 0;
}
.workspace-theme .host-request-card:last-child {
  border: 0;
}
.workspace-theme .host-request-card .actions {
  gap: 6px;
}
.workspace-theme .host-records-summary {
  color: var(--text-secondary);
}
.workspace-theme .workspace-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}
.workspace-theme .workspace-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.workspace-theme .workspace-shortcuts button {
  text-align: left;
  justify-content: flex-start;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: normal;
}
.workspace-theme .workspace-shortcuts .mgr-line-icon {
  color: var(--text-secondary);
}
.workspace-theme .workspace-admin-todo {
  display: grid;
  gap: 0;
}
.workspace-theme .workspace-admin-todo > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.workspace-theme .workspace-admin-todo > div:last-child {
  border: 0;
}
.workspace-theme .workspace-admin-todo p {
  margin: 4px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Shared conversation, floating and docked, including read-only supervision. */
.workspace-theme .conversation-center {
  height: calc(100dvh - 194px);
  min-height: 510px;
  max-height: none;
  grid-template-columns: 300px minmax(0, 1fr);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-m);
  background: var(--bg-surface);
}
.workspace-theme .conversation-sidebar {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}
.workspace-theme .conversation-list-title {
  font-size: 14px;
  padding: 16px 16px 8px;
}
.workspace-theme .conversation-tabs {
  padding: 0 12px;
}
.workspace-theme .conversation-tabs button {
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-s);
  background: transparent;
}
.workspace-theme .conversation-tabs [aria-selected="true"] {
  color: var(--accent-primary);
  background: var(--accent-primary-soft);
}
.workspace-theme .conversation-sidebar > .toolbar {
  background: transparent;
  border: 0;
  padding: 12px;
}
.workspace-theme .conversation-contact {
  color: var(--text-primary);
  padding: 12px;
  gap: 10px;
}
.workspace-theme .conversation-contact:hover {
  background: var(--bg-hover);
}
.workspace-theme .conversation-contact[aria-pressed="true"] {
  background: var(--bg-selected);
  box-shadow: inset 2px 0 var(--accent-primary);
}
.workspace-theme .conversation-avatar {
  color: var(--text-primary);
  background: var(--avatar-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  font-weight: 550;
}
.workspace-theme .conversation-preview > span {
  color: var(--text-secondary);
  font-size: 12px;
}
.workspace-theme .conversation-preview small,
.workspace-theme .conversation-count {
  color: var(--text-muted);
  font-size: 12px;
}
.workspace-theme .conversation-count b {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.workspace-theme .conversation-panel,
.workspace-theme .chat-floating {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}
.workspace-theme .conversation-panel .chat-floating-header {
  padding: 12px 16px;
  background: var(--bg-surface-raised);
  border-color: var(--border-subtle);
}
.workspace-theme .conversation-panel .chat-floating-header strong {
  font-size: 14px;
  font-weight: 550;
}
.workspace-theme .conversation-panel .chat-messages {
  background: var(--bg-base);
}
.workspace-theme .conversation-panel .chat-message {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: none;
  border-radius: var(--radius-m);
}
.workspace-theme .conversation-panel .chat-message.own {
  background: var(--accent-primary-soft);
  border-color: var(--border-subtle);
}
.workspace-theme .conversation-message-avatar {
  background: var(--avatar-surface);
  color: var(--text-primary);
  border-radius: var(--radius-s);
}
.workspace-theme .conversation-panel .own .conversation-message-avatar {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
}
.workspace-theme .conversation-panel :is(.chat-composer, .conversation-emoji) {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}
.workspace-theme .conversation-panel .chat-composer textarea {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.workspace-theme .conversation-panel :is(.small, small, #conversation-status) {
  font-size: 12px;
  color: var(--text-secondary);
}
.workspace-theme .conversation-tools button {
  color: var(--text-secondary);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.workspace-theme .conversation-context button {
  background: var(--bg-surface-raised);
  color: var(--accent-primary);
  font-size: 12px;
  border-color: var(--border-subtle);
}
.workspace-theme .conversation-task-card {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-primary);
  border-left: 2px solid var(--accent-primary);
}
.workspace-theme .conversation-task-card p {
  font-size: 13px;
  color: var(--text-secondary);
}
.workspace-theme .conversation-upload {
  background: var(--warning-soft);
  color: var(--warning);
}
.workspace-theme .conversation-audit-filters {
  border-color: var(--border-subtle);
  background: var(--bg-surface-raised);
  padding: 12px;
  font-size: 13px;
}
.workspace-theme .conversation-audit-filters label {
  font-size: 12px;
}
.workspace-theme .conversation-review-banner {
  background: var(--warning-soft);
  color: var(--warning);
  border-bottom: 1px solid var(--border-default);
  padding: 10px 16px;
  font-size: 13px;
}
.workspace-theme .task-chat-alerts {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-elevated);
}
.workspace-theme .management-note {
  color: var(--warning);
  background: var(--warning-soft);
  border-radius: var(--radius-s);
  padding: 8px 12px;
}

@media (max-width: 1150px) {
  .workspace-theme .sales-workbench .sales-home-grid,
  .workspace-theme .workspace-admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-theme .sales-home-grid .sales-number-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .workspace-theme .conversation-center {
    grid-template-columns: 270px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  body.workspace-theme .sidebar {
    display: none;
  }
  body.workspace-theme #workspace {
    display: block;
  }
  .workspace-theme .app-header {
    padding: 0 12px;
    height: 52px;
    min-height: 52px;
  }
  .workspace-theme #breadcrumb {
    display: block;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .workspace-theme #breadcrumb::before {
    display: none;
  }
  .workspace-theme .app-header .account-controls {
    margin-left: auto;
    gap: 4px;
  }
  .workspace-theme .mgr-user-menu #greeting {
    display: none;
  }
  .workspace-theme #manager-mobile-nav {
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-default);
    min-height: 62px;
    padding: 5px 6px max(6px, env(safe-area-inset-bottom));
  }
  .workspace-theme #manager-mobile-nav > button {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 48px;
    padding: 5px;
    font-size: 12px;
  }
  .workspace-theme #manager-mobile-nav .mgr-menu > summary {
    min-height: 48px;
    display: grid;
    place-items: center;
    font-size: 12px;
  }
  .workspace-theme main {
    padding: 16px 12px 90px;
  }
  .workspace-theme .page-heading {
    flex-direction: column;
    gap: 12px;
  }
  .workspace-theme .page-heading > .actions {
    width: 100%;
  }
  .workspace-theme .page-heading h1 {
    font-size: 21px;
  }
  .workspace-theme :is(.panel, .mgr-section) {
    border-radius: var(--radius-m);
  }
  .workspace-theme .panel {
    padding: 12px;
  }
  .workspace-theme .panel-head {
    flex-wrap: wrap;
  }
  .workspace-theme .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workspace-theme .metric {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .workspace-theme .metric strong {
    font-size: 22px;
  }
  .workspace-theme .toolbar {
    padding: 10px;
    gap: 8px;
  }
  .workspace-theme .toolbar .field {
    flex: 1 1 120px;
  }
  .workspace-theme .toolbar input[type="date"] {
    width: 100%;
    min-width: 0;
  }
  .workspace-theme .toolbar input[type="search"] {
    min-width: 0;
    width: 100%;
  }
  .workspace-theme .toolbar > select {
    min-width: 0;
  }
  .workspace-theme .workspace-table:not(.workspace-table-wide) {
    overflow: visible;
    border: 0;
  }
  .workspace-theme
    .workspace-table:not(.workspace-table-wide)
    :is(table, tbody, tr, td) {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .workspace-theme .workspace-table:not(.workspace-table-wide) thead {
    display: none;
  }
  .workspace-theme .workspace-table:not(.workspace-table-wide) tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin: 0;
    background: transparent;
    border-radius: 0;
  }
  .workspace-theme .workspace-table:not(.workspace-table-wide) tr:last-child {
    border-bottom: 0;
  }
  .workspace-theme .workspace-table:not(.workspace-table-wide) td {
    display: grid;
    grid-template-columns: minmax(80px, 32%) minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .workspace-theme .workspace-table:not(.workspace-table-wide) td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
  }
  .workspace-theme .workspace-table:not(.workspace-table-wide) td:first-child {
    display: block;
    padding-bottom: 8px;
    font-size: 14px;
  }
  .workspace-theme
    .workspace-table:not(.workspace-table-wide)
    td:first-child::before {
    display: none;
  }
  .workspace-theme .workspace-table:not(.workspace-table-wide) td:has(.actions),
  .workspace-theme
    .workspace-table:not(.workspace-table-wide)
    td:has(.row-actions) {
    display: block;
  }
  .workspace-theme
    .workspace-table:not(.workspace-table-wide)
    td:has(.actions)::before,
  .workspace-theme
    .workspace-table:not(.workspace-table-wide)
    td:has(.row-actions)::before {
    display: none;
  }
  .workspace-theme .sales-home-grid .sales-number-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .workspace-theme .host-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workspace-theme .host-stat {
    padding: 12px;
  }
  .workspace-theme .host-number-card {
    padding: 12px;
  }
  .workspace-theme .host-live-layout {
    grid-template-columns: 1fr;
  }
  .workspace-theme .host-chat-slot {
    position: static;
  }
  .workspace-theme .conversation-center {
    display: block;
    height: calc(100dvh - 236px);
    min-height: 430px;
  }
  .workspace-theme .conversation-sidebar {
    height: 100%;
  }
  .workspace-theme
    .conversation-center:not(.conversation-chat-open)
    .conversation-current {
    display: none;
  }
  .workspace-theme
    .conversation-center.conversation-chat-open
    .conversation-sidebar {
    display: none;
  }
  .workspace-theme
    .conversation-center.conversation-chat-open
    .conversation-current {
    display: block;
    height: 100%;
  }
  .workspace-theme .conversation-panel .chat-messages {
    padding: 16px 42px;
  }
  .workspace-theme .chat-floating:not(.conversation-docked) {
    bottom: 76px;
    max-height: calc(100dvh - 136px);
  }
  .workspace-theme .conversation-tools small {
    display: none;
  }
  .workspace-theme .conversation-send-row small {
    max-width: 65%;
  }
  .workspace-theme .workspace-admin-todo > div {
    align-items: flex-start;
    gap: 12px;
  }
  .workspace-theme .workspace-shortcuts {
    grid-template-columns: 1fr;
  }
  .workspace-theme #editor.mgr-drawer {
    height: 100dvh;
    max-height: 100dvh;
    width: 100%;
    max-width: none;
    border-radius: 0;
  }
  .workspace-theme .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-theme *,
  .workspace-theme *::before,
  .workspace-theme *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  body.workspace-theme {
    color-scheme: light;
    --bg-base: #fff;
    --bg-sidebar: #fff;
    --bg-surface: #fff;
    --bg-surface-raised: #f3f4f5;
    --bg-elevated: #fff;
    --text-primary: #20272e;
    --text-secondary: #43515c;
    --text-muted: #43515c;
    --ink: #20272e;
    --muted: #43515c;
    --border-subtle: #d3d9dd;
    background: #fff;
    color: #20272e;
  }
  .workspace-theme #workspace {
    display: block;
  }
  .workspace-theme #manager-mobile-nav,
  .workspace-theme .mgr-user-menu {
    display: none;
  }
}

/* Existing query fields share a progressive filter surface; no query semantics change. */
.workspace-theme .workspace-filter-more {
  position: relative;
  align-self: end;
}
.workspace-theme .workspace-filter-more > summary {
  color: var(--text-secondary);
  cursor: pointer;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-s);
  background: var(--bg-surface-raised);
  font-size: 13px;
}
.workspace-theme .workspace-filter-fields {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 24;
  min-width: 280px;
  max-width: min(420px, 88vw);
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-elevated);
}
.workspace-theme .workspace-filter-fields .field {
  min-width: 0;
}
.workspace-theme .workspace-filter-fields label {
  margin-top: 0;
}
@media (max-width: 760px) {
  .workspace-theme .workspace-filter-more {
    width: 100%;
  }
  .workspace-theme .workspace-filter-fields {
    position: static;
    margin-top: 8px;
    min-width: 0;
    max-width: none;
  }
}

.workspace-theme .host-live-layout .panel p {
  margin: 8px 0;
  line-height: 1.55;
}
.workspace-theme .host-number-title strong {
  font-size: 15px;
}
.workspace-theme .host-number-card {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: var(--radius-s);
}

/* Long notes stay available in the existing detail drawer; lists remain scannable. */
.workspace-theme .workspace-page .mgr-table .cell-small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.workspace-theme .workspace-page .mgr-table td {
  vertical-align: top;
}
.workspace-theme
  .workspace-page:is([data-page="task-hall"], [data-page="lead-requests"])
  .mgr-table
  :is(th, td):nth-child(2) {
  width: 22%;
}
.workspace-theme
  .workspace-page:is([data-page="task-hall"], [data-page="lead-requests"])
  .mgr-table
  :is(th, td):nth-child(4) {
  width: 23%;
}
.workspace-theme .toolbar > input:not([type="checkbox"]) {
  width: auto;
  flex: 1 1 240px;
  min-width: 0;
}
.workspace-theme .conversation-tools {
  flex-wrap: wrap;
}
.workspace-theme .host-chat-slot .conversation-tools small {
  flex: 1 0 100%;
  margin-left: 0;
}
@media (max-width: 760px) {
  .workspace-theme
    .workspace-page:is([data-page="task-hall"], [data-page="lead-requests"])
    .mgr-table
    :is(th, td):nth-child(n) {
    width: auto;
  }
}

.workspace-theme .error:empty {
  display: none;
}

.workspace-theme .host-filters button.primary {
  background: transparent;
  color: var(--accent-primary-hover);
  border-bottom-color: var(--accent-primary);
}

.workspace-theme .host-record-content > .page-heading h1 {
  display: none;
}
.workspace-theme .host-record-content > .page-heading {
  margin: 0 0 16px;
}

/* Source-aware deal lists reuse workspace controls without full-width filter rows. */
.workspace-theme .deal-filters {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr) minmax(120px, 0.65fr) repeat(2, minmax(130px, 0.7fr))
    auto auto;
  align-items: center;
}
.workspace-theme .deal-source-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.6fr) auto;
  align-items: center;
}
.workspace-theme .deal-filters > *,
.workspace-theme .deal-source-filters > * {
  min-width: 0;
  width: auto;
}
@media (max-width: 1100px) {
  .workspace-theme .deal-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .workspace-theme .deal-source-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workspace-theme .deal-source-filters input[type="search"],
  .workspace-theme .deal-filters input[type="search"] {
    grid-column: 1 / -1;
  }
}

/* Product identity uses the existing mark and spacing; business labels are unchanged. */
.workspace-theme .brand-mark {
  flex-shrink: 0;
}
.workspace-theme .brand-name {
  white-space: nowrap;
  font-size: 14px;
}
.workspace-theme .brand-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin: -12px 0 24px;
}
.workspace-theme .system-product {
  color: var(--text-secondary);
  font-size: 13px;
}

/* UX-20260913-01: the live pane can be narrow even on a desktop with chat open. */
.host-live-main {
  min-width: 0;
}
.live-reserve-list {
  display: grid;
  gap: 12px;
}
.live-reserve-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.live-reserve-identity,
.live-reserve-owner,
.live-reserve-state {
  min-width: 0;
  grid-column: 1;
}
.live-reserve-identity strong,
.live-reserve-phone {
  display: block;
}
.live-reserve-state p {
  margin: 4px 0;
  font-size: 12px;
}
.live-reserve-action {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}
.live-reserve-action button {
  white-space: normal;
  max-width: 12em;
  min-height: 40px;
}
.live-guidance[hidden],
.live-editor-state[hidden] {
  display: none;
}
@media (max-width: 760px) {
  .live-reserve-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .live-reserve-action {
    grid-column: 1;
    grid-row: auto;
  }
  .live-reserve-action button {
    width: 100%;
    max-width: none;
  }
}
