.reference-app {
  width: 1250px;
  margin: 0 auto;
}
/* Owner-approved responsive exception: one screen-width owner; print keeps
   its independent document contract. Narrow menus are represented below. */
@media screen {
  .reference-app { width: 100%; margin: 0; }
}
.reference-navigation-close,
.reference-navigation-overlay[hidden] { display: none; }
.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #c5dcc7;
  color: #314f4c;
  display: grid;
  place-items: center;
}
.brand-icon svg {
  width: 27px;
  height: 27px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.reference-app {
  --reference-sidebar-width: 196px;
  --reference-menu-button-height: 50px;
  --reference-menu-icon-size: 44px;
  --reference-menu-icon-gap: 2px;
}
.reference-body {
  padding-top: 10px;
  display: grid;
  grid-template-columns: var(--reference-sidebar-width) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.reference-body .sidebar {
  margin-left: 5px;
  padding-top: 2px;
  position: static;
  inset: auto;
  width: var(--reference-sidebar-width);
  padding: 2px 0 0;
  overflow: visible;
  color: var(--ink);
  background: transparent;
  display: block;
}
.reference-body .workspace {
  margin: 0;
  min-height: 0;
  display: block;
}
.reference-body main {
  padding: 5px 15px 40px 5px;
  margin: 0;
  max-width: none;
}
.reference-local {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding: 12px 0;
  font-size: 11px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}
.reference-local a {
  text-decoration: underline;
}
.reference-primary {
  display: grid;
  /* Source td padding + anchor margin give the first 1px/3px inset.
     The 60px pitch (49px card + 11px gap) is paired-image geometry;
     the source spacer-row attributes were not retained. */
  gap: 11px;
  margin: 3px 0 15px 1px;
}
.reference-body .sidebar nav {
  margin-top: 0;
}
.reference-body .nav-item {
  justify-content: flex-start;
}
.reference-body .nav-item span {
  display: inline;
}
.reference-body .page-heading {
  flex-direction: row;
  align-items: center;
  margin-bottom: 20px;
}
.reference-body .page-heading h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}
.reference-body .page-heading .eyebrow {
  display: none;
}
/* Vue LayoutJournal uses its own title/action row; legacy role homes retain
   their separate table-based title. Insets are paired-screen derivations. */
.reference-body main:has(.reference-journal-heading) {
  padding-top: 9px;
  padding-left: 8px;
}
.reference-journal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  margin-bottom: 24px;
}
.reference-journal-heading h1 {
  margin: 0;
  font-size: 18px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: 0;
}
.reference-journal-heading > .toolbar {
  margin: 0;
  padding: 0;
  border: 0;
  gap: 16px;
}
.reference-journal-heading .btn {
  min-height: 32px;
  height: 32px;
  padding: 0 16px;
  border-radius: 4px;
}
.reference-journal-heading .journal-print-icon { width: 50px; padding: 0; }
.journal-print-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.reference-primary .nav-item {
  margin: 0;
  width: 100%;
  gap: var(--reference-menu-icon-gap);
  padding: 2px 4px;
  text-align: left;
  border: 1px solid #e9efed;
  background: #e9efed;
  color: var(--primary);
  border-radius: 5px;
  font-size: 14px;
}
.reference-groups {
  display: grid;
  gap: 8px;
}
.reference-menu-trigger,
.reference-menu-unknown {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 13px 8px;
  color: inherit;
  background: #9fbebd26;
  font: inherit;
  font-size: 13px;
  /* Observed source group: 41.5px background = 26px padding + 15.5px line. */
  line-height: 15.5px;
  text-align: center;
}
.reference-menu-trigger {
  cursor: pointer;
}
.reference-menu-trigger:hover,
.reference-menu-trigger[aria-expanded="true"] {
  background: #9fbebd55;
}
.reference-submenu {
  position: fixed;
  width: 240px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: #d9e7e3;
  color: #253d43;
  box-shadow: 0 5px 16px #203e3a30;
  z-index: 30;
}
.reference-submenu[hidden] {
  display: none;
}
.reference-submenu .nav-item {
  margin: 0;
  padding: 7px 13px;
  border: 0;
  border-bottom: 1px solid #fff;
  width: 100%;
  color: inherit;
  text-align: left;
  border-radius: 0;
  font: inherit;
  font-size: 13px;
  background: transparent;
}
.reference-menu-trigger.active,
.reference-submenu .nav-item[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}
.reference-submenu .nav-item:hover {
  background: #c4d8d1;
}
.sidebar button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.navigation-gap {
  font-size: 13px;
  line-height: 1.5;
}
/* Observed legacy title region, confirmed on favorites and doctor calendar.
   48px title + 17px following gap; original nested wrapper remains unclaimed. */
