.home-board-modes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.home-board-modes button[aria-pressed="true"] {
  background: #efecff;
  border-color: #8a7bd8;
  color: #403382;
}
.home-board-hint {
  font-size: 0.875rem;
  color: #48576c;
}
#content .home-packed-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--board-cols), minmax(0, 1fr));
  grid-auto-rows: 12px;
  align-items: start;
  align-content: start;
  gap: 0 12px;
}
#content .home-packed-grid > :is(.home-block, .kw-tile) {
  position: relative;
  grid-column: var(--board-col) !important;
  align-self: start;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: auto !important;
}
#content .home-packed-grid > .home-board-sized {
  height: auto !important;
  min-height: var(--board-height);
  display: flex;
  flex-direction: column;
}
#content .home-board-sized > :is(.kw-frame, .kw-tiles, .home-metric, .card) {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}
#content .home-packed-grid .home-controls {
  display: none;
}
#content .home-edit .home-controls {
  display: flex;
  position: absolute;
  z-index: 3;
  top: 2px;
  right: 4px;
  margin: 0;
  background: #fff;
  padding: 2px 5px;
  border-radius: 5px;
  box-shadow: 0 1px 4px #26253a24;
}
.home-edit .home-controls .pill {
  display: none;
}
.home-packed-grid [data-board-grip] {
  display: none;
}
#content .home-edit [data-board-grip] {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 7px;
  color: #483791;
  border: 1px solid #b9aee8;
  background: #f8f6ff;
  touch-action: none;
  user-select: none;
}
.home-edit [data-board-grip="move"] {
  top: 0;
  left: 0;
  cursor: grab;
}
.home-edit [data-board-grip="size"] {
  bottom: 0;
  right: 0;
  cursor: nwse-resize;
}
#content .home-edit > .home-block {
  touch-action: auto;
}
#content .home-edit [data-home-block="metrics"] > [data-board-grip="move"] {
  top: -12px;
  left: -7px;
}
#content .home-edit [data-home-block="metrics"] > [data-board-grip="size"] {
  bottom: -10px;
  right: -6px;
}
.home-board-preview {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  border: 2px dashed #6654c0;
  box-sizing: border-box;
  border-radius: 10px;
  padding: 6px;
  background: #f1edffcc;
  color: #312668;
  font-weight: 650;
}
.home-packed-grid[data-board-gesture] {
  user-select: none;
}
#content .home-packed-grid > .home-block {
  container-type: inline-size;
}
#content .home-packed-grid > .home-block > .kw-frame {
  max-width: 100%;
  overflow: visible;
}
@container (max-width: 620px) {
  .home-block > .home-pulse-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-block .toolbar {
    flex-wrap: wrap;
  }
}

/* The layout chooser belongs to the header action, including while Auto is selected. */
.home-settings-anchor {
  position: relative;
  display: inline-flex;
}
.home-settings-anchor > .home-board-modes {
  position: absolute;
  z-index: 20;
  inset: calc(100% + 6px) auto auto var(--menu-left, 0px);
  display: grid;
  justify-items: start;
  gap: 8px;
  margin: 0;
  width: min(17rem, calc(100vw - 24px));
  padding: 12px;
  background: var(--surface, #fff);
  border: 1px solid #d7dce6;
  border-radius: 10px;
  box-shadow: 0 6px 22px #22213b20;
  text-align: start;
}
.home-settings-anchor [hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .home-settings-anchor > .home-board-modes {
    position: static;
    width: 100%;
  }
  .home-settings-anchor {
    flex-wrap: wrap;
  }
}

#content
  .home-packed-grid
  > .home-block:not(.home-board-sized)
  > :is(.kw-frame, .kw-tiles) {
  max-block-size: none;
  overflow: visible;
}
#content .home-dashboard-grid [data-home-block="operations"] > .card {
  padding: 12px 14px;
}
#content .home-activity-list {
  display: block;
  max-height: 12rem;
  overflow: auto;
  overscroll-behavior: auto;
  scrollbar-gutter: stable;
}
#content .home-activity-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid #dce3ec;
  border-radius: 0;
  background: transparent;
  padding: 6px 0;
}
#content .home-activity-item h3 {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 650;
  margin: 0;
  overflow-wrap: anywhere;
}
#content .home-activity-item p,
#content .home-activity-item time {
  font-size: 11.5px;
  line-height: 1.35;
  margin: 1px 0 0;
  color: #4d6078;
}
#content .home-activity-item time {
  white-space: normal;
  max-width: 8.8em;
  text-align: end;
}
#content [data-home-block="financeResult"] .metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 6px;
}
#content [data-home-block="financeResult"] .metric {
  display: grid;
  align-content: start;
  align-items: baseline;
  gap: 4px;
  padding: 8px 10px;
  min-width: 0;
  min-height: 0;
  container-type: inline-size;
}
#content [data-home-block="financeResult"] .metric > span {
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#content .home-dashboard-grid [data-home-amount] {
  min-inline-size: 0;
  max-inline-size: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}
