/* One native page title. Help/actions may use another row; the title never wraps. */
.telei-page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  margin-block-end: 10px;
}
.telei-page-title {
  flex: 1 1 20rem;
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow-x: auto;
  overflow-y: hidden;

  padding-block-end: 2px;
}
.telei-page-title:focus-visible {
  outline: 2px solid #2d648d;
  outline-offset: 3px;
}
body .telei-page-heading > .kb-section-link {
  flex: 0 0 auto;
  min-inline-size: 0;
  max-inline-size: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  text-align: right;
}
.telei-page-heading > .kb-section-link a {
  justify-content: flex-end;
  max-inline-size: 100%;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
/* A shared heading may be inside an unnamed legacy flex/grid text column.
   Its immediate content parent must be shrinkable too: default min-width:auto
   would expand that parent before the title viewport can scroll. This generic
   rule covers current and future section wrappers, including Finance. */
main :has(> .telei-page-heading) {
  min-inline-size: 0;
  max-inline-size: 100%;
}
:is(.mdm-page-header,.employee-title-row,.employee-list-header,.employee-form-header,.kpi-manager-title-row,.fin-heading,.dh-heading,.sq-titleline) > div:has(.telei-page-heading) {
  flex: 1 1 auto;
  min-inline-size: 0;
  max-inline-size: 100%;
}
/* A cascade layer gives these site invariants priority over later page-local
   important rules. This keeps existing and future sections on one contract. */
@layer telei-layout-invariants {
  .telei-page-title > h1 {
    inline-size: max-content !important;
    min-inline-size: 0 !important;
    max-inline-size: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    text-overflow: clip !important;
  }
  table thead th,
  table th[scope="col"] {
    text-align: center !important;
  }
  @media (max-width: 700px) {
    .telei-page-title > h1 {
      font-size: clamp(18px, 5vw, 24px) !important;
    }
  }
}
@media (max-width: 700px) {
  .telei-page-title { flex-basis: 100%; }
  body .telei-page-heading > .kb-section-link {
    font-size: 12px;
  }
}
/* Admin's native tools used to float into the preceding H1 with a negative
   margin. Only that top sibling toolbar moves below the shared title. */
#content > .telei-page-heading ~ #content-main > .object-tools {
  float: none;
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
/* Seller articles retain their existing typography and dimensions. Copying adds
   native text selection and keyboard focus only; no button/cell/chip styling. */
[data-telei-copy] {
  -webkit-user-select: text;
  user-select: text;
  cursor: copy;
}
[data-telei-copy][role="button"]:focus-visible {
  outline: 2px solid #2d648d;
  outline-offset: 2px;
}

/* Pilot article used the standard link colour; its separate existing passport
   link continues navigation while the article itself copies on click. */
.pilot-copy-article { color: #0000ee; }
.telei-page-title.telei-page-title--hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* One disclosure glyph for native details and explicit, aria-expanded buttons.
   Native summaries retain their existing flow and activation. Explicit slots
   keep complex grid headers intact; the glyph never becomes a second control. */
@layer telei-disclosure-invariants {
  :root {
    --telei-disclosure-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 6 6 6-6 6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  details:not(.telei-help) > summary {
    list-style: none !important;
  }
  details:not(.telei-help) > summary::-webkit-details-marker {
    display: none !important;
  }
  details:not(.telei-help) > summary::marker {
    content: "" !important;
  }
  details:not(.telei-help) > summary:not([data-telei-disclosure-layout="explicit"])::before,
  .telei-disclosure-icon {
    content: "" !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    inline-size: 18px !important;
    block-size: 18px !important;
    flex: 0 0 18px !important;
    margin-inline-end: 7px !important;
    vertical-align: -3px !important;
    color: inherit;
    background-color: currentColor !important;
    -webkit-mask: var(--telei-disclosure-glyph) center / contain no-repeat !important;
    mask: var(--telei-disclosure-glyph) center / contain no-repeat !important;
    border: 0 !important;
    border-radius: 0 !important;
    pointer-events: none !important;
    user-select: none !important;
    transform: rotate(0deg) !important;
    transition: transform 160ms ease !important;
  }
  .telei-disclosure-icon {
    color: inherit;
    margin-inline-end: 0 !important;
  }
  /* Desktop navigation already supplies its own 2px flex gap. Do not add
     the generic text-flow margin to each section in its nonwrapping row. */
  nav.telei-nav-desktop > details.telei-nav-section > summary::before {
    margin-inline-end: 0 !important;
  }
  details[open]:not(.telei-help) > summary:not([data-telei-disclosure-layout="explicit"])::before,
  details[open] > summary .telei-disclosure-icon,
  .telei-disclosure-button[aria-expanded="true"] .telei-disclosure-icon,
  [data-telei-disclosure-command="expand"] .telei-disclosure-icon {
    transform: rotate(90deg) !important;
  }
  .telei-disclosure-command {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .telei-disclosure-command[hidden],
  .telei-disclosure-icon[hidden] {
    display: none !important;
  }
  details:not(.telei-help) > summary[data-telei-disclosure-layout="explicit"]::before {
    content: none !important;
  }
  /* Navigation already has a contrast-safe focus ring on its dark shell.
     Preserve that component contract while sharing this layer's glyph. */
  details:not(.telei-help):not(.telei-nav-section):not([data-telei-nav-drawer]) > summary:focus-visible,
  .telei-disclosure-button:focus-visible,
  .telei-disclosure-command:focus-visible {
    outline: 2px solid #2d648d !important;
    outline-offset: 3px !important;
  }
  /* Search already reserves a trailing indicator. Keep the other flex children
     and all existing spacing; no workspace markup or event handler is needed. */
  details.sq-details > summary::before {
    order: 2 !important;
    margin-inline-start: auto !important;
    margin-inline-end: 0 !important;
  }
  /* These card shells clip overflow; keep their keyboard ring inside the
     summary instead of clipping an otherwise invisible outer outline. */
  details.sq-details > summary:focus-visible,
  details.wb-ads-glue-card > summary:focus-visible {
    outline-offset: -3px !important;
  }
  @media (prefers-reduced-motion: reduce) {
    details:not(.telei-help) > summary:not([data-telei-disclosure-layout="explicit"])::before,
    .telei-disclosure-icon {
      transition: none !important;
    }
  }
  @media (forced-colors: active) {
    details:not(.telei-help) > summary:not([data-telei-disclosure-layout="explicit"])::before,
    .telei-disclosure-icon {
      background-color: CanvasText !important;
      forced-color-adjust: none !important;
    }
  }
  @media print {
    details:not(.telei-help) > summary:not([data-telei-disclosure-layout="explicit"])::before,
    .telei-disclosure-icon {
      display: none !important;
    }
  }
}
