/* Use the space left by the sidebar, including when the rail is collapsed. */
.work-area {container: owner-content / inline-size}
.office-panel .card > :last-child {margin-block-end:0}
.office-panel .section-head > *, .office-panel .chart-header > * {max-width:100%;min-width:0}
.office-panel .chart-header .office-heading {text-wrap:pretty}
.office-panel .office-empty > div {min-width:0}
.office-panel .table-wrap, .office-panel .loyal-history {scrollbar-width:thin}
.office-panel .table-wrap :is(td,th) {vertical-align:middle}
.office-panel .staff-form {align-items:center}
.office-panel .staff-form > select {width:auto;max-width:18rem}
.office-panel .task-list button > span {min-width:0}
.office-panel .task-list strong {line-height:1.4;margin-block:.2rem}

/* Keep the period and branch controls together while leaving room for actions. */
.office-panel form.card.performance-filter,
.office-panel form.card[data-filter],
.office-panel form.card.finance-filter {
  display:grid;
  align-items:end;
  grid-template-columns:repeat(2,minmax(9rem,1fr)) minmax(11rem,1.45fr) max-content;
  gap:.75rem 1rem;
  padding:clamp(1rem,2vw,1.4rem);
}
.office-panel form.card.performance-filter {
  grid-template-columns:minmax(12rem,1.5fr) minmax(11rem,1fr) max-content;
}
.office-panel form.finance-filter .grid {display:contents}
.office-panel form.card.finance-filter .grid label:last-child {grid-column:auto}
.office-panel form.card:is(.finance-filter,.performance-filter,[data-filter]) > button {min-height:43px;justify-content:center}
.office-panel form.card:is(.finance-filter,.performance-filter,[data-filter]) > :is(output,[role="alert"]) {grid-column:1/-1}
.office-panel form.card[data-filter] label {min-width:0}

.finance-charts .chart-card {container: owner-chart / inline-size}
@container owner-chart (max-width:30rem) {
  .chart-dates .chart-axis-extra {display:none}
  .chart-foot {flex-wrap:wrap}
  .chart-detail dl {gap:.5rem 1rem}
}
.office-panel .chart-header p,
.office-panel .performance-content .card > p.muted {max-width:78ch}
.office-panel .perf-chart-row {min-width:0}
.office-panel .performance-summary-row > b {flex:none;max-width:45%}
.office-panel .performance-notice {line-height:1.5}