#content [data-home-block="financeResult"] .metric > b[data-home-amount] {
  font-size: clamp(13px, var(--amount-fit), 19px);
  line-height: 1.2;
}
#content [data-home-amount] > .amount-group {
  display: inline;
  font: inherit;
  color: inherit;
  white-space: nowrap;
}
#content .home-dashboard-grid .kw-tile {
  container-type: inline-size;
}
#content .kw-tile .home-metric > b[data-home-amount] {
  font-size: clamp(14px, var(--amount-fit), 20px);
}
#content
  .home-dashboard-grid
  :is(.metric, .home-sales-pair, .home-sales-pair > span) {
  min-width: 0;
}
@container (max-width:390px) {
  .home-activity-item {
    grid-template-columns: minmax(0, 1fr) 5.7em !important;
  }
}

/* The owner console is a full-width conversation, not a clipped summary tile. */
#content
  .home-packed-grid
  > .home-block[data-home-block="pulse"]
  > .home-pulse-card.kw-frame {
  height: auto;
  max-block-size: none;
  max-height: none;
  overflow: visible;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
#content [data-home-block="pulse"] .home-pulse-main {
  align-content: start;
}
#content [data-home-block="pulse"] .home-pulse-side {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  align-items: start;
}
#content [data-home-block="pulse"] .home-pulse-main p {
  max-width: none;
}
.home-quick-capture {
  margin-top: 16px;
}
.owner-assistant-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.owner-assistant-modes button {
  min-height: 44px;
}
.owner-assistant-modes button[aria-pressed="true"] {
  background: var(--kw-paper, #f6f4ff);
  border-color: var(--kw-accent, #574bd6);
  color: var(--text, #172538);
}
.owner-assistant-modes small {
  flex: 1 1 16rem;
  color: #4d6078;
  font-size: 12px;
}
.home-quick-capture-row:has(.quick-command-field) {
  grid-template-columns: minmax(0, 1fr) repeat(4, 46px);
}
.quick-command-field {
  position: relative;
  min-width: 0;
  width: 100%;
}
.home-quick-capture-row .quick-command-field #command {
  padding-inline-end: 56px;
  height: 48px;
}
.home-quick-capture-row .quick-command-field #run {
  position: absolute;
  inset: 2px 2px 2px auto;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 12px;
}
.owner-assistant-thread [hidden] {
  display: none;
}
@media (max-width: 620px) {
  .home-quick-capture-row:has(.quick-command-field) {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }
  .quick-command-field {
    grid-column: 1 / -1;
  }
  .home-quick-capture-row:has(.quick-command-field) > button {
    width: 100%;
    min-height: 44px;
  }
}

#content .home-context-bar {
  padding: 10px 14px;
  gap: 6px;
}
#content .home-context-bar .home-context-summary {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
#content .home-context-summary label {
  margin: 0;
  min-width: 0;
}
#content .home-context-summary select {
  max-width: 100%;
  min-height: 34px;
}
#content .home-context-summary small {
  color: var(--muted);
}
#content .home-finance-group,
#content .home-team-group {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}
#content .home-finance-group > .card,
#content .home-team-group > .card {
  border: 0;
  box-shadow: none;
  padding: 0;
}
#content .home-finance-group > details > summary {
  cursor: pointer;
}
#content .home-team-tasks {
  max-width: 22rem;
}
#content .home-team-tasks .kw-tile {
  min-height: 82px;
}
#content .workforce-widget-totals .ui-help-panel {
  white-space: normal;
}
#restore-home-setup[hidden],
#onboarding-home-nudge[hidden] {
  display: none;
}

