/* 说明按需展开；问号与标签相邻，不把长说明常驻在工作区。 */
.ui-field-label { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; min-width: 0; min-height: 26px; }
.ui-field-label > label { margin: 0; }
.ui-help { display: inline-flex; vertical-align: middle; margin-inline-start: 2px; font-size: 13px; line-height: 1.5; }
.ui-help > button.ui-help-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; min-width: 26px; min-height: 26px;
  padding: 0; margin: 0; border: 0; border-radius: 4px;
  background: transparent; color: #526377; cursor: pointer;
  box-shadow: none; font: 600 12px/1 sans-serif; flex: 0 0 auto;
}
.ui-help-trigger > span { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; }
.ui-help > button.ui-help-trigger:hover, .ui-help > button.ui-help-trigger[aria-expanded="true"] { background: #edf2f7; color: #183f72; }
.ui-help > button.ui-help-trigger:focus-visible { outline: 2px solid #235eab; outline-offset: 1px; }
.ui-help > .ui-help-panel {
  display: none; position: fixed; inset: auto; z-index: 10000;
  box-sizing: border-box; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  margin: 0; padding: 12px 14px; overflow: auto;
  border: 1px solid #bac6d2; border-radius: 6px; background: #fff; color: #263749;
  box-shadow: 0 4px 16px rgb(22 39 57 / 14%);
  font: 400 13px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: left; white-space: normal; letter-spacing: normal;
}
.ui-help > .ui-help-panel:popover-open { display: block; }
.ui-help > .ui-help-panel[data-fallback-open="true"] { display: block; }
.ui-help-panel .ui-help-title { display: block; margin: 0 0 5px; color: #182c42; font-size: 13px; font-weight: 650; line-height: 1.5; }
.ui-help-panel .ui-help-copy { display: block; white-space: pre-line; overflow-wrap: anywhere; }
.field:has(> input[type="checkbox"]) > .ui-field-label,
.field:has(> input[type="radio"]) > .ui-field-label { grid-column: 2; grid-row: 1; }
/* 公司管理页面也复用相同表单，布局不再依赖 Django 默认的 <p> 包裹。 */
.edit-form > .field { display: grid; gap: 4px; min-width: 0; align-content: start; margin-bottom: 14px; }
.edit-form > .field .field__error { color: #a52628; font-size: 12px; }
@media (max-width: 640px), (pointer: coarse) {
  .ui-help > button.ui-help-trigger { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}
