/* M22: customer identity, optically aligned controls and calm administrative panels.
   M22：企业身份、对齐的操作图标及简洁的管理面板。 */
.i5 .topbar .icon-btn { align-items: center; justify-content: center; }
.i5 .topbar .icon-btn > [data-icon] {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex: none; line-height: 0;
}
.i5 .topbar .icon-btn > [data-icon] > .mos-icon { display: block; width: 18px; height: 18px; margin: 0; vertical-align: initial; }
.i5 .topbar__context { align-self: center; align-items: center; min-height: 34px; }
.i5 #route-context { display: block; line-height: 20px; }

/* This identifies the authenticated customer, separately from MOS and agent portraits. */
.i5 .m13-company { padding: 10px; gap: 10px; border-radius: 8px; min-height: 54px; }
.i5 .m22-company-monogram {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px;
  border: 1px solid var(--mos-border); border-radius: 7px;
  color: var(--mos-text-secondary); background: var(--mos-surface-subtle);
  font: 600 12px/18px var(--mos-font-ui); letter-spacing: 0;
}
.i5 .m13-company-context { flex: 1; min-width: 0; display: block; }
.i5 .m13-company-context strong { font: 600 13px/20px var(--mos-font-ui); overflow-wrap: anywhere; }

/* Filled active rows and text are sufficient; no decorative edge rails. */
.i5 .m13-nav-link.is-active::before, .i5 .m13-nav-link[aria-current="page"]::before, .i5 .m13-nav-link.is-active:not([aria-current="page"])::before { display: none; }
.i5 .m8-notice {
  border: 1px solid var(--mos-border); border-left-width: 1px;
  border-radius: 8px; background: var(--mos-surface); padding: 14px 16px;
  margin-block: 0 16px; font: var(--i5-ui); color: var(--mos-text-secondary);
}
.i5 .m8-notice > p { margin: 6px 0 0; }
.i5 .m8-storage { margin: -4px 0 16px; font: var(--i5-caption); line-height: 20px; }
.i5 .m8-heading { margin-bottom: 0; padding-bottom: 18px; }
.i5 .m8-heading h1 { margin: 0 0 6px; }
.i5 .m8-heading p { margin: 0; }
.i5 .m22-data-handoff {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px; margin-top: 20px;
}
.i5 .m22-data-handoff > div { min-width: 0; max-width: 780px; }
.i5 .m22-data-handoff h2 { font: 600 16px/24px var(--mos-font-ui); color: var(--mos-text); margin: 0 0 6px; }
.i5 .m22-data-handoff p { margin: 0; font: var(--i5-ui); line-height: 24px; }
.i5 .m22-data-handoff .btn { flex: none; min-height: 36px; white-space: nowrap; }
.i5 .m13-data-checklist article { padding: 18px; }
.i5 .m13-data-checklist h3 { margin: 10px 0 6px; }
.i5 .m13-data-checklist p { margin: 0; }
@media (max-width: 800px) {
  .i5 .m22-data-handoff { flex-direction: column; align-items: stretch; gap: 16px; padding: 16px; }
  .i5 .m22-data-handoff .btn { align-self: flex-start; white-space: normal; }
  .i5 .topbar .icon-btn { width: 36px; min-width: 36px; height: 36px; min-height: 36px; }
}

/* M22 Claude second pass: measured fixes on top of the first pass; no new layer.
   M22 Claude 第二轮：在首轮基础上的实测修整，不新增样式层。 */

/* Sidebar tier heads and footnote stay on one line; the count never splits after its slash. */
.i5 .i5-tier-label > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.i5 .i5-tier-count { flex: none; white-space: nowrap; }
.i5 .m13-nav-note { white-space: nowrap; }

/* Chinese and English paragraphs avoid one-character last lines (据。/态。) where the browser supports it. */
.i5 #view p, .i5 #view li, .i5 #view dd, .i5 dialog p, .i5 .chat-starters button > span:nth-child(2) { text-wrap: pretty; }