#content .home-finance-group [hidden] {
  display: none !important;
}
.home-finance-settings fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 4px 0;
}
.home-finance-settings label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.home-finance-settings input[type="checkbox"] {
  inline-size: auto;
}
.home-finance-settings {
  justify-self: start;
  max-width: 100%;
}
.home-chart-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
#content .home-business-chart-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-inline-end: 32px;
}
#content .home-business-chart-tabs {
  flex-wrap: wrap;
  gap: 4px;
}
#content .home-business-chart-tabs button,
#content .home-chart-options select {
  padding-block: 4px;
  font-size: 13px;
}
#content .home-chart-options select {
  max-width: 100%;
}
#content .home-worker-heading {
  background: transparent;
  color: inherit;
  border: 0;
  font: inherit;
  padding: 0;
  text-align: left;
}
#content [data-worker-select-period] {
  width: auto;
  max-width: 100%;
}
#content .workforce-widget-totals > span:has(.ui-help-panel:not([hidden])) {
  position: relative;
  z-index: 2;
}

#content .home-finance-group .home-result-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
#content .home-result-tiles > .metric {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  padding: 8px;
}
#content .home-result-tiles > .metric > b {
  font-size: clamp(13px, 1.6vw, 19px);
  overflow-wrap: anywhere;
}
@container (max-width: 560px) {
  #content .home-finance-group .home-result-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
#content .home-workers-widget .home-worker-list-scroll {
  max-height: min(55vh, 28rem);
  overflow-y: auto;
  overscroll-behavior-y: auto;
}

#content .home-team-group .ai-chat-log {
  max-height: 22rem;
  height: auto;
  overflow-y: auto;
  overscroll-behavior-y: auto;
}
#content .home-result-tiles > .metric {
  border: 1px solid var(--border, #dce4ef);
  border-radius: 10px;
}

/* Stable grid slots; status changes do not resize the surrounding board.
   The owner console and complete finance group retain natural height. */
#content .home-packed-grid > .home-board-bounded {
  height: var(--board-height) !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#content
  .home-packed-grid
  > .home-block.home-board-bounded
  > :is(.kw-frame, .kw-tiles, .home-metric, .card) {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior: auto;
  scrollbar-gutter: stable;
}
#content .kw-tile.home-board-bounded {
  overflow: auto;
  overscroll-behavior: auto;
  scrollbar-gutter: stable;
}
#content .kw-tile.home-board-bounded > .home-metric {
  flex: none;
  height: auto;
  max-height: none;
  overflow: visible;
}
#content .home-block[data-home-block="pulse"],
#content .home-block[data-home-block="metrics"] {
  min-height: var(--home-reading-height, 0px);
}

/* Summary widgets grow with their content; only an explicitly opened list or
   the conversation transcript owns a vertical scroll area. Manual height is
   a minimum on these cards, so a saved small size cannot hide controls. */
