/*
 * Kraken UI audit — September 2026
 *
 * Final-precedence repairs for the shared primitives identified in the
 * 36-finding audit. Component selectors are intentionally scoped to the OS
 * shell so public documents and authentication screens keep their own theme.
 */

/* 1, 3, 4, 12, 16, 17, 19, 20, 23-25, 31-33, 35:
   one visual boundary for every composite input. */
.layout.os-layout-v10 :where(
  .search-wrap,
  .nav-search-field,
  .toolbar-search,
  .inbox-search-field,
  .docs-search,
  .settings-search,
  .saas-command-bar
) {
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: none;
}

.layout.os-layout-v10 :where(
  .search-wrap,
  .nav-search-field,
  .toolbar-search,
  .inbox-search-field,
  .docs-search,
  .settings-search,
  .saas-command-bar
):focus-within {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--line));
  outline: 3px solid color-mix(in srgb, var(--primary) 10%, transparent);
  outline-offset: 0;
}

.layout.os-layout-v10 :where(
  .search-wrap,
  .nav-search-field,
  .toolbar-search,
  .inbox-search-field,
  .docs-search,
  .settings-search,
  .saas-command-bar
) > input,
.layout.os-layout-v10 :where(
  .search-wrap,
  .nav-search-field,
  .toolbar-search,
  .inbox-search-field,
  .docs-search,
  .settings-search,
  .saas-command-bar
) > .search-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.layout.os-layout-v10 .search-wrap {
  position: relative;
  padding: 0;
}

.layout.os-layout-v10 .search-wrap > .global-search {
  height: 32px;
  padding: 0 42px 0 32px;
}

.layout.os-layout-v10 :where(.toolbar-search, .inbox-search-field, .docs-search, .settings-search) {
  overflow: visible;
}

/* 1 and 4: labels and native selects stay inside a single clipped capsule. */
.layout.os-layout-v10 :where(.dashboss-refresh-rate, .language-switch, .presence-control) {
  box-sizing: border-box;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: none;
}

.layout.os-layout-v10 .language-switch {
  min-width: 124px;
  padding-inline: 9px 6px;
}

.layout.os-layout-v10 .presence-control {
  min-width: 138px;
  padding-inline: 9px 6px;
}

.layout.os-layout-v10 .dashboss-refresh-rate {
  min-width: 94px;
  padding-inline: 8px 5px;
}

.layout.os-layout-v10 :where(.dashboss-refresh-rate, .language-switch, .presence-control) > select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0 18px 0 3px;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0;
  outline: 0;
  color: inherit;
  background-color: transparent !important;
  box-shadow: none !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2: navigation section icons share an exact geometry and optical baseline. */
.layout.os-layout-v10 .nav-group-toggle {
  grid-template-columns: 22px minmax(0, 1fr) 14px;
  align-items: center;
}

.layout.os-layout-v10 .nav-group-toggle > span:first-child {
  box-sizing: border-box;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 6px;
}

.layout.os-layout-v10 .nav-group-toggle > span:first-child .icon {
  width: 13px;
  height: 13px;
}

/* 5 and 18: accessible action-queue controls and individually readable KPIs. */
.layout.os-layout-v10 .crm-action-queue {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--crm-accent) 24%, var(--line));
  background: var(--surface);
  box-shadow: none;
}

.layout.os-layout-v10 .crm-action-head {
  background: var(--surface);
}

.layout.os-layout-v10 .crm-action-head .btn {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  color: #173b9d;
  background: #eef3ff;
  box-shadow: none;
}

.layout.os-layout-v10 .crm-action-head .btn:is(:hover, :focus-visible) {
  border-color: #1b46c2;
  color: #ffffff;
  background: #1b46c2;
}