/* Modules: one guidance panel, and a state line that tells enabled from locked at a glance. */
.i5 .m22-module-guide .m22-module-guide-lead { margin: 0; font: 500 14px/22px var(--mos-font-ui); color: var(--mos-text); }
.i5 .m22-module-guide .m8-storage { margin: 4px 0 0; }
.i5 label.m8-module { display: flex; flex-direction: column; }
.i5 .m22-module-state {
  display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px;
  font: var(--i5-caption); color: var(--mos-text-muted);
}
.i5 .m22-module-state i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px dashed var(--i5-off); flex: none; }
.i5 .m22-module-state[data-state="enabled"] { color: var(--mos-text-secondary); }
.i5 .m22-module-state[data-state="enabled"] i { border: 0; background: var(--mos-accent); }

/* Company setup: breathing room above the lead action; checklist icons sit beside their titles. */
.i5 .m13-setup-lead .btn { margin-top: 16px; }
.i5 .m13-data-checklist article { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-content: start; }
.i5 .m13-data-checklist article > svg {
  grid-row: 1 / span 2; box-sizing: content-box; width: 18px; height: 18px; padding: 7px; margin: 0;
  border-radius: 8px; background: var(--mos-accent-soft); color: var(--mos-accent);
}
.i5 .m13-data-checklist h3 { margin: 6px 0 0; }

/* Settings share the left edge of every other page; people and assistants are labelled separately. */
.i5 .settings-page { margin-inline: 0; }
.i5 .settings-panel--truth dd { margin: 0; }
.i5 .m17-authority-chain article {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 8px; align-content: start; padding: 16px;
}
.i5 .m17-authority-chain article:first-child { box-shadow: none; }
.i5 .m17-authority-chain article > .agent-identity { grid-row: 1 / span 3; align-self: start; }
.i5 .m17-authority-chain h3 { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 14px/22px var(--mos-font-ui); color: var(--mos-text); }
.i5 .m17-authority-chain h3 .i5-tier-chip { font-variant-numeric: tabular-nums; }
.i5 .m17-authority-chain .m22-authority-roles { display: grid; gap: 2px; margin: 0; }
.i5 .m17-authority-chain .m22-authority-roles > div { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 8px; padding: 0; border: 0; }
.i5 .m22-authority-roles dt { font: var(--i5-caption); color: var(--mos-text-muted); }
.i5 .m22-authority-roles dd { margin: 0; font: 500 13px/18px var(--mos-font-ui); color: var(--mos-text); }
.i5 .m17-authority-chain article > p { grid-column: 2; margin: 0; color: var(--mos-text-secondary); }

/* Work rail: one guardrail footer on every tab and width (phones included); tabs size to their labels so
   English does not crowd; step labels keep the 12px floor. */
.i5 .work-rail-footer { display: flex; }
.i5 .work-rail-tabs [role="tab"] { flex: 1 1 auto; padding-inline: 5px; }
.i5 .work-intake-steps li { font: var(--i5-caption); }
/* Mandarin floor (12px) for the remaining small labels measured in the data dialog and operations board. */
.i5 .work-intake-heading p, .i5 .work-file-picker > span, .i5 .work-file-empty { font: var(--i5-caption); }
.i5 .shell:not([data-cortex-wallboard="true"]) :is(.cx-inspector-body h4, .cx-empty a) { font-size: 12px; }
.i5 .shell:not([data-cortex-wallboard="true"]) :is(.cx-open, .cx-command-link) { font-size: 12px !important; } /* command-center.css pins 11px with !important */
.i5 .work-intake-steps span { font: 600 11px/1 var(--mos-font-ui); }

/* Activity trigger: a recognisable icon on phones, with the state dot as its badge. Desktop keeps the labelled pill. */
.i5 .activity-trigger-icon { display: none; }
@media (max-width: 767px) {
  .i5 .topbar .activity-trigger { position: relative; justify-content: center; padding: 0; color: var(--mos-text-secondary); }
  .i5 .topbar .activity-trigger .activity-trigger-icon { display: block; width: 18px; height: 18px; }
  .i5 .topbar .activity-trigger .activity-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--mos-canvas); }
  .i5 .topbar .activity-trigger > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 600px) {
  /* Starter tasks are full sentences; three lines on phones instead of cutting the requirement off. */
  .i5 .agent-chat .chat-starters button > span:nth-child(2) { -webkit-line-clamp: 3; }
  .i5 .m17-authority-chain article { padding: 14px; }
}