#content .home-packed-grid > .home-board-content > :is(.kw-frame, .card) {
  height: auto;
  max-height: none;
  max-block-size: none;
  overflow: visible;
}
#content .home-finance-header,
#content .home-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-inline-end: 28px;
}
#content .home-finance-header h2,
#content .home-team-header h2 {
  margin: 0;
}
#content .home-team-group {
  grid-template-columns: minmax(0, 1fr);
}
#content .home-team-header {
  min-width: 0;
}
#content .home-finance-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
#content .home-finance-header .home-finance-settings {
  position: relative;
}
#content .home-finance-header .home-finance-settings[open] {
  flex: 1 1 100%;
}
#content .home-finance-header-actions > button,
#content .home-finance-header .home-finance-settings > summary {
  font-size: 12px;
  font-weight: 600;
  min-height: 34px;
}
#content .home-team-group .home-team-tasks {
  flex: 0 1 22rem;
  width: 22rem;
  min-width: 0;
  max-width: 100%;
}
#content .home-team-group .home-team-tasks .kw-tile {
  min-height: 0;
  height: auto;
  overflow: visible;
}
#content .home-team-tasks [data-home-ai-card] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  padding: 8px 38px 8px 12px;
  text-align: left;
}
#content .home-team-tasks [data-home-ai-card] > span,
#content .home-team-tasks [data-home-ai-card] > small {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}
#content .home-team-tasks [data-home-ai-card] > span {
  grid-area: 1 / 1;
  padding-inline-end: 0;
}
#content .home-team-tasks [data-home-ai-card] > b {
  grid-area: 1 / 2;
  font-size: 20px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#content .home-team-tasks [data-home-ai-card] > small {
  grid-row: 2;
  grid-column: 1 / -1;
}
#content .home-team-tasks [data-home-ai-card] > i {
  grid-area: 1 / 3;
  display: inline;
  font-style: normal;
}
#content .home-team-goals {
  border-top: 1px solid var(--kw-line, #cfe7d8);
  border-bottom: 1px solid var(--kw-line, #cfe7d8);
  padding: 8px 0;
}
#content .home-team-goals > summary {
  font-size: 14px;
  font-weight: 600;
}
#content .home-team-goals > .card {
  padding: 12px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#content .home-team-goals .toolbar h2,
#content .home-team-goals .toolbar .muted {
  display: none;
}
#content .home-team-goals .home-calm-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  min-height: 0;
  padding: 10px 12px;
  gap: 8px;
}
#content .home-orders-widget .metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 8px;
}
#content .home-orders-widget .metric {
  min-height: 0;
  padding: 10px 12px;
}
#content .home-orders-widget .metric > span {
  font-size: 12px;
}
#content .home-orders-widget .metric > b {
  font-size: 22px;
  line-height: 1.25;
}