.stock-sections, .purchase-board .purchase-tabs {
  display:flex;align-items:stretch;justify-self:start;flex-wrap:wrap;
  max-width:100%;gap:3px;padding:4px;background:#eeece6;border:1px solid #ded9cd;border-radius:11px;
}
.office-panel :is(.stock-sections,.purchase-tabs) > button {
  min-height:36px;justify-content:center;gap:.45rem;padding:.4rem .8rem;line-height:1.35;
  border:1px solid transparent;background:transparent;color:#59554e;font-size:.86rem;
}
.office-panel :is(.stock-sections,.purchase-tabs) > button[aria-pressed=true] {
  background:white;color:var(--ink);border-color:#dcd7cb;box-shadow:0 1px 3px #27211712;
}
.office-panel :is(.stock-sections,.purchase-tabs) > button:hover {background:#faf9f6}
.purchase-board .actions:has(label) {align-items:end;gap:.85rem;margin-bottom:1rem}
.purchase-board .actions label {flex:0 1 15rem}
.purchase-board .actions:has([data-start-supplier]) {margin-bottom:1rem}
.office-panel [data-portions] h3 {margin-top:1.1rem}
.office-panel [data-portions] form.actions {align-items:end}
.office-panel [data-recipe] {display:grid;gap:1rem}
.office-panel [data-recipe] > button {justify-self:start}
.office-panel [data-recipe] fieldset {display:grid;gap:.75rem}
.office-panel [data-recipe] fieldset > button {justify-self:start}
.office-panel [data-recipe] .actions {gap:.7rem;align-items:end}
.office-panel [data-recipe] .actions + .actions {margin-top:.75rem}
.office-panel [data-recipe] .actions label {flex:1;min-width:min(100%,9rem)}
.office-panel .performance-metrics {grid-template-columns:repeat(4,minmax(0,1fr))}
.office-panel .performance-metrics:has(>:last-child:nth-child(3)) {grid-template-columns:repeat(3,minmax(0,1fr))}
.office-panel .performance-metrics .finance-metric {justify-content:flex-start;gap:.65rem}
.office-panel .performance-metrics .metric-top {align-items:flex-start}
.office-panel .performance-metrics .metric-top .metric-icon {width:28px;height:28px}
.office-panel .performance-metrics .metric-value {margin-block:auto 0}
.office-panel .performance-metrics small {line-height:1.45}

@container owner-content (max-width:50rem) {
  .office-panel .finance-charts {grid-template-columns:minmax(0,1fr)}
  .office-panel .performance-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@container owner-content (max-width:42rem) {
  .office-panel form.card.finance-filter,
  .office-panel form.card[data-filter] {grid-template-columns:repeat(2,minmax(0,1fr))}
  .office-panel form.card:is(.finance-filter,[data-filter]) > button {justify-self:stretch}
}
@container owner-content (max-width:40rem) {
  .office-panel .section-head {gap:.75rem 1rem;align-items:start}
  .office-panel form.card.performance-filter {grid-template-columns:repeat(2,minmax(0,1fr))}
  .office-panel form.card.performance-filter > button {grid-column:1/-1;justify-self:stretch}
  .office-panel .task-summary {gap:.45rem}
  .office-panel .task-summary > span {text-align:center;flex:1 1 6rem}
  .office-panel .performance-metrics,
  .office-panel .performance-metrics:has(>:last-child:nth-child(3)),
  .office-panel.payouts-panel .payout-stats {
    grid-template-columns:minmax(0,1fr);gap:0;
    background:#fff;border:1px solid var(--line);border-radius:var(--office-radius);
  }
  .office-panel .performance-metrics > .card,
  .office-panel.payouts-panel .payout-stat {
    display:grid;grid-template-columns:minmax(0,1fr) auto;
    align-items:center;justify-items:start;gap:.2rem 1rem;
    padding:.85rem 1rem;border:0;border-radius:0;background:transparent;box-shadow:none;
  }
  .office-panel .performance-metrics > .card + .card,
  .office-panel.payouts-panel .payout-stat + .payout-stat {border-top:1px solid var(--line)}
  .office-panel .performance-metrics .metric-top {flex-direction:row-reverse;justify-content:end;align-items:center}
  .office-panel .performance-metrics .metric-top .metric-icon {width:23px;height:23px;border:0;border-radius:6px}
  .office-panel .performance-metrics .metric-top .office-icon {width:14px;height:14px}
  .office-panel .performance-metrics .metric-value,
  .office-panel.payouts-panel .payout-stat>strong {font:650 clamp(1.04rem,4.3vw,1.3rem)/1.2 var(--display);text-align:right;justify-self:end}
  .office-panel .performance-metrics small,.office-panel.payouts-panel .payout-stat>small {grid-column:1/-1;font-size:.8rem;overflow-wrap:anywhere}
  .office-panel .performance-metrics .metric-value {margin:0}
  .office-panel.payouts-panel .payout-stat:is(:hover,:focus-visible) {background:var(--soft)}
  .office-panel.payouts-panel .payout-stat:first-child {border-radius:var(--office-radius) var(--office-radius) 0 0}
  .office-panel.payouts-panel .payout-stat:last-child {border-radius:0 0 var(--office-radius) var(--office-radius)}
  .office-panel .table-wrap:has(.staff-form) {overflow:visible;border:0}
  .office-panel table:has(.staff-form), .office-panel table:has(.staff-form) tbody {display:block}
  .office-panel table:has(.staff-form) thead {position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
  .office-panel table:has(.staff-form) tbody tr {
    display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:start;gap:.65rem .75rem;
    padding:.85rem 0;border-top:1px solid var(--line);
  }
  .office-panel table:has(.staff-form) td {min-width:0;border:0;padding:0;overflow-wrap:anywhere}
  .office-panel table:has(.staff-form) td:first-child {font-weight:620}
  .office-panel table:has(.staff-form) td:nth-child(2) {justify-self:end}
  .office-panel table:has(.staff-form) td:last-child {grid-column:1/-1}
  .office-panel table:has(.staff-form) td:last-child:not(:has(form)) {display:none}
  .office-panel .staff-form {display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) auto;gap:.4rem}
  .office-panel .staff-form > :is(button,select) {width:100%;min-width:0;min-height:40px;font-size:.86rem}
}
@container owner-content (max-width:29rem) {
  .stock-sections,.purchase-board .purchase-tabs {
    justify-self:stretch;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;
  }
  .purchase-board .purchase-tabs {grid-template-columns:repeat(3,minmax(0,1fr))}
  .office-panel :is(.purchase-tabs,.stock-sections) > button {flex-direction:column;min-width:0;padding:.5rem .25rem;gap:.3rem;font-size:.79rem}
  .purchase-board .actions:has(> label) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .purchase-board .actions label {min-width:0}
  .office-panel .performance-summary-row {flex-wrap:wrap;gap:.4rem .8rem}
  .office-panel .performance-summary-row > b {max-width:none;text-align:left}
}
@container owner-content (min-width:22.01rem) and (max-width:28rem) {
  .office-panel form.card.performance-filter {grid-template-columns:minmax(10.5rem,1fr) auto}
  .office-panel form.card.performance-filter label:first-child {grid-column:1/-1}
  .office-panel form.card.performance-filter > button {grid-column:auto}
}
@container owner-content (max-width:22rem) {
  .office-panel form.card.performance-filter {grid-template-columns:minmax(0,1fr)}
  .office-panel .catalog-filters {grid-template-columns:minmax(0,1fr)}
  .office-panel .staff-form {grid-template-columns:repeat(2,minmax(0,1fr))}
  .office-panel .staff-form > button {grid-column:1/-1}
  .office-panel .chart-header {gap:.65rem}
}
.report-method > p {max-width:78ch;margin:.7rem 0 0;line-height:1.55;font-size:.9rem}