.layout.os-layout-v10 .crm-action-metrics {
  grid-template-columns: repeat(5, minmax(104px, 1fr));
  gap: 8px;
  overflow-x: auto;
  margin: 0 12px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.layout.os-layout-v10 .crm-action-metrics > span {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.layout.os-layout-v10 .crm-action-metrics > span:nth-child(2) {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}

.layout.os-layout-v10 .crm-action-metrics > span:nth-child(3) {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.layout.os-layout-v10 .crm-action-metrics > span:nth-child(4) {
  border-color: color-mix(in srgb, var(--teal) 25%, var(--line));
  background: color-mix(in srgb, var(--teal) 6%, var(--surface));
}

.layout.os-layout-v10 .badge.red {
  border: 1px solid #fecaca;
  color: #991b1b;
  background: #fee2e2;
}

/* 6: the tab title and close action own separate, non-overlapping hit areas. */
.layout.os-layout-v10 .workspace-tab-group {
  width: auto;
  min-width: 150px;
  max-width: 228px;
  display: grid;
  grid-template-columns: minmax(116px, 1fr) 28px;
  align-items: stretch;
}

.layout.os-layout-v10 .workspace-tab {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 4px 8px;
}

.layout.os-layout-v10 .workspace-tab > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layout.os-layout-v10 .workspace-tab-close {
  position: static;
  width: 28px;
  min-width: 28px;
  margin: 0;
  border-left: 1px solid var(--line);
}

/* 7, 9 and 10: employee panels use shared gutters and a true baseline. */
.layout.os-layout-v10 .workspace-people-panel {
  box-sizing: border-box;
  padding: 0 14px 14px;
  overflow: hidden;
}

.layout.os-layout-v10 .workspace-people-panel > .panel-header {
  margin: 0 -14px 14px;
  padding-inline: 14px;
}

.layout.os-layout-v10 .workspace-people-panel > :not(.panel-header) {
  min-width: 0;
}

.layout.os-layout-v10 .workspace-people-summary .key-item {
  box-sizing: border-box;
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.layout.os-layout-v10 .workspace-people-summary .key-item > :is(span, strong) {
  margin: 0;
  line-height: 1;
}

/* 8: operating-lens cards use flat, content-coded tints. */
.layout.os-layout-v10 .business-lens-card {
  border-color: color-mix(in srgb, var(--lens-color) 25%, var(--line));
  background: color-mix(in srgb, var(--lens-color) 7%, var(--surface));
  box-shadow: none;
  backdrop-filter: none;
}

.layout.os-layout-v10 .business-lens-card:is(:hover, .active) {
  transform: none;
  border-color: color-mix(in srgb, var(--lens-color) 48%, var(--line));
  background: color-mix(in srgb, var(--lens-color) 11%, var(--surface));
  box-shadow: none;
}

.layout.os-layout-v10 .business-lens-icon {
  color: var(--lens-color);
  background: color-mix(in srgb, var(--lens-color) 14%, var(--surface));
  box-shadow: none;
}

.layout.os-layout-v10 .business-lens-panel {
  background: color-mix(in srgb, var(--lens-color) 5%, var(--surface));
  box-shadow: none;
  backdrop-filter: none;
}

/* 11 and 12: flat conversation identity and clean direct-message headers. */
.layout.os-layout-v10 :where(.inbox-rail-head, .inbox-chat-head, .inbox-context-head) {
  background: var(--surface);
}

.layout.os-layout-v10 .channel-hash:not(.is-person) {
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  box-shadow: none;
}

.layout.os-layout-v10 :where(.inbox-channel-item, .inbox-person-item):is(:hover, .active) {
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  box-shadow: none;
}

/* 13: Slack/Discord-style progressive disclosure for message actions. */
.layout.os-layout-v10 .inbox-message-card {
  position: relative;
  overflow: visible;
}

.layout.os-layout-v10 .inbox-message-body {
  grid-column: 2;
  min-width: 0;
}

.layout.os-layout-v10 .inbox-message-toolbar {
  position: absolute;
  z-index: 8;
  top: -15px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.layout.os-layout-v10 .inbox-message-card:is(:hover, :focus-within) > .inbox-message-toolbar,
.layout.os-layout-v10 .inbox-message-toolbar:has(details[open]) {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.layout.os-layout-v10 :where(.inbox-message-action, .inbox-message-action-menu > summary) {
  box-sizing: border-box;
  min-width: 30px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.layout.os-layout-v10 .inbox-message-action-menu > summary::-webkit-details-marker {
  display: none;
}

.layout.os-layout-v10 :where(.inbox-message-action, .inbox-message-action-menu > summary):is(:hover, :focus-visible) {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  outline: 0;
}

.layout.os-layout-v10 :where(.inbox-message-action, .inbox-message-action-menu > summary) .icon {
  width: 13px;
  height: 13px;
}

.layout.os-layout-v10 .inbox-message-action-menu {
  position: relative;
}

.layout.os-layout-v10 :where(.inbox-message-action-popover, .inbox-message-reaction-menu .entity-reaction-options) {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.layout.os-layout-v10 .inbox-message-action-popover > button {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.layout.os-layout-v10 .inbox-message-action-popover > button:hover {
  background: var(--surface-2);
}

.layout.os-layout-v10 .inbox-message-action-popover > button.is-danger {
  color: var(--danger);
}

.layout.os-layout-v10 .inbox-message-reaction-menu .entity-reaction-options {
  grid-template-columns: repeat(3, 32px);
  min-width: 0;
}

.layout.os-layout-v10 .inbox-message-body > .entity-reaction-bar .entity-reaction-picker {
  display: none;
}

.layout.os-layout-v10 .inbox-message-body > .entity-reaction-bar:not(:has(.entity-reaction-chip)) {
  display: none;
}

/* 14: priority/status rail runs across the card top. */
.layout.os-layout-v10 .task-card-premium {
  padding: 13px 9px 8px;
}

.layout.os-layout-v10 .task-priority-rail {
  inset: 0 9px auto;
  width: auto;
  height: 3px;
  border-radius: 0 0 999px 999px;
}

/* 15, 19, 20, 26, 31 and 33: one left/right grid for list surfaces. */
.layout.os-layout-v10 .split-page > .panel {
  box-sizing: border-box;
  min-width: 0;
  padding-bottom: 10px;
}

.layout.os-layout-v10 .split-page > .panel > :where(.toolbar, .refined-toolbar) {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
}

.layout.os-layout-v10 .split-page > .panel > .table-shell {
  box-sizing: border-box;
  width: calc(100% - 20px);
  max-width: calc(100% - 20px);
  margin: 10px;
}

.layout.os-layout-v10 .split-page > .panel > .module-report-strip {
  box-sizing: border-box;
  width: calc(100% - 20px);
  max-width: calc(100% - 20px);
  margin: 10px !important;
}

.layout.os-layout-v10 .module-report-inline {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.layout.os-layout-v10 .module-report-inline-title {
  min-width: 0;
}

.layout.os-layout-v10 .module-report-inline-title > :is(strong, small) {
  display: block;
  overflow-wrap: anywhere;
}

/* 17 and 34: obvious selected pills with clipping owned by the wrapper. */
.layout.os-layout-v10 .docs-nav-group button.active {
  border-color: #1b46c2;
  color: #173b9d;
  background: #e8efff;
  box-shadow: inset 3px 0 0 #1b46c2;
}

.layout.os-layout-v10 .legal-tabs {
  box-sizing: border-box;
  overflow: hidden;
  padding: 4px;
  border-radius: 12px;
}

.layout.os-layout-v10 .legal-tabs .tab {
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
}

.layout.os-layout-v10 .legal-tabs .tab.active {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 8px;
  color: #173b9d;
  background: #e8efff;
  box-shadow: none;
}

/* 21-24: contextual SVGs are promoted in the top module nav. */
.layout.os-layout-v10 .module-shortcut > .icon {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--module-color, var(--primary)) 22%, var(--line));
  border-radius: 8px;
  color: var(--module-ink, var(--primary));
  background: color-mix(in srgb, var(--module-color, var(--primary)) 9%, var(--surface)) !important;
  box-shadow: none;
}

/* 25 and 32: filter pills own the border; inputs remain native and unclipped. */
.layout.os-layout-v10 .column-filter-row th {
  padding: 5px 6px;
  overflow: visible;
}

.layout.os-layout-v10 .column-filter-shell {
  box-sizing: border-box;
  width: 100%;
  min-width: 124px;
  min-height: 32px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  overflow: hidden;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.layout.os-layout-v10 .column-filter-operator-shell {
  min-width: 164px;
  grid-template-columns: 45px minmax(92px, 1fr);
  padding-left: 3px;
}

.layout.os-layout-v10 .column-filter-shell > :where(input, select),
.layout.os-layout-v10 .column-filter-shell .column-filter-input,
.layout.os-layout-v10 .column-filter-shell .column-filter-operator {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 27px;
  height: 27px;
  margin: 0;
  padding: 0 18px 0 4px;
  border: 0 !important;
  border-radius: 0;
  outline: 0;
  color: var(--text);
  background: transparent !important;
  box-shadow: none !important;
  text-overflow: ellipsis;
}

.layout.os-layout-v10 .column-filter-operator-shell > .column-filter-operator {
  padding-inline: 3px;
  border-right: 1px solid var(--line) !important;
}

/* 27: admin/owner/audit surfaces retain a complete internal safe area. */
.layout.os-layout-v10 :where(.settings-console, .owner-console, .enterprise-console) {
  box-sizing: border-box;
  min-width: 0;
  padding-bottom: 14px;
}

.layout.os-layout-v10 .settings-main {
  min-width: 0;
  padding: 0 0 12px;
}

.layout.os-layout-v10 .settings-section > .panel {
  box-sizing: border-box;
  overflow: hidden;
}

.layout.os-layout-v10 .settings-section > .panel > .panel-header {
  padding: 14px 16px;
}

.layout.os-layout-v10 .settings-section > .panel > .panel-body {
  box-sizing: border-box;
  min-width: 0;
  padding: 16px;
}

/* 28 and 29: distinct icon identities stay flat and scannable. */
.layout.os-layout-v10 .settings-module-stack > .panel:has([data-table-kind="audit_logs"]) {
  padding: 0 10px 10px;
  overflow: hidden;
}

.layout.os-layout-v10 .settings-module-stack > .panel:has([data-table-kind="audit_logs"]) > .panel-header {
  margin-inline: -10px;
  padding-inline: 10px;
}

.layout.os-layout-v10 .settings-module-stack [data-table-kind="audit_logs"] {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-inline: 0;
}

.layout.os-layout-v10 :is(.module-report-mark, .report-mini-logo, .report-view-logo),
html[data-theme="dark"] .layout.os-layout-v10 :is(.module-report-mark, .report-mini-logo, .report-view-logo) {
  color: var(--module-ink, var(--primary));
  background: color-mix(in srgb, var(--module-color, var(--primary)) 11%, var(--surface));
  box-shadow: none;
}

.layout.os-layout-v10 :where(.ai-training-drawer, .ai-system-details) summary .icon {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

/* 30: compact AURA composer and capability chips. */
.layout.os-layout-v10 .ai-command-panel {
  padding: 0;
}

.layout.os-layout-v10 .ai-command-head {
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  align-items: center;
  background: var(--surface);
}

.layout.os-layout-v10 .ai-engine-state {
  min-width: 0;
  max-width: min(68%, 720px);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
}

.layout.os-layout-v10 .ai-engine-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.layout.os-layout-v10 .ai-engine-chip.is-provider {
  border-color: color-mix(in srgb, var(--teal) 30%, var(--line));
  color: color-mix(in srgb, var(--teal) 78%, var(--text));
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
}

.layout.os-layout-v10 .ai-engine-chip .icon {
  width: 12px;
  height: 12px;
}

.layout.os-layout-v10 .ai-ask-form-product {
  margin: 0;
  padding: 10px 12px 12px;
  gap: 8px;
}

.layout.os-layout-v10 .ai-ask-form-product > textarea {
  min-height: 92px;
}

/* 35: settings tab text and status badge occupy separate grid tracks. */
.layout.os-layout-v10 .settings-module-tab {
  box-sizing: border-box;
  grid-template-columns: 32px minmax(0, 1fr) minmax(62px, auto);
  grid-template-areas:
    "icon label badge"
    "icon note badge";
  overflow: hidden;
  border-radius: 10px;
}

.layout.os-layout-v10 .settings-module-tab > small {
  grid-area: note;
  grid-column: 2;
  min-width: 0;
  padding-right: 4px;
  white-space: normal;
}

.layout.os-layout-v10 .settings-module-tab > .badge {
  position: static;
  grid-area: badge;
  align-self: start;
  justify-self: end;
  max-width: 78px;
}

.layout.os-layout-v10 .settings-module-tab.active {
  overflow: hidden;
  border-radius: 10px;
}

/* 36: assignment avatars cannot paint outside their pill. */
.layout.os-layout-v10 .person-chip {
  box-sizing: border-box;
  overflow: hidden;
  background-clip: padding-box;
}

.layout.os-layout-v10 .person-chip > .avatar {
  box-sizing: border-box;
  width: 34px;
  min-width: 34px;
  height: 34px;
  margin: 0;
  overflow: hidden;
  border-radius: 50%;
  background-clip: padding-box;
  box-shadow: none;
}

@media (max-width: 900px) {
  .layout.os-layout-v10 .crm-action-metrics {
    grid-template-columns: repeat(5, minmax(118px, 1fr));
  }

  .layout.os-layout-v10 .module-report-inline {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .layout.os-layout-v10 .module-report-inline > .module-report-exports {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .layout.os-layout-v10 .workspace-people-panel {
    padding-inline: 10px;
  }

  .layout.os-layout-v10 .workspace-people-panel > .panel-header {
    margin-inline: -10px;
  }

  .layout.os-layout-v10 .ai-command-head {
    align-items: stretch;
  }

  .layout.os-layout-v10 .ai-engine-state {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }

  .layout.os-layout-v10 .ai-engine-chip {
    white-space: normal;
  }
}

@media (hover: none) {
  .layout.os-layout-v10 .inbox-message-toolbar {
    position: static;
    grid-column: 2;
    grid-row: 2;
    width: fit-content;
    margin-top: 6px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
  }

  .layout.os-layout-v10 .inbox-message-body {
    grid-row: 3;
  }
}

html[data-theme="dark"] .layout.os-layout-v10 :is(
  .crm-action-head .btn,
  .legal-tabs .tab.active,
  .docs-nav-group button.active
) {
  border-color: #4968ad;
  color: #e4ecff;
  background: #19294d;
}

html[data-theme="dark"] .layout.os-layout-v10 .badge.red {
  border-color: #7f3341;
  color: #fecdd3;
  background: #421923;
}

/* Mobile compact system — shared by every module. */
.layout.os-layout-v10 :where(
  .inbox-mobile-chat-details,
  .inbox-mobile-context-close,
  .inbox-mobile-context-backdrop
) {
  display: none;
}

@media (max-width: 720px) {
  .layout.os-layout-v10 {
    --topbar: calc(44px + env(safe-area-inset-top));
    --workspace-tabs-height: 34px;
    --shell-chrome-height: calc(78px + env(safe-area-inset-top));
    --page-gutter: 5px;
    --section-gap: 6px;
    --panel-pad: 7px;
    --control-height: 34px;
  }

  .layout.os-layout-v10 .topbar {
    grid-template-columns: 32px 68px minmax(0, 1fr) 32px;
    gap: 4px;
    padding: calc(4px + env(safe-area-inset-top)) 5px 4px;
  }

  .layout.os-layout-v10 :where(.mobile-menu, .mobile-controls-toggle) {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 8px;
  }

  .layout.os-layout-v10 .mobile-topbar-brand {
    width: 68px;
    height: 32px;
  }

  .layout.os-layout-v10 .mobile-topbar-logo {
    width: 66px;
    height: 23px;
  }

  .layout.os-layout-v10 :where(.search-wrap, .global-search) {
    height: 32px;
    min-height: 32px;
  }

  .layout.os-layout-v10 .workspace-tabs {
    height: 34px;
    min-height: 34px;
    padding: 2px 5px;
  }

  .layout.os-layout-v10 .workspace-tab-group {
    min-width: 94px;
    max-width: 132px;
    height: 29px;
    grid-template-columns: minmax(68px, 1fr) 26px;
  }

  .layout.os-layout-v10 :where(.workspace-tab, .workspace-tab-close, .workspace-tab-add) {
    height: 29px;
    min-height: 29px;
  }

  .layout.os-layout-v10 .workspace-tab-close {
    width: 26px;
    min-width: 26px;
  }

  .layout.os-layout-v10 .content {
    padding: 5px 5px calc(72px + env(safe-area-inset-bottom));
  }

  .layout.os-layout-v10 .page-header {
    min-height: 42px;
    margin-bottom: 5px;
    padding: 5px 7px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    border-radius: 8px;
  }

  .layout.os-layout-v10 .content:has(.task-workspace) > .page-header,
  .layout.os-layout-v10 .content:has(.calendar-shell) > .page-header {
    height: 42px;
    min-height: 42px;
    padding: 5px 7px;
  }

  .layout.os-layout-v10 .page-header h1 {
    font-size: 16px;
    line-height: 1.08;
  }

  .layout.os-layout-v10 .page-header :where(p, .module-tag) {
    display: none;
  }

  .layout.os-layout-v10 .page-header .page-actions {
    width: auto;
    max-width: 42vw;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .layout.os-layout-v10 .page-header .page-actions .btn {
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
  }

  .layout.os-layout-v10 :where(
    .panel, .card, .table-shell, .context-panel, .metric-card,
    .module-report-card, .task-column, .task-card,
    .settings-active-module, .settings-surface-card, .settings-module-card,
    .ai-command-panel, .ai-action-rail, .calendar-side-card
  ) {
    border-radius: 8px;
    box-shadow: none;
  }

  .layout.os-layout-v10 :where(.panel-header, .panel-head, .module-report-head) {
    min-height: 38px;
    gap: 6px;
    padding: 6px 7px;
  }

  .layout.os-layout-v10 :where(.panel-body, .card-body) {
    padding: 7px;
  }

  .layout.os-layout-v10 :where(
    .toolbar, .refined-toolbar, .filter-bar, .task-search-line,
    .report-toolbar, .calendar-commandbar
  ) {
    gap: 4px;
    padding: 5px;
  }

  .layout.os-layout-v10 :where(.toolbar-search, .docs-search, .settings-search) {
    min-height: 34px;
  }

  .layout.os-layout-v10 :where(.filters, .refined-filters, .button-row, .tab-row) {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .layout.os-layout-v10 :where(.filters, .refined-filters, .button-row, .tab-row)::-webkit-scrollbar {
    display: none;
  }

  .layout.os-layout-v10 :where(.filters, .refined-filters, .button-row, .tab-row) > * {
    flex: 0 0 auto;
  }

  .layout.os-layout-v10 :where(
    .filter-select,
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    button.btn
  ) {
    min-height: 34px;
  }

  .layout.os-layout-v10 .split-page {
    gap: 6px;
  }

  .layout.os-layout-v10 .split-page > .panel {
    padding-bottom: 5px;
  }

  .layout.os-layout-v10 .split-page > .panel > :where(.table-shell, .module-report-strip) {
    width: calc(100% - 10px);
    max-width: calc(100% - 10px);
    margin: 5px !important;
  }

  .layout.os-layout-v10 .module-report-inline {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
  }

  .layout.os-layout-v10 .module-report-inline :where(.report-mini-logo, .module-report-mark) {
    width: 28px;
    height: 28px;
  }

  .layout.os-layout-v10 .module-report-inline-title small {
    display: none;
  }

  .layout.os-layout-v10 .operator-module-page {
    gap: 6px;
  }

  .layout.os-layout-v10 .operator-module-hero {
    gap: 6px;
    padding: 8px;
    border-radius: 9px;
  }

  .layout.os-layout-v10 .operator-module-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .layout.os-layout-v10 .operator-module-title {
    min-width: 0;
  }

  .layout.os-layout-v10 .operator-module-title h1 {
    font-size: 17px;
  }

  .layout.os-layout-v10 .operator-module-title p {
    display: none;
  }

  .layout.os-layout-v10 .operator-module-actions {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .layout.os-layout-v10 .operator-module-actions::-webkit-scrollbar {
    display: none;
  }

  .layout.os-layout-v10 .operator-module-actions .btn {
    width: auto;
    flex: 0 0 auto;
  }

  .layout.os-layout-v10 .operator-module-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .layout.os-layout-v10 .operator-module-kpi {
    min-height: 52px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 5px;
    padding: 6px;
  }

  .layout.os-layout-v10 .operator-module-kpi > span:first-child {
    width: 24px;
    height: 24px;
  }

  .layout.os-layout-v10 .operator-module-page > .module-shortcuts {
    gap: 4px;
    padding-bottom: 2px;
  }

  .layout.os-layout-v10 .operator-module-page > .module-shortcuts .module-shortcut {
    min-width: 104px;
    min-height: 40px;
    gap: 5px;
    padding: 5px;
    border-radius: 8px;
  }

  .layout.os-layout-v10 .operator-module-page > .module-shortcuts .module-shortcut > .icon {
    width: 26px;
    height: 26px;
    padding: 6px;
  }

  .layout.os-layout-v10 .operator-module-page > .module-shortcuts .module-shortcut small {
    display: none;
  }

  .layout.os-layout-v10 .operator-module-grid {
    gap: 6px;
  }

  .layout.os-layout-v10 .operator-module-statusbar {
    min-height: 34px;
    padding: 5px 7px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .layout.os-layout-v10 .mobile-card-table-shell {
    margin: 0 5px 6px;
  }

  .layout.os-layout-v10 .mobile-card-table tbody {
    gap: 5px;
  }

  .layout.os-layout-v10 .mobile-card-table .mobile-record-card {
    gap: 5px 7px;
    padding: 7px;
    border-radius: 9px;
    box-shadow: none;
  }

  .layout.os-layout-v10 .mobile-card-table .mobile-record-card > td {
    gap: 2px;
    font-size: 11px;
  }

  .layout.os-layout-v10 .mobile-card-table .mobile-primary-cell {
    min-height: 34px;
    padding-right: 38px !important;
  }

  .layout.os-layout-v10 .mobile-card-table .select-col {
    top: 5px;
    right: 5px;
    width: 34px;
    height: 34px;
  }

  .layout.os-layout-v10 .mobile-card-table .row-action-cell {
    padding-top: 5px !important;
  }

  .layout.os-layout-v10 .mobile-card-table .row-actions .btn {
    min-width: 36px;
    min-height: 36px;
    height: 36px;
  }

  .layout.os-layout-v10 :where(.form-grid, .settings-grid, .key-grid, .metric-grid) {
    gap: 6px;
  }

  .layout.os-layout-v10 .field {
    gap: 3px;
  }

  .layout.os-layout-v10 .field textarea {
    min-height: 72px;
  }

  /* Inbox and Channels become a compact conversation workspace on phones. */
  .layout.os-layout-v10 .inbox-command-center {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 5px;
    padding: 0;
  }

  .layout.os-layout-v10 .inbox-channel-rail {
    max-height: none;
    grid-template-rows: auto auto auto auto;
    gap: 4px;
    padding: 5px;
    border-radius: 8px;
  }

  .layout.os-layout-v10 .inbox-rail-head {
    min-height: 32px;
    padding: 3px 4px;
  }

  .layout.os-layout-v10 .inbox-rail-head strong {
    font-size: 14px;
  }

  .layout.os-layout-v10 .inbox-rail-head small {
    display: none;
  }

  .layout.os-layout-v10 .inbox-search-field {
    min-height: 34px;
    margin: 0;
    padding: 0 8px;
    border-radius: 7px;
  }

  .layout.os-layout-v10 :where(.inbox-filter-bar, .inbox-preference-actions) {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .layout.os-layout-v10 :where(.inbox-filter-bar, .inbox-preference-actions)::-webkit-scrollbar {
    display: none;
  }

  .layout.os-layout-v10 .inbox-filter-bar button {
    min-height: 28px;
    flex: 0 0 auto;
    padding: 3px 8px;
    font-size: 10px;
  }

  .layout.os-layout-v10 .inbox-channel-list {
    min-width: 0;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .layout.os-layout-v10 .inbox-channel-list::-webkit-scrollbar {
    display: none;
  }

  .layout.os-layout-v10 .inbox-rail-section {
    display: contents;
  }

  .layout.os-layout-v10 .inbox-rail-section > :where(span, small) {
    display: none;
  }

  .layout.os-layout-v10 :where(.inbox-channel-item, .inbox-person-item) {
    flex: 0 0 min(70vw, 210px);
    min-height: 42px;
    margin: 0;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 5px 6px;
    border-radius: 7px;
    scroll-snap-align: start;
  }

  .layout.os-layout-v10 :where(.channel-hash, .inbox-person-item > .avatar) {
    width: 26px;
    min-width: 26px;
    height: 26px;
    min-height: 26px;
    border-radius: 7px;
  }

  .layout.os-layout-v10 :where(.channel-copy, .inbox-person-item) small {
    font-size: 9px;
  }

  .layout.os-layout-v10 .channel-meta {
    gap: 2px;
  }

  .layout.os-layout-v10 .channel-meta > .badge {
    display: none;
  }

  .layout.os-layout-v10 .inbox-chat-panel {
    min-height: 0;
    border-radius: 8px;
  }

  .layout.os-layout-v10 .inbox-chat-head {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: start;
    gap: 5px;
    padding: 6px;
  }

  .layout.os-layout-v10 .inbox-chat-title {
    gap: 0;
  }

  .layout.os-layout-v10 .inbox-chat-title > .eyebrow,
  .layout.os-layout-v10 .inbox-chat-head p {
    display: none;
  }

  .layout.os-layout-v10 .inbox-chat-head h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.15;
  }

  .layout.os-layout-v10 .inbox-chat-title .inbox-filter-bar {
    margin-top: 4px;
  }

  .layout.os-layout-v10 .inbox-mobile-chat-details {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
  }

  .layout.os-layout-v10 .inbox-chat-kpis {
    grid-column: 1 / -1;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .layout.os-layout-v10 .inbox-chat-kpis .key-item {
    min-height: 34px;
    padding: 4px 6px;
    border-radius: 6px;
  }

  .layout.os-layout-v10 .inbox-chat-kpis .key-item small {
    font-size: 8px;
  }

  .layout.os-layout-v10 .inbox-chat-kpis .key-item strong {
    font-size: 11px;
  }

  .layout.os-layout-v10 .inbox-message-list {
    min-height: 250px;
    height: min(44dvh, 420px);
    gap: 5px;
    padding: 6px;
  }

  .layout.os-layout-v10 .inbox-message-card {
    width: fit-content;
    max-width: 98%;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
    border-radius: 8px;
    box-shadow: none;
  }

  .layout.os-layout-v10 .inbox-message-card.is-own {
    max-width: 94%;
  }

  .layout.os-layout-v10 .inbox-message-avatar .avatar {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 9px;
  }

  .layout.os-layout-v10 .inbox-message-body {
    grid-row: 1;
  }

  .layout.os-layout-v10 .inbox-message-head,
  .layout.os-layout-v10 .inbox-message-foot {
    gap: 3px 5px;
  }

  .layout.os-layout-v10 .inbox-message-head span:not(.badge),
  .layout.os-layout-v10 .inbox-message-foot :where(span, button) {
    font-size: 9px;
  }

  .layout.os-layout-v10 .inbox-message-body p {
    margin: 4px 0 5px;
    font-size: 12px;
    line-height: 1.35;
  }

  .layout.os-layout-v10 .inbox-message-toolbar {
    position: static;
    grid-column: 2;
    grid-row: 2;
    width: fit-content;
    max-width: 100%;
    min-height: 30px;
    margin: 3px 0 0;
    padding: 1px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
  }

  .layout.os-layout-v10 :where(.inbox-message-action, .inbox-message-action-menu > summary) {
    min-width: 30px;
    min-height: 28px;
    padding: 0 6px;
  }

  .layout.os-layout-v10 :where(
    .inbox-message-action > span,
    .inbox-message-action-menu > summary > span:not(.visually-hidden)
  ) {
    display: none;
  }

  .layout.os-layout-v10 :where(.inbox-message-action-popover, .inbox-message-reaction-menu .entity-reaction-options) {
    top: auto;
    right: 0;
    bottom: calc(100% + 4px);
  }

  .layout.os-layout-v10 .inbox-composer {
    gap: 5px;
    padding: 6px;
  }

  .layout.os-layout-v10 .inbox-composer-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px;
  }

  .layout.os-layout-v10 .inbox-composer-bar > .filter-select {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    flex-basis: auto;
  }

  .layout.os-layout-v10 .inbox-toggle {
    min-height: 32px;
    padding: 0 7px;
    gap: 4px;
    font-size: 10px;
  }

  .layout.os-layout-v10 .inbox-toggle input {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  .layout.os-layout-v10 .inbox-composer .mention-field textarea,
  .layout.os-layout-v10 .inbox-composer textarea {
    min-height: 56px;
    max-height: 120px;
    padding: 7px;
  }

  .layout.os-layout-v10 .inbox-composer-actions {
    gap: 5px;
  }

  .layout.os-layout-v10 .inbox-composer-actions > span {
    max-width: 58%;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .layout.os-layout-v10 .inbox-context-panel {
    position: fixed;
    z-index: 144;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: min(82dvh, 720px);
    display: grid;
    gap: 7px;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.22);
    visibility: hidden;
    pointer-events: none;
    transform: translateY(105%);
    transition: transform 160ms ease;
  }

  .layout.os-layout-v10 .inbox-context-panel.is-mobile-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .layout.os-layout-v10 .inbox-mobile-context-close {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
  }

  .layout.os-layout-v10 .inbox-context-head {
    min-height: 38px;
    padding: 0 42px 0 0;
  }

  .layout.os-layout-v10 .inbox-context-head > span {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .layout.os-layout-v10 .inbox-context-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .layout.os-layout-v10 .inbox-context-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .layout.os-layout-v10 .inbox-context-list {
    gap: 5px;
  }

  .layout.os-layout-v10 .member-picker-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .layout.os-layout-v10 .member-picker-option {
    min-height: 42px;
    padding: 5px;
    border-radius: 8px;
  }

  .layout.os-layout-v10 .inbox-mobile-context-backdrop {
    position: fixed;
    z-index: 143;
    inset: 0;
    display: block;
    visibility: hidden;
    border: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  .layout.os-layout-v10 .inbox-mobile-context-backdrop.is-mobile-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 360px) {
  .layout.os-layout-v10 .topbar {
    grid-template-columns: 32px 58px minmax(0, 1fr) 32px;
  }

  .layout.os-layout-v10 .mobile-topbar-brand,
  .layout.os-layout-v10 .mobile-topbar-logo {
    width: 58px;
  }

  .layout.os-layout-v10 :where(.inbox-channel-item, .inbox-person-item) {
    flex-basis: 76vw;
  }

  .layout.os-layout-v10 .inbox-toggle {
    padding-inline: 5px;
  }
}