#content .home-context-summary select,
#content .home-context-summary > .ghost {
  background-color: var(--kw-paper, #f0faf4);
  border-color: var(--kw-line, #cfe7d8);
  color: var(--text, #172538);
}

/* One home control surface: company/direction, period, actions and source health. */
#content .home-context-compact {
  padding: 14px 18px;
  gap: 12px;
  overflow: visible;
}
.home-context-compact .home-context-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-inline-end: 30px;
}
.home-context-compact .home-scope-picker {
  position: relative;
  min-width: 0;
  max-width: 100%;
}
.home-context-compact .home-scope-picker > summary,
.home-context-compact .home-current-sources > summary {
  min-height: 34px;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
}
.home-context-compact .home-scope-picker > summary {
  overflow-wrap: anywhere;
}
.home-context-compact .home-scope-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 14px;
  width: min(360px, calc(100vw - 72px));
  padding: 16px;
  border: 1px solid var(--line, #dbe4f0);
  border-radius: 12px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 24px rgb(15 23 42 / 12%);
}
.home-context-compact .home-scope-options label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  font-weight: 500;
  width: 100%;
}
.home-context-compact .home-scope-options select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
}
.home-context-compact .home-period-picker {
  flex: 0 0 auto;
  width: auto;
}
.home-context-compact .home-period-picker select {
  width: auto;
  min-width: 110px;
  min-height: 34px;
  border-color: transparent;
  background-color: transparent;
  font-size: 14px;
}
.home-context-compact [data-home-header-actions] {
  flex: 1 1 auto;
  min-width: 0;
}
#content :is(.home-context-compact, .home-header-utilities) .app-page-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
:is(.home-context-compact, .home-header-utilities) .app-page-heading {
  display: contents;
}
:is(.home-context-compact, .home-header-utilities) #page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
:is(.home-context-compact, .home-header-utilities) .top-actions {
  width: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
}
:is(.home-context-compact, .home-header-utilities) .app-user-status {
  flex: 0 1 auto;
  width: auto;
  font-size: 12px;
}
:is(.home-context-compact, .home-header-utilities) .kolegin-pwa-panel {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
:is(.home-context-compact, .home-header-utilities)
  :is(.app-page-header, .home-update-controls)
  button,
:is(.home-context-compact, .home-header-utilities) .kolegin-pwa-help > summary {
  min-height: 34px;
  padding: 6px 9px;
  border-color: transparent;
  background-color: transparent;
  color: var(--text, #172538);
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}
:is(.home-context-compact, .home-header-utilities)
  :is(.app-page-header, .home-update-controls)
  button:hover {
  background-color: var(--kw-paper, #f0faf4);
  border-color: var(--kw-line, #cfe7d8);
}
#content .home-context-compact > .home-context-summary {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 0 0;
  border-top: 1px solid var(--kw-line, #cfe7d8);
}
.home-context-compact .home-current-sources {
  flex: 1 1 240px;
  min-width: 0;
}
.home-context-compact .home-current-sources > summary {
  width: fit-content;
  max-width: 100%;
  color: var(--success, #237349);
  font-size: 12px;
  font-weight: 500;
}
.home-context-compact .home-current-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 10px;
}
.home-context-compact .home-current-source-list .home-source-badge.ok {
  display: inline-flex;
  background: transparent;
  border-color: transparent;
  font-weight: 500;
}
.home-context-compact .home-update-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-inline-start: auto;
  min-height: 34px;
}
.home-context-compact .home-update-controls small {
  font-size: 12px;
}
#content .home-context-compact .home-pending-sources {
  gap: 6px;
}
#content .home-context-compact .home-source-badge.bad {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}
#content .home-context-compact .home-source-badge.bad::before {
  background: #dc2626;
}
.home-context-compact > [data-home-disclosure="source-status"] {
  font-size: 12px;
}
@media (max-width: 620px) {
  #content .home-context-compact {
    padding: 12px;
  }
  .home-context-compact .home-context-toolbar {
    gap: 8px;
  }
  .home-context-compact [data-home-header-actions] {
    flex-basis: 100%;
  }
  :is(.home-context-compact, .home-header-utilities)
    :is(.app-page-header, .top-actions) {
    justify-content: flex-start;
  }
  .home-context-compact .home-update-controls {
    margin-inline-start: 0;
    justify-content: flex-start;
  }
}
@media (pointer: coarse) {
  .home-context-compact button,
  .home-context-compact select,
  .home-context-compact summary {
    min-height: 44px !important;
  }
}
#content .workforce-widget-totals > span {
  position: relative;
}
#content .workforce-widget-totals [data-metric-help] {
  position: static;
  padding-inline-end: 24px;
}
#content .workforce-widget-totals .ui-inline-help {
  position: absolute;
  inset: 0 0 auto auto;
}
#content .workforce-widget-totals .ui-help-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: 0;
  padding: 0;
  border-radius: 10px;
  background: radial-gradient(
    circle,
    var(--kw-mark-bg, #d8f0e0) 0 9px,
    transparent 9.5px
  );
  color: var(--kw-mark, #23684a);
  font:
    800 12px/1 system-ui,
    sans-serif;
  box-shadow: none;
}
#content .workforce-widget-totals .ui-help-button:focus-visible {
  outline: 2px solid var(--kw-accent, #419367);
  outline-offset: -3px;
}
#content .workforce-widget-totals .ui-help-panel {
  left: auto;
  right: 0;
  width: min(260px, calc(100vw - 64px));
}
@media (pointer: coarse) {
  #content .workforce-widget-totals .ui-help-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

#content
  .home-block:is([data-home-block="pulse"], [data-home-block="metrics"])
  > .kw-frame {
  min-height: var(--home-reading-height, 0px);
}

#content
  :is(.home-context-compact, .home-header-utilities)
  .app-page-header
  .top-actions
  > .small-btn {
  height: auto;
  min-height: 34px;
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
  font-size: 12px;
}

/* Approved light panel: icon-led controls; secondary actions stay quiet. */
#content .home-context-compact {
  padding: 18px 22px;
  gap: 12px;
}
#content .home-context-compact .home-context-toolbar {
  gap: 12px 20px;
}
#content .home-context-compact .home-scope-picker > summary {
  padding-inline-end: 28px;
  font-weight: 500;
}
#content .home-context-compact .home-scope-picker > summary::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2348685d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 7h2m4 0h2M8 11h2m4 0h2M10 21v-6h4v6'/%3E%3C/svg%3E")
    center / 20px no-repeat;
  transform: translateY(-50%) !important;
}
#content .home-context-compact .home-scope-picker > summary::after {
  content: "";
  position: absolute;
  right: 0;
  top: calc(50% - 10px);
  width: 20px;
  height: 20px;
  background: var(--kolegin-disclosure-arrow) center / contain no-repeat;
}
#content .home-context-compact .home-scope-picker[open] > summary::after {
  transform: rotate(180deg);
}
#content .home-context-compact .home-period-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  border-inline-start: 1px solid var(--kw-line, #cfe7d8);
  padding-inline-start: 16px;
  min-width: 0;
  max-width: 100%;
}
#content .home-context-compact .home-period-picker::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2348685d' stroke-width='1.5' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M7 2v6m10-6v6M3 11h18m-13 4h1m3 0h1m3 0h1'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
#content .home-context-compact .home-period-picker select {
  padding-inline-start: 0;
  font-weight: 500;
  color: var(--text, #172538);
  max-width: 100%;
}
#content .home-context-compact > .home-context-summary {
  padding: 0;
  border: 0;
  align-items: flex-start;
}
#content .home-context-compact .home-current-sources > summary::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23237349' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12 5 5L20 6'/%3E%3C/svg%3E")
    center / 20px no-repeat;
  transform: translateY(-50%) !important;
}
#content .home-context-compact .home-current-sources > summary:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
#content .home-context-compact .home-current-source-list {
  gap: 8px 16px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--kw-line, #cfe7d8);
}
#content .home-context-compact .home-current-source-list .home-source-badge.ok {
  padding: 6px 11px;
  min-height: 32px;
  border: 1px solid #a9dbbb;
  border-radius: 999px;
  background: #edf9f1;
  color: #267c53;
  font-size: 12px;
  font-weight: 500;
}
#content .home-context-compact .home-update-controls :is(small, button) {
  color: #48685d;
  font-weight: 400;
}
#content .home-context-compact .home-update-controls button::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-inline-end: 6px;
  vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2348685d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 4v6h-6M4 20v-6h6M4.7 9a8 8 0 0 1 13.2-3L20 10M4 14l2.1 4A8 8 0 0 0 19.3 15'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