.role-home > h1 {
  height: 48px;
  margin: 0 0 17px 1px;
  padding: 12px 0 13px;
  font-size: 18px;
  font-weight: 400;
  line-height: 22px;
  border-bottom: 1px solid var(--line);
}
.role-home-tabs {
  display: flex;
  gap: 8px;
  background: #e5ece9;
  padding: 12px 12px 0;
}
.role-home-tabs button {
  font-size: 12px;
  line-height: 14px;
  padding: 6px 10px;
  border: 0;
  background: #edf3f1;
  color: var(--ink);
  font-family: inherit;
}
.role-home-tabs .active {
  background: white;
  font-weight: 600;
}
.task-month {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 10px 0 16px;
}
.task-month h2 {
  margin: 0;
  font-size: 18px;
  line-height: 22px;
  font-weight: 400;
}
.task-month > button {
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 32px;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 32px;
  cursor: pointer;
}
.task-calendar {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}
.task-calendar th {
  padding: 6px;
  font-size: calc(13px + 1pt);
  background: #e7efea;
  font-weight: 500;
}
.task-calendar td {
  position: relative;
  height: 87px;
  padding: 1px;
  vertical-align: top;
  border: 1px solid #edf0ee;
}
.task-calendar .outside {
  background: white;
}
.task-calendar .even-day {
  background: #f5f7f6;
}
.task-calendar .odd-day {
  background: #ebf0ed;
}
.task-calendar .task-day-number {
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  margin-top: 3px;
  padding: 8px 6px 3px;
  font-size: 24px;
  font-weight: 400;
  line-height: 29px;
  color: var(--ink);
}
.task-calendar .today {
  border-color: var(--primary);
}
.task-calendar button:disabled {
  opacity: 1;
}
.task-calendar .task-day-new { background: #f4e2ac; }
.task-calendar .task-day-active { background: #c7dce5; }
.task-day-counts {
  position: absolute;
  top: 39px;
  right: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.task-day-counts li { min-height: 19px; text-align: right; }
.task-calendar .task-day-counts button {
  border: 0; border-radius: 0; margin: 0; padding: 2px 0;
  background: transparent; color: var(--ink); font: inherit;
  font-size: 13px; line-height: 15px; cursor: pointer;
}
.task-calendar .task-day-counts [data-action="task-day-new"] { color: #ad4b38; }
@media (max-width: 1250px) {
  .reference-app {
    margin-left: 0;
  }
}
@media print {
  .reference-header,
  .reference-body .sidebar {
    display: none;
  }
  .reference-app {
    width: auto;
  }
  .reference-body {
    display: block;
  }
}

/* One decorative owner for every menu level. Existing row height and hit targets remain. */
.menu-art { display:inline-flex; align-items:center; justify-content:center; width:24px; height:15.5px; flex:0 0 24px; pointer-events:none; }
.menu-art img { width:28px; height:28px; max-width:none; object-fit:contain; flex-shrink:0; transform-origin:50% 50%; }
  .reference-app .sidebar :is(.reference-primary, .reference-groups) [data-nav-preview],
  .reference-app header > h1.section-menu-title {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: var(--reference-menu-button-height);
    min-height: var(--reference-menu-button-height);
    padding: 2px 4px;
    gap: var(--reference-menu-icon-gap);
    line-height: 15.5px;
  }
  .reference-app .sidebar .reference-primary [data-nav-preview],
  .reference-app header > h1.section-menu-title {
    font-family: inherit;
    font-size: var(--ui-text);
    font-weight: 400;
    letter-spacing: normal;
    word-spacing: normal;
    color: var(--primary);
  }
  .reference-app .sidebar [data-nav-preview] > .menu-art,
  .reference-app .section-menu-title > .menu-art {
    display: inline-flex;
    width: var(--reference-menu-icon-size);
    height: var(--reference-menu-icon-size);
    flex-basis: var(--reference-menu-icon-size);
  }
  .reference-app .sidebar [data-nav-preview] .menu-art img,
  .reference-app .section-menu-title .menu-art img {
    width: var(--reference-menu-icon-size);
    height: var(--reference-menu-icon-size);
  }
  .reference-app .sidebar [data-nav-preview] .menu-art img[src*="/repair."] {
    width: 36px;
    height: 36px;
  }
  .reference-app .sidebar [data-nav-preview] > .nav-label { min-width: 0; overflow-wrap: anywhere; }
.reference-menu-trigger,.reference-menu-unknown { display:flex; align-items:center; justify-content:flex-start; gap:8px; }
.reference-menu-trigger > span:last-child,.reference-menu-unknown > span:last-child { flex:1; }
@media (prefers-reduced-motion: reduce) {
  .menu-art img { transform:none !important; transition:none !important; animation:none !important; }
}
/* TEST330: six equal table columns; each control spans two columns.
   Legacy CSS uses content-box for the 230px dates and 240px selects. */
.task-filter-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 12px 0 8px;
}
.task-filter-table td {
  border: 0;
  padding: 5px 6px;
  line-height: 12px;
  vertical-align: middle;
}
.task-filter-table .task-filter-label {
  font-size: 13px;
}
.task-filter-table input {
  box-sizing: content-box;
  width: 230px;
  height: auto;
  min-height: 0;
  padding: 2px 4px;
  margin: 2px 0;
  font-size: 12px;
  line-height: normal;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.task-filter-table .single-date-input {
  display: block;
  width: 240px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.task-filter-table .single-date-input > input {
  display: block;
  width: 230px;
}
.task-filter-table .supply-combo-field {
  width: 244px;
  margin: 0;
}
.task-filter-table .supply-combo-input {
  position: relative;
  width: 242px;
  height: 26px;
  min-height: 0;
  padding: 2px 2px 2px 0;
  border: 0;
  background: transparent;
}
.task-filter-table .supply-combo-input > input {
  box-sizing: border-box;
  flex: none;
  width: 240px;
  height: 22px;
  min-height: 0;
  padding-right: 20px;
  margin: 0;
  background: white;
}
.task-filter-table .supply-combo-input::after {
  position: absolute;
  right: 4px;
  width: 16px;
  font-size: 12px;
}
.task-filter-table .supply-combo-menu {
  top: 24px;
  width: 240px;
  padding: 2px 0 0;
  overflow: visible;
}
.task-filter-table .supply-combo-search {
  padding: 10px 0;
}
.task-filter-table .supply-combo-search input {
  box-sizing: border-box;
  width: 100%;
}
.task-filter-table .supply-combo-options {
  max-height: 239px;
  overflow: auto;
}
.task-filter-table .supply-combo-options > button {
  box-sizing: content-box;
  width: calc(100% - 8px);
  min-height: 15px;
  padding: 7px 4px;
  font-size: 12px;
  line-height: 16px;
}
.task-journal > .btn,
#taskFilters > .btn {
  width: 170px;
  height: 35px;
  min-height: 0;
  padding: 0;
  margin: 0 7px 0 0;
  font-size: 13px;
}
.task-journal .role-home-tabs :is(button, a) {
  font-size: 13px;
}
.task-result-table {
  table-layout: fixed;
  width: 100%;
  border: 1px solid var(--line);
  border-collapse: collapse;
}
.task-result-table col:nth-child(1),
.task-result-table col:nth-child(7) {
  width: 40px;
}
.task-result-table col:nth-child(2),
.task-result-table col:nth-child(4),
.task-result-table col:nth-child(5) {
  width: 110px;
}
.task-result-table col:nth-child(3) {
  width: 200px;
}
.task-result-table :is(th, td) {
  padding: 5px 6px;
  line-height: 12px;
  border: 1px solid var(--line);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: break-word;
}
.task-result-table td {
  font-size: 11px;
}
.task-result-table th {
  font-size: calc(11px + 1pt);
}
/* Detail form remains independent of the journal's table layout. */
.task-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  max-width: 800px;
  margin: 18px 0;
}
.task-filter-pair {
  display: grid;
  grid-template-columns: 145px minmax(0, 240px);
  align-items: center;
  gap: 8px;
}
.task-filter-pair .field {
  margin: 0;
  min-width: 0;
}
.task-filter-pair input {
  height: 28px;
  min-width: 0;
  width: 100%;
  font-size: 12px;
}
.task-empty {
  font-size: 14px;
  text-align: center;
  padding: 36px 0;
}
.task-journal form {
  margin-bottom: 18px;
}
.task-record {
  cursor: pointer;
}
.role-home-tabs a {
  font-size: 13px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}
.task-details {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
}
.task-details dd {
  margin: 0;
}
.single-date-legacy footer {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  gap: 8px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #8b9a92;
}
.single-date-legacy footer button {
  padding: 4px 8px;
}
.task-filter-pair input.task-invalid {
  border: 1px solid #b8473a;
  background: #fff5f3;
}
.favorite-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  align-items: start;
}
/* Matched manager screenshots: 489px slots, 1px inset, ~438.5px tables.
   The source nesting is unknown; these dimensions are derived from the image. */
.favorite-table {
  width: calc(90% - 1.8px);
  margin: 1px;
  table-layout: fixed;
  font-size: 12px;
}
.favorite-table,
.favorite-table th,
.favorite-table td,
.favorite-table tbody tr:last-child td {
  border: 1px solid var(--line);
}
.favorite-table th {
  font-size: calc(1em + 1pt);
  line-height: 12px;
  padding: 5px 6px;
  background: #e1e8e4;
}
.favorite-table th:last-child {
  width: 65px;
}
.favorite-table td {
  height: 23px;
  line-height: 12px;
  padding: 3px 6px;
}
.favorite-table tbody tr:nth-child(even) {
  background: #edf2ef;
}
.favorite-table tbody tr:nth-child(odd) {
  background: white;
}
.favorite-name {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: var(--ink);
}
.favorite-actions {
  width: 65px;
  white-space: nowrap;
}
.favorite-actions button {
  display: inline-flex;
  align-items: center;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--primary);
}
.favorite-actions button + button {
  margin-left: 8px;
}
.favorite-actions button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.favorite-help {
  font-size: 13px;
  color: var(--primary);
  margin-left: 15px;
  text-decoration: none;
}

.favorite-help-close {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 16px;
  padding: 0 8px;
}
/* Source legacy printF + printJournalTable. No invented title/filter/signature. */
@page taskJournal {
  size: A4 landscape;
  margin: 4.5mm 12mm;
}
@media print {
  body.task-printing {
    page: taskJournal;
    background: white;
  }
  body.task-printing
    :is(
      .reference-header,
      .sidebar,
      .task-journal > h1,
      .role-home-tabs,
      #taskFilters,
      .task-journal > .btn
    ) {
    display: none !important;
  }
  body.task-printing
    :is(
      .reference-app,
      .reference-body,
      .workspace,
      main,
      .task-journal,
      .task-journal > .table-wrap
    ) {
    display: block !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-height: 0 !important;
    max-width: none !important;
  }
  body.task-printing .task-result-table {
    margin: 5px;
    width: 97%;
    table-layout: fixed;
    color: black;
    border: 1px solid #ccc;
    border-collapse: collapse;
    white-space: normal;
  }
  body.task-printing .task-result-table :is(th, td) {
    border: 1px solid #ccc;
    padding: 5px 6px;
    line-height: 12px;
    overflow-wrap: break-word;
    color: black;
    text-align: left;
    vertical-align: middle;
  }
  body.task-printing .task-result-table td {
    font-size: 11px;
  }
  body.task-printing .task-result-table th {
    font-size: calc(11px + 1pt);
    background: #e2e2e2;
  }
}

/* Source shared OptimaHelpTooltip, verified in supply and transfer journals. */
.reference-journal-title:has(.journal-context-help) { display: flex; align-items: center; }
.journal-context-help { position: relative; display: inline-flex; margin-left: 16px; vertical-align: middle; }
.journal-context-help > svg { width: 16px; height: 16px; color: var(--primary); cursor: help; }
.journal-context-help svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.journal-help-tooltip { display: none; position: absolute; z-index: 80; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); box-sizing: content-box; width: 228px; padding: 8px; border-radius: 7px; background: #253b40; color: white; text-align: center; font-size: 12px; line-height: 22px; font-weight: 400; }
.journal-help-tooltip::before { content: ""; position: absolute; width: 8px; height: 8px; background: inherit; top: -4px; left: calc(50% - 4px); transform: rotate(45deg); }
.journal-help-tooltip::after { content: ""; position: absolute; top: -12px; left: 0; width: 100%; height: 12px; }
.journal-context-help:hover .journal-help-tooltip, .journal-context-help:focus-within .journal-help-tooltip { display: block; }
.journal-help-tooltip .btn { display: flex; align-items: center; justify-content: center; width: 100%; gap: 8px; margin-top: 8px; padding: 0; background: #647c76; color: white; border-color: transparent; font-size: 12px; text-decoration: none; }
.journal-help-tooltip a svg { width: 14px; height: 14px; }

/* Shared source LayoutPartPagination/ElSelect. */
.journal-page-size { position: relative; flex: 0 0 128px; width: 128px; margin: 0; }
.journal-page-size-control { display: flex; align-items: center; height: 28px; border: 1px solid var(--line); border-radius: 4px; background: white; padding: 2px 8px; cursor: pointer; }
.journal-page-size-control:focus-within { border-color: var(--primary); }
.journal-page-size-control > input { display: block; min-width: 0; width: 100%; height: 22px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-family: inherit; font-size: 12px; line-height: 20px; font-weight: 400; color: var(--ink); text-overflow: ellipsis; cursor: pointer; outline: 0; box-shadow: none; }
.journal-page-size-control > span { display: flex; flex: 0 0 14px; color: var(--muted); }
.journal-page-size-control svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.journal-page-size:has([aria-expanded="true"]) .journal-page-size-control svg { transform: rotate(180deg); }
.journal-page-size-options { position: fixed; z-index: 90; box-sizing: border-box; width: max-content; max-width: calc(100vw - 24px); padding: 6px 0; border: 1px solid var(--line); border-radius: 4px; background: white; box-shadow: 0 12px 32px #253b4026; }
.journal-page-size-options[hidden] { display: none; }
.journal-page-size-options::before { content: ""; position: absolute; top: -5px; left: 28px; width: 8px; height: 8px; transform: rotate(45deg); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: white; }
.journal-page-size-options[data-placement="top"]::before { top: auto; bottom: -5px; transform: rotate(225deg); }
.journal-page-size-options > button { display: block; width: 100%; padding: 8px 16px; border: 0; border-radius: 0; background: white; color: var(--ink); font: inherit; font-size: 12px; line-height: 19.2px; text-align: left; white-space: nowrap; cursor: pointer; }
.journal-page-size-options > button[aria-selected="true"] { color: var(--primary); font-weight: 600; }
.journal-page-size-options > button:is(:hover,.is-hovered) { background: #eef2ef; }

/* Source journal ElSelect: popup border/arrow and scrolling options have
   separate owners; legacy/report widgets keep their observed contracts. */
.supply-combo-field[data-combo-variant="journal"] .supply-combo-menu { max-height: none; padding: 0; overflow: visible; border-radius: 4px; }
.supply-combo-field[data-combo-variant="journal"] .supply-combo-menu::before { content: ""; position: absolute; top: -5px; left: calc(50% - 4px); width: 8px; height: 8px; transform: rotate(45deg); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: white; }
.supply-combo-field[data-combo-variant="journal"] .supply-combo-menu[data-placement="top"]::before { top: auto; bottom: -5px; transform: rotate(225deg); }
.supply-combo-field[data-combo-variant="journal"] .supply-combo-options { max-height: 274px; overflow: auto; overscroll-behavior: contain; padding: 6px 0; }
.supply-combo-field[data-combo-variant="journal"] .supply-combo-options > button { min-height: 0; height: auto; margin: 0; padding: 8px 16px; border-radius: 0; font-family: inherit; font-weight: 400; font-size: 12px; line-height: 19.2px; white-space: normal; }
.supply-combo-field[data-combo-variant="journal"] .supply-combo-options > button[aria-selected="true"] { color: var(--primary); font-weight: 700; background: transparent; }
.supply-combo-field[data-combo-variant="journal"] .supply-combo-options > button:is(:hover,.is-hovered) { background: #eef2ef; }
.supply-combo-field[data-combo-variant="journal"]:has(input[aria-expanded="true"]) .supply-combo-toggle svg { transform: rotate(180deg); }
/* Source ElSelect swaps the single trailing caret for Clear only on hover. */
.supply-combo-field[data-combo-variant="journal"] .supply-combo-input { position: relative; }
.supply-combo-field[data-combo-variant="journal"] .supply-combo-clear { position: absolute; z-index: 2; top: 0; right: 0; width: 30px; height: 30px; border-radius: 0; visibility: hidden; }
.supply-combo-field[data-combo-variant="journal"]:hover .supply-combo-clear:not([hidden]) { visibility: visible; }
.supply-combo-field[data-combo-variant="journal"]:hover:has(.supply-combo-clear:not([hidden])) .supply-combo-toggle { visibility: hidden; }

@media screen and (width > 1249px) {
  .reference-app {
    --reference-navigation-width: var(--reference-sidebar-width);
    --reference-brand-height: 60px;
    --reference-service-height: 32px;
    position: relative;
    display: grid;
    grid-template-columns: var(--reference-navigation-width) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }
  .reference-app[data-navigation-collapsed] { --reference-navigation-width: 76px; }
  .reference-app::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: calc(var(--reference-navigation-width) - .5px);
    width: 1px;
    z-index: 1;
    background: var(--line);
    pointer-events: none;
  }
  .reference-app > .reference-header { grid-area: 1 / 2; min-width: 0; }
  .reference-app > .reference-body { display: contents; }
  .reference-app .reference-body > .sidebar {
    grid-area: 1 / 1 / 3 / 2;
    box-sizing: border-box;
    width: auto;
    margin: 0;
    padding: var(--reference-brand-height) 4px 0;
  }
  .reference-app .reference-body > .workspace {
    grid-area: 2 / 2;
    min-width: 0;
  }
  .reference-app .reference-body > .workspace > main { padding: 15px 15px 40px 16px; }
  .reference-app:not(:has(> .reference-header .source-header-toolbar:not(:empty)))
    .reference-body > .workspace > main { padding-top: 12px; }

  .reference-app[data-navigation-collapsed] .reference-body > .sidebar { padding-inline-end: 24px; }
  .reference-app[data-navigation-collapsed] :is(.reference-primary, .reference-groups, .reference-local) {
    grid-template-columns: minmax(0, 1fr);
  }
  .reference-app[data-navigation-collapsed] .reference-menu-group { min-width: 0; }

  .reference-app[data-navigation-collapsed] .sidebar [data-nav-preview]:not(.reference-submenu *) {
    position: relative;
  }
  .reference-app[data-navigation-collapsed] .sidebar [data-nav-preview]:not(.reference-submenu *):not(:is(:hover, :focus-visible:not(.sidebar:has([data-nav-preview]:hover) *), .reference-menu-trigger[aria-expanded="true"])) {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
  }
  .reference-app[data-navigation-collapsed] .sidebar [data-nav-preview]:not(.reference-submenu *):not(:is(:hover, :focus-visible:not(.sidebar:has([data-nav-preview]:hover) *), .reference-menu-trigger[aria-expanded="true"])) > .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .reference-app[data-navigation-collapsed] .sidebar [data-nav-preview]:not(.reference-submenu *):is(:hover, :focus-visible:not(.sidebar:has([data-nav-preview]:hover) *), .reference-menu-trigger[aria-expanded="true"]) {
    z-index: 29;
    width: var(--reference-sidebar-width);
  }

  .reference-app[data-navigation-collapsed] .sidebar [data-nav-preview]:not(.reference-submenu *):not(:is(:hover, :focus-visible:not(.sidebar:has([data-nav-preview]:hover) *), .reference-menu-trigger[aria-expanded="true"])) .expense-nav-count {
    position: absolute;
    inset: 2px 2px auto auto;
    margin: 0;
  }
  .reference-app[data-navigation-collapsed] .reference-local > span { display: none; }
  .reference-app[data-navigation-collapsed] .reference-local > a { align-items: center; text-decoration: none; }
  .reference-app[data-navigation-collapsed] .reference-local > a:not(:is(:hover, :focus-visible))::before { font-size: 20px; content: "↗" / ""; }
  .reference-app[data-navigation-collapsed] .reference-local > a[href="#help"]:not(:is(:hover, :focus-visible))::before { content: "?" / ""; }
}

/* The same source menu becomes an in-flow group list inside a narrow drawer.
   Do not mask content overflow here: each business workspace owns its tables,
   filters and forms and is accepted separately. */
@media screen and (max-width: 1249px) {
  .reference-app .reference-body { display: block; padding-top: 8px; }
  .reference-app .reference-body .workspace { min-width: 0; width: 100%; }
  .reference-app .reference-body main { min-width: 0; padding: 8px 12px 32px; }
  .reference-app .reference-body .sidebar {
    display: none; position: fixed; inset: 0 auto 0 0;
    width: min(320px, calc(100% - 48px)); max-width: 100%;
    margin: 0; padding: 12px; overflow-y: auto; overscroll-behavior: contain;
    background: var(--reference-canvas); box-shadow: 12px 0 32px #253b4033; z-index: 1101;
  }
  .reference-app[data-navigation-open] .sidebar { display: block; }
  .reference-app .reference-navigation-close { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface, #fff); width: 100%; min-height: 44px; margin: 0 0 12px; padding: 8px 12px; }
  .reference-app .reference-navigation-overlay { position: fixed; inset: 0; z-index: 1100; border: 0; border-radius: 0; padding: 0; background: #17233866; width: 100%; height: 100%; }
  .reference-app .reference-navigation-overlay[hidden] { display: none; }
  .reference-app .reference-submenu { position: static; width: 100%; max-height: none; box-shadow: none; }
  .reference-app .reference-submenu .nav-item { min-height: 44px; }
  .reference-app .reference-menu-trigger { min-height: 44px; }
  html:has(.reference-app[data-navigation-open]) { overflow: hidden; }
}

/* Approved responsive presentation: fixed table cells must not inherit the
   desktop nowrap into a narrow viewport. Keep full labels and typography. */
@media screen and (max-width: 760px) {
 .task-calendar th {white-space:normal;overflow-wrap:anywhere;line-height:1.3;}
 .favorite-groups {grid-template-columns:minmax(0,1fr);}
 .favorite-table {width:100%;margin:0;white-space:normal;overflow-wrap:anywhere;}
 .favorite-table :is(th,td),.favorite-table .favorite-name {white-space:normal;overflow-wrap:anywhere;line-height:1.3;}
}

/* Responsive journal chrome has one owner. Long titles and existing actions
   wrap at narrow widths; desktop geometry and print remain unchanged. */
@media screen and (max-width:760px) {
  .reference-journal-heading { height:auto; min-height:36px; flex-wrap:wrap; gap:12px; }
  .reference-journal-heading > h1,.reference-journal-heading > .reference-journal-title { min-width:0; max-width:100%; }
  .reference-journal-heading > .toolbar { max-width:100%; flex-wrap:wrap; }
  .reference-journal-title:has(.journal-context-help) h1 { min-width:0; }
}

/* Task filters are a layout table, not a data grid. Preserve label/control
   order and every existing action while removing fixed desktop input widths. */
@media screen and (max-width:1000px) {
  .task-filter-table,.task-filter-table > tbody { display:block; width:100%; }
  .task-filter-table > tbody > tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); }
  .task-filter-table td { display:block; min-width:0; }
  .task-filter-table .single-date-input,.task-filter-table .supply-combo-field,
  .task-filter-table .supply-combo-input { width:100%; max-width:100%; box-sizing:border-box; }
  .task-filter-table input,.task-filter-table .single-date-input > input { width:100%; min-width:0; max-width:100%; box-sizing:border-box; }
  .task-filter-table .supply-combo-input > input { flex:1 1 auto; width:100%; }
  .task-filter-table .supply-combo-menu { width:100%; max-width:100%; box-sizing:border-box; }
}
@media screen and (max-width:600px) {
  .task-filter-table > tbody > tr { grid-template-columns:minmax(0,1fr); }
}

@media screen {
  .reference-app .sidebar [data-menu-search-excluded],
  .reference-app .sidebar[data-menu-search-filtered] .reference-local { display: none !important; }
  .menu-search-empty { margin: 8px; color: var(--muted); font-size: var(--ui-secondary); }
}
@media screen and (min-width: 1250px) {
  .reference-app:not([data-navigation-collapsed]) .sidebar[data-menu-search-filtered] .reference-submenu:not([hidden]) {
    position: static;
    box-sizing: border-box;
    width: 100%;
    max-height: none;
    margin: 4px 0;
  }
  .reference-app[data-navigation-collapsed] .sidebar .menu-search-empty { display: none; }
}
