/* Compact administration layout. Public portals and document canvases are untouched. */
@media screen {
  html body[data-experience="workspace"]:is([data-layout="compact"],[data-layout="calm"]) {min-width:0;background:#f4f6f7;--compact-surface:#fff;--compact-soft:#f4f6f7;--compact-text:#292f35;--compact-muted:#657079;--compact-line:#dce1e4;--compact-tint:#f2edf6;--compact-accent:#643182;color:var(--compact-text)}
  html[data-workspace-theme="dark"] body:is([data-layout="compact"],[data-layout="calm"]) {--compact-surface:#222628;--compact-soft:#191d1f;--compact-text:#edf0ef;--compact-muted:#b0bbb7;--compact-line:#454d50;--compact-tint:#392a43;--compact-accent:#deb6ef;background:var(--compact-soft)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .app-shell {display:flex;flex-direction:column;min-width:0}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar {position:relative;inset:auto;width:100%;height:auto;min-height:76px;transform:none;display:grid;grid-template-columns:180px minmax(0,1fr) 175px 200px;align-items:center;gap:18px;padding:12px 28px;background:var(--compact-surface);color:var(--compact-text);border:0;border-bottom:1px solid var(--compact-line);z-index:35}
  html body[data-experience="workspace"]:is([data-layout="compact"],[data-layout="calm"]) .sidebar .brand {height:58px;min-height:0;padding:0;background:transparent;border:0}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .brand .workspace-brand-logo {height:58px;max-width:180px;width:100%;object-fit:contain}
  html body:is([data-layout="compact"],[data-layout="calm"]) #nav {display:flex;align-items:center;flex-wrap:wrap;gap:3px 10px;padding:0;overflow:visible;min-width:0}
  .compact-primary-nav,.compact-nav-groups {display:flex;align-items:center;flex-wrap:wrap;gap:3px}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .nav-button {display:flex;width:auto;min-height:36px;height:auto;margin:0;padding:8px 10px;font-size:13px;gap:7px;color:var(--compact-text);border-radius:4px;justify-content:flex-start;box-shadow:none}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .nav-button>span {display:block}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .nav-button.active {background:var(--compact-tint);color:var(--compact-accent);box-shadow:none;font-weight:650}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .nav-button:hover {background:var(--compact-soft);color:var(--compact-text)}
  .compact-nav-group,.compact-case-more {position:relative}
  .compact-nav-group summary,.compact-case-more summary {display:flex;align-items:center;gap:7px;list-style:none;padding:10px;font-size:12px;cursor:pointer;color:var(--compact-muted);border-radius:4px;min-height:38px}
  .compact-nav-group summary::-webkit-details-marker,.compact-case-more summary::-webkit-details-marker {display:none}
  .compact-nav-group summary svg,.compact-case-more summary svg {width:12px;height:12px;transform:rotate(90deg);flex:none}
  .compact-nav-group[open] summary,.compact-nav-group.current summary,.compact-case-more.current summary {background:var(--compact-tint);color:var(--compact-accent)}
  .compact-nav-options,.compact-case-options {position:absolute;top:100%;left:0;min-width:240px;max-width:min(330px,calc(100vw - 32px));width:max-content;max-height:65vh;overflow:auto;background:var(--compact-surface);border:1px solid var(--compact-line);box-shadow:0 8px 28px #0002;border-radius:5px;padding:6px;z-index:60}
  html body:is([data-layout="compact"],[data-layout="calm"]) .compact-nav-options .nav-button {width:100%;white-space:normal;text-align:left}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .branch-switcher {display:block;padding:0;border:0;background:transparent;min-width:0}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .branch-switcher>span {display:block;font-size:10px;text-transform:none;margin:0 0 5px;color:var(--compact-muted)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .branch-switcher button {border-color:var(--compact-line);color:var(--compact-text);background:var(--compact-surface);min-height:34px;font-size:12px}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card {display:grid;grid-template-columns:32px minmax(0,1fr) 28px;min-width:0;padding:0;border:0;background:transparent;min-height:45px;gap:8px}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card>div,html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card>button:last-child {display:block}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card strong {font-size:12px;overflow-wrap:anywhere;color:var(--compact-text)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card div span {font-size:11px;color:var(--compact-muted)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .workspace {min-height:calc(100vh - 100px);width:100%}
  html body:is([data-layout="compact"],[data-layout="calm"]) .topbar {height:52px;min-height:52px;padding:0 28px;position:sticky;top:0;background:var(--compact-surface);gap:16px;z-index:25}
  html body:is([data-layout="compact"],[data-layout="calm"]) #workspace-menu-toggle,html body:is([data-layout="compact"],[data-layout="calm"]) #workspace-menu-backdrop {display:none}
  html body:is([data-layout="compact"],[data-layout="calm"]) .global-search {max-width:650px}
  html body:is([data-layout="compact"],[data-layout="calm"]) .content {padding:22px 28px;min-width:0}
  html body:is([data-layout="compact"],[data-layout="calm"]) .page-head h1 {font-family:'Segoe UI',Arial,sans-serif;font-size:25px;font-weight:650;letter-spacing:0}
  html body:is([data-layout="compact"],[data-layout="calm"]) .panel,html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace {border-radius:0;box-shadow:none;border-color:var(--compact-line)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace {position:relative;inset:auto;width:100%;height:auto;min-height:0;background:var(--compact-surface)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-head {padding:16px 20px;min-height:70px;box-shadow:none;gap:16px;flex-wrap:wrap;background:var(--compact-surface);border-color:var(--compact-line)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-head h1 {font-family:'Segoe UI',Arial,sans-serif;font-size:25px;font-weight:650;letter-spacing:0}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-head p {margin:6px 0 0;font-size:12px}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-body {max-width:none;width:100%;padding:0;margin:0;overflow:visible}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-body .case-summary {min-height:66px;border:0;border-bottom:1px solid var(--compact-line);border-radius:0;background:var(--compact-soft);padding:12px 20px;box-shadow:none;grid-template-columns:minmax(0,1fr) auto auto;gap:16px}
  html body:is([data-layout="compact"],[data-layout="calm"]) .case-summary::before,html body:is([data-layout="compact"],[data-layout="calm"]) .case-summary>.avatar,html body:is([data-layout="compact"],[data-layout="calm"]) .case-summary h3 {display:none}
  html body:is([data-layout="compact"],[data-layout="calm"]) .case-summary .case-health,html body:is([data-layout="compact"],[data-layout="calm"]) .case-summary .preneed-amount {background:transparent;border:0;padding:0;box-shadow:none;width:auto;min-width:130px}
  html body:is([data-layout="compact"],[data-layout="calm"]) .case-summary .case-health i {display:none}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace .case-tabs {display:flex;position:relative;overflow:visible;flex-wrap:wrap;gap:0 16px;padding:0 20px;border:0;border-bottom:1px solid var(--compact-line);margin:0;background:var(--compact-surface);z-index:15}
  html body:is([data-layout="compact"],[data-layout="calm"]) .case-tabs .tab {padding:13px 0;min-height:44px;border:0;border-bottom:3px solid transparent;border-radius:0;box-shadow:none;font-size:13px;color:var(--compact-muted);background:transparent}
  html body:is([data-layout="compact"],[data-layout="calm"]) .case-tabs .tab.active {color:var(--compact-accent);border-bottom-color:var(--compact-accent);background:transparent;box-shadow:none;font-weight:650}
  html body:is([data-layout="compact"],[data-layout="calm"]) .case-tabs .compact-case-options .tab {display:flex;width:100%;text-align:left;justify-content:flex-start;padding:10px;white-space:normal;min-height:38px;border-bottom:0}
  .compact-case-more {align-self:center;margin-left:auto}
  .compact-case-options {left:auto;right:0}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace :is([data-case-section],[data-preneed-section]) {border:0;box-shadow:none;border-radius:0;padding:22px 20px;background:var(--compact-surface)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-foot {position:sticky;bottom:0;width:100%;padding:12px 20px;border-top:1px solid var(--compact-line);background:var(--compact-surface);box-shadow:none;z-index:12;flex-wrap:wrap}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace .form-section {font-family:'Segoe UI',Arial,sans-serif;font-size:15px;font-weight:650;margin:20px 0 12px;padding:6px 0;color:var(--compact-text)}
  html body:is([data-layout="compact"],[data-layout="calm"]) .record-edit-grid {gap:16px}
  html body:is([data-layout="compact"],[data-layout="calm"]) .case-master-section {padding-block:18px}
  .compact-case-overview {display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:36px}
  .compact-case-overview.hidden {display:none}
  .compact-overview-main {min-width:0;container-type:inline-size}
  .case-overview-groups {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;margin:26px 0 28px}
  .compact-case-overview .case-overview-group {min-width:0}
  .compact-case-overview .case-overview-group h3 {display:flex;align-items:center;gap:8px;color:var(--compact-accent);font-size:13px;margin:0 0 16px;padding:0 0 12px;border-bottom:2px solid var(--compact-tint)}
  .case-overview-group h3 svg {width:17px;height:17px;flex:none}
  .case-overview-facts {display:grid;gap:16px;margin:0}
  .case-overview-facts dt {color:var(--compact-muted);font-size:12px;line-height:1.4;margin-bottom:4px}
  .case-overview-facts dd {color:var(--compact-text);font-size:14px;font-weight:600;line-height:1.5;margin:0;overflow-wrap:anywhere}
  .case-overview-facts dd.case-overview-empty {font-weight:400;color:var(--compact-muted)}
  .case-overview-work {padding-top:22px;border-top:1px solid var(--compact-line)}
  .case-overview-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .case-overview-action {display:flex;align-items:center;gap:12px;min-width:0;min-height:84px;padding:15px;text-align:left;border:1px solid var(--compact-line);border-radius:6px;background:var(--compact-surface);color:var(--compact-text);font:inherit;cursor:pointer;transition:border-color .15s,background .15s}
  .case-overview-action:hover {background:var(--compact-soft);border-color:var(--compact-accent)}
  .case-overview-action:focus-visible {outline:2px solid var(--compact-accent);outline-offset:3px}
  .case-overview-action-icon {display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;background:var(--compact-tint);color:var(--compact-accent);border-radius:5px}
  .case-overview-action-icon svg {width:18px;height:18px}
  .case-overview-action-copy {min-width:0;flex:1;display:grid;gap:5px;overflow-wrap:anywhere}
  .case-overview-action-copy strong {font-size:13px;line-height:1.4;color:var(--compact-text)}
  .case-overview-action-copy>span {font-size:12px;line-height:1.4;color:var(--compact-muted)}
  .case-overview-action>svg {width:16px;height:16px;flex:none;color:var(--compact-muted)}
  .case-overview-action.needs-attention .case-overview-action-icon {background:#fff1d9;color:#855900}
  html[data-workspace-theme="dark"] .case-overview-action.needs-attention .case-overview-action-icon {background:#48391e;color:#f1cc80}
  @container(max-width:560px) {
    .case-overview-groups {grid-template-columns:1fr;gap:22px;margin-top:20px}
    .case-overview-facts {grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
    .compact-case-overview .case-overview-group h3 {margin-bottom:12px;padding-bottom:9px}
    .case-overview-actions {grid-template-columns:1fr}
    .case-overview-action {min-height:76px}
  }
  .compact-section-title {display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px}
  .compact-case-overview h2,.compact-office h2 {font-size:19px;margin:0;font-weight:650;font-family:'Segoe UI',Arial,sans-serif}
  .compact-case-overview h3,.compact-office h3 {font-size:15px;margin:0 0 16px;font-family:'Segoe UI',Arial,sans-serif;font-weight:650}
  .compact-facts {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin:24px 0 32px}
  .compact-facts dt {font-size:12px;color:var(--compact-muted);margin-bottom:8px}
  .compact-facts dd {margin:0;font-size:14px;line-height:1.5;overflow-wrap:anywhere;color:var(--compact-text)}
  .compact-overview-aside {padding-left:24px;border-left:1px solid var(--compact-line)}
  .compact-appointment {display:flex;gap:12px;padding:18px 0;border-top:1px solid var(--compact-line);font-size:13px}
  .compact-appointment>svg {color:var(--compact-accent);flex:none}
  .compact-appointment p {margin:7px 0;font-size:12px;color:var(--compact-muted)}
  .compact-contact {border-top:1px solid var(--compact-line);padding-top:22px;margin:14px 0 22px;font-size:13px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}
  .compact-contact h3,.compact-contact p {margin:0}
  .compact-contact p {color:var(--compact-muted)}
  .compact-progress>div {display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--compact-line);padding:13px 0;font-size:13px;min-height:57px}
  .compact-progress>div>svg {color:#2e7663;flex:none}
  .compact-progress>div>strong {font-size:12px;font-weight:500;color:var(--compact-muted);margin-left:auto;text-align:right}
  .compact-progress>div>button:last-child {margin-left:auto}
  .compact-office h2 {margin-bottom:22px}
  .compact-office-tools .grave-cross-section,.compact-room-bookings {border:0;border-top:1px solid var(--compact-line);border-radius:0;background:transparent;padding:22px 0;margin:0}
  .compact-room-bookings .section-toolbar-actions {justify-content:flex-start;flex-wrap:wrap}
  html body:is([data-layout="compact"],[data-layout="calm"]) .compact-office .section-toolbar {padding:0 0 20px;border:0}
  html body:is([data-layout="compact"],[data-layout="calm"]) .table-wrap,html body:is([data-layout="compact"],[data-layout="calm"]) .table-scroll {max-width:100%;overflow:auto}
  html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar details>summary:focus-visible,html body:is([data-layout="compact"],[data-layout="calm"]) .compact-case-more>summary:focus-visible {outline:2px solid var(--compact-accent);outline-offset:2px}
  /* Resolve the older light/dark navigation rules without affecting other surfaces. */
  html body[data-experience="workspace"]:is([data-layout="compact"],[data-layout="calm"]) .sidebar {background:var(--compact-surface)!important;border-color:var(--compact-line)!important}
  html body[data-experience="workspace"]:is([data-layout="compact"],[data-layout="calm"]) .sidebar .nav-button.active {background:var(--compact-tint)!important;color:var(--compact-accent)!important;box-shadow:none!important}
  html body[data-experience="workspace"]:is([data-layout="compact"],[data-layout="calm"]) .case-tabs .tab.active {background:transparent!important;color:var(--compact-accent)!important;box-shadow:none!important;border-bottom-color:var(--compact-accent)!important}
  html body[data-experience="workspace"]:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card {border:0!important;background:transparent!important}
  html[data-workspace-theme="dark"] body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .brand {background:#eee8f2;border-radius:4px}
  @media(max-width:1400px) {
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar {grid-template-columns:150px minmax(0,1fr) 155px;gap:15px;padding:10px 22px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card {grid-column:3;grid-row:2}
    html body:is([data-layout="compact"],[data-layout="calm"]) #nav {grid-row:1 / span 2;grid-column:2;align-self:center}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .brand {grid-row:1 / span 2}
    .compact-overview-aside{padding-left:20px}.compact-case-overview{gap:25px;grid-template-columns:minmax(0,1fr) 260px}
  }
  @media(max-width:900px) {
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar {grid-template-columns:150px minmax(0,1fr) 160px;padding:10px 16px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .brand {grid-row:1;grid-column:1}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .branch-switcher {grid-column:2;grid-row:1}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card {grid-column:3;grid-row:1}
    html body:is([data-layout="compact"],[data-layout="calm"]) #nav {grid-column:1 / -1;grid-row:2}
    html body:is([data-layout="compact"],[data-layout="calm"]) .content {padding:16px}
    .compact-case-overview{grid-template-columns:minmax(0,1fr)}.compact-overview-aside{padding:22px 0 0;border:0;border-top:1px solid var(--compact-line);display:grid;grid-template-columns:1fr 1fr;gap:15px}.compact-overview-aside>h3{grid-column:1/-1}.compact-contact{margin:0}
  }
  @media(max-width:680px) {
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar {grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 18px;position:relative;min-height:0}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .brand {grid-column:1;grid-row:1}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .user-card {grid-column:2;grid-row:1;grid-template-columns:28px minmax(0,1fr) 26px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .branch-switcher {grid-row:2;grid-column:1/-1}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .branch-switcher>span {display:none}
    html body:is([data-layout="compact"],[data-layout="calm"]) .sidebar .branch-switcher button {min-height:30px;padding:0 8px}
    html body:is([data-layout="compact"],[data-layout="calm"]) #nav {display:none;grid-row:3;grid-column:1/-1;gap:8px}
    html body:is([data-layout="compact"],[data-layout="calm"]).compact-mobile-open #nav {display:flex}
    .compact-primary-nav,.compact-nav-groups{width:100%;gap:4px}.compact-nav-group{position:static}.compact-nav-options{left:12px;right:12px;width:auto;max-width:none;top:100%}
    html body:is([data-layout="compact"],[data-layout="calm"]) #workspace-menu-toggle {display:grid;width:38px;flex:0 0 38px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .topbar {padding:0 12px;gap:8px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .content {padding:10px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-head {padding:14px 12px;gap:10px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-head h1 {font-size:21px;overflow-wrap:anywhere}
    html body:is([data-layout="compact"],[data-layout="calm"]) .record-back {padding:8px}.record-back svg{flex:none}
    html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-body .case-summary {padding:12px;grid-template-columns:minmax(0,1fr) auto;gap:10px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .case-summary>div:first-of-type{grid-column:1/-1}
    html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace .case-tabs {padding:0 12px;gap:0 14px;display:flex}
    html body:is([data-layout="compact"],[data-layout="calm"]) .case-tabs .tab{font-size:12px;min-height:40px;padding:10px 0}
    html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace :is([data-case-section],[data-preneed-section]) {padding:20px 12px}
    .compact-facts{grid-template-columns:1fr 1fr;gap:22px 15px}.compact-facts dd{font-size:13px}.compact-section-title{align-items:start}.compact-section-title h2{font-size:17px}.compact-section-title .button{font-size:11px;white-space:normal}
    .compact-progress>div{flex-wrap:wrap;gap:8px}.compact-progress>div>span{flex:1}.compact-overview-aside{display:block}.compact-contact{margin:20px 0}.compact-case-options{max-width:calc(100vw - 60px)}
    html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-foot {padding:10px 12px;gap:8px}
    html body:is([data-layout="compact"],[data-layout="calm"]) .record-workspace-foot .button {font-size:12px;white-space:normal}
  }
}