#content .home-context-compact > [data-home-header-actions] {
  border-bottom: 1px solid var(--kw-line, #cfe7d8);
  padding: 0 28px 14px 0;
}
#content
  :is(.home-context-compact, .home-header-utilities)
  .app-page-header
  .top-actions
  > .small-btn,
#content
  :is(.home-context-compact, .home-header-utilities)
  .app-page-header
  button {
  font-size: 12px;
  font-weight: 400;
  padding: 4px 8px;
}
#content :is(.home-context-compact, .home-header-utilities) .app-user-status {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
#content
  :is(.home-context-compact, .home-header-utilities)
  .app-user-status
  strong {
  font-weight: 500;
}
#content
  :is(.home-context-compact, .home-header-utilities)
  :is([data-pwa-install], .kolegin-pwa-help > summary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0 !important;
}
#content
  :is(.home-context-compact, .home-header-utilities)
  :is([data-pwa-install], .kolegin-pwa-help > summary)
  > span,
#content
  :is(.home-context-compact, .home-header-utilities)
  .kolegin-pwa-help
  > summary::before {
  display: none;
}
#content
  :is(.home-context-compact, .home-header-utilities)
  :is([data-pwa-install], .kolegin-pwa-help > summary)
  svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 620px) {
  #content .home-context-compact {
    padding: 12px;
  }
  #content .home-context-compact .home-period-picker {
    padding-inline-start: 0;
    border: 0;
  }
}
@media (pointer: coarse) {
  #content
    :is(.home-context-compact, .home-header-utilities)
    :is([data-pwa-install], .kolegin-pwa-help > summary) {
    width: 44px;
    height: 44px;
  }
}

/* Home adopts the approved Soft Fill standard before other workspaces. */
#content .home-dashboard-grid select {
  background-color: transparent;
  border-color: transparent;
}
#content .home-dashboard-grid :is(h2, h3) {
  letter-spacing: -0.02em;
}
#content .home-dashboard-grid .toolbar {
  gap: 8px 12px;
}

/* Shell actions are the first row INSIDE the information widget. */
#content .home-header-utilities {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
}

#content[data-home-reading-scope] {
  --home-control-radius: 999px;
  --home-control-line: #c3d9cc;
  --home-control-fill: #f0f8f3;
  --home-control-ink: #253b31;
  --home-control-hover: #e1f0e7;
  --home-control-selected: #d9eddf;
}
#content[data-home-reading-scope]
  :is(.home-context-compact, .home-dashboard-grid)
  button:not(
    :where(
      .kw-indicator,
      .ui-help-button,
      .home-metric,
      .home-health,
      .home-marketplace-penalty,
      .home-opportunity-button,
      .home-worker-heading,
      .home-source-badge,
      [data-home-ai-card],
      [data-board-grip],
      [data-ui-delete],
      .danger
    )
  ),
#content[data-home-reading-scope]
  .home-context-compact
  .app-page-header
  .top-actions
  > .small-btn,
#content[data-home-reading-scope] .home-dashboard-grid a:is(.secondary, .ghost),
#content[data-home-reading-scope]
  .home-dashboard-grid
  :is(.ai-chat-attachments, .ai-chat-options)
  > summary,
#content[data-home-reading-scope] .home-finance-settings > summary {
  box-sizing: border-box;
  border: 1px solid var(--home-control-line);
  border-radius: var(--home-control-radius);
  background: var(--home-control-fill);
  color: var(--home-control-ink);
  padding: 7px 13px;
  min-height: 36px;
  max-width: 100%;
  font-weight: 500;
  box-shadow: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
#content[data-home-reading-scope]
  :is(.home-context-compact, .home-dashboard-grid)
  button:not(
    :where(
      .kw-indicator,
      .ui-help-button,
      .home-metric,
      .home-health,
      .home-marketplace-penalty,
      .home-opportunity-button,
      .home-worker-heading,
      .home-source-badge,
      [data-home-ai-card],
      [data-board-grip],
      [data-ui-delete],
      .danger
    )
  ):not(:disabled):hover,
#content[data-home-reading-scope]
  .home-dashboard-grid
  a:is(.secondary, .ghost):hover,
#content[data-home-reading-scope]
  .home-dashboard-grid
  :is(.ai-chat-attachments, .ai-chat-options)
  > summary:hover,
#content[data-home-reading-scope] .home-finance-settings > summary:hover {
  background: var(--home-control-hover);
  border-color: #82b49a;
}
#content[data-home-reading-scope]
  .home-dashboard-grid
  :is(button[aria-pressed="true"], button[aria-selected="true"], button.active),
#content[data-home-reading-scope]
  .home-board-modes
  button[aria-pressed="true"] {
  background: var(--home-control-selected);
  border-color: #73ac88;
  color: #225d3d;
}
#content[data-home-reading-scope] .home-context-compact .home-source-badge {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: var(--home-control-radius);
  font-size: 12px;
  font-weight: 500;
}
#content[data-home-reading-scope]
  .home-context-compact
  .home-source-badge:hover {
  transform: none;
  box-shadow: 0 0 0 1px currentColor;
}
#content[data-home-reading-scope]
  .home-context-compact
  .home-source-badge.warn {
  background: #f5f0fd;
  border-color: #d8c6f0;
  color: #7654a7;
}
#content[data-home-reading-scope]
  .home-context-compact
  .home-source-badge.warn::before {
  background: #8b68bf;
}
#content[data-home-reading-scope] .home-context-compact .home-source-badge.bad {
  background: #fff1f1;
  border-color: #edbcbc;
  color: #aa3131;
}
#content[data-home-reading-scope] .home-dashboard-grid select {
  border: 1px solid var(--home-control-line);
  border-radius: var(--home-control-radius);
  background-color: var(--home-control-fill);
}
#content[data-home-reading-scope] .owner-assistant-mode-switch {
  display: inline-flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--home-control-line);
  border-radius: 24px;
  background: var(--surface, #fff);
}
#content[data-home-reading-scope] .owner-assistant-mode-switch button {
  flex: 1 1 auto;
  min-height: 36px;
}
#content[data-home-reading-scope] .home-quick-capture-row button,
#content[data-home-reading-scope] .quick-command-field #run {
  border-radius: 999px;
  padding: 6px;
}
#content[data-home-reading-scope]
  .home-context-compact
  .app-page-header
  .top-actions {
  gap: 8px;
}
#content[data-home-reading-scope] .home-context-compact .app-user-status {
  display: grid;
  gap: 0;
  margin-inline-end: 4px;
}
@media (pointer: coarse) {
  #content[data-home-reading-scope]
    :is(.home-context-compact, .home-dashboard-grid)
    :is(
      button,
      select,
      a.secondary,
      a.ghost,
      .ai-chat-attachments > summary,
      .ai-chat-options > summary,
      .home-finance-settings > summary
    ):not(:where([data-board-grip], .home-metric)) {
    min-height: 44px;
  }
}
#content .home-header-utilities .app-page-header {
  justify-content: space-between;
}
#content .home-header-utilities .top-actions {
  margin-inline-start: auto;
}
@media (max-width: 620px) {
  #content .home-header-utilities .app-page-header {
    justify-content: flex-start;
  }
  #content .home-header-utilities .top-actions {
    margin-inline-start: 0;
  }
}

/* Link actions and compact composer menus share button affordances on home. */
#content[data-home-reading-scope] .home-dashboard-grid a:is(.secondary, .ghost),
#content[data-home-reading-scope]
  .home-dashboard-grid
  :is(.ai-chat-attachments, .ai-chat-options)
  > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.home-pult-search {
  margin-block: 12px;
  padding: 12px;
  border: 1px solid var(--border, #dce5ef);
  border-radius: 16px;
  background: var(--surface, #f7faf9);
}
.home-pult-search > .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
  max-height: 22rem;
  overflow-y: auto;
  overscroll-behavior: auto;
}
.home-pult-search [data-search-view] {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}
.home-pult-search [data-search-view] small {
  display: block;
  font-weight: 400;
}
