:root {
  --lm-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --lm-ui-bg: #f5f7f5;
  --lm-ui-surface: #ffffff;
  --lm-ui-surface-subtle: #f8faf9;
  --lm-ui-text: #101615;
  --lm-ui-muted: #66736f;
  --lm-ui-line: #dfe6e2;
  --lm-ui-line-strong: #cbd6d1;
  --lm-ui-green: #45d7a8;
  --lm-ui-green-deep: #10372f;
  --lm-ui-green-soft: #eaf8f2;
  --lm-ui-danger: #b42318;
  --lm-ui-focus: rgba(69, 215, 168, 0.22);
  --lm-ui-radius: 8px;
  --lm-ui-control-height: 42px;
  --lm-ui-button-height: 40px;
  --lm-ui-button-gap: 8px;
  --lm-ui-field-gap: 6px;
  --lm-ui-section-gap: 24px;
}

html,
body {
  background: var(--lm-ui-bg);
}

body {
  font-size: 14px !important;
  line-height: 1.5;
}

body,
button,
input,
select,
textarea {
  font-family: var(--lm-font-sans);
  letter-spacing: 0;
}

.lm-system-shell {
  background: var(--lm-ui-bg);
  color: var(--lm-ui-text);
  font-family: var(--lm-font-sans);
  font-size: 14px;
  line-height: 1.5;
}

.lm-system-shell :where(h1, h2, h3, h4, h5, h6, p, label, button, input, select, textarea),
.account-shell :where(h1, h2, h3, p, label, button, input),
.supplier-page :where(h1, h2, h3, p, label, button, input, select, textarea) {
  letter-spacing: 0;
}

.lm-page,
.lm-shell-content,
.account-main {
  padding-top: 32px;
  padding-bottom: 64px;
}

.lm-page-head,
.lm-project-head,
.section-head,
.panel-head {
  gap: 16px;
}

.lm-page-head {
  margin-bottom: 24px;
}

.lm-page-head h1,
.account-heading h1,
.knowledge-search-copy h2,
.file-manager-hero h2 {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: 0;
}

.lm-page-head p,
.account-heading p,
.knowledge-search-copy p,
.file-manager-hero p {
  font-size: 14px;
  line-height: 1.6;
}

.lm-eyebrow,
.account-heading .eyebrow,
.knowledge-search-copy > span,
.file-manager-hero > span {
  letter-spacing: 0;
  text-transform: none;
}

:where(.btn, .lm-btn, .approval-btn, .account-button, .basic-save-btn, .supplier-file-button) {
  min-height: var(--lm-ui-button-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--lm-ui-button-gap);
  padding: 0 14px;
  border-radius: var(--lm-ui-radius);
  box-shadow: none;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
}

:where(.btn, .lm-btn, .approval-btn, .account-button, .basic-save-btn, .supplier-file-button):hover {
  box-shadow: none;
  transform: none;
}

:where(.btn, .lm-btn, .approval-btn, .account-button, .basic-save-btn, .supplier-file-button):active {
  transform: none;
}

.lm-header-meta :where(a, button, summary),
.admin-system-shell .topbar .btn {
  min-height: 44px;
  border-radius: var(--lm-ui-radius);
}

:where(.btn.icon, .approval-btn.icon) {
  width: var(--lm-ui-button-height);
  min-width: var(--lm-ui-button-height);
  padding: 0;
}

:where(.topbar-actions, .form-actions, .invite-actions, .authorization-actions, .system-card-actions, .modal-actions, .lm-page-actions, .lm-section-actions, .lm-row-actions, .account-actions, .account-avatar-actions, .template-row-tools) {
  gap: var(--lm-ui-button-gap);
}

:where(.field, .lm-form-field, .account-field, .approval-field) {
  gap: var(--lm-ui-field-gap);
}

:where(
  .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .field select,
  .field textarea,
  .lm-input,
  .lm-select,
  .lm-textarea,
  .approval-input,
  .approval-select,
  .approval-textarea,
  .account-field input,
  .filters input,
  .filters select,
  .contract-form input,
  .contract-form select,
  .contract-form textarea,
  .invite-form input,
  .invite-form select,
  .invite-form textarea,
  .link-input,
  .basic-admin-grid input,
  .basic-admin-grid select,
  .upload-detail-grid input,
  .upload-detail-grid select,
  .upload-detail-grid textarea,
  .upload-review-grid select,
  .upload-review-grid textarea
) {
  min-height: var(--lm-ui-control-height);
  border-radius: var(--lm-ui-radius);
  padding: 9px 12px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: none;
}

:where(
  .field input,
  .field select,
  .field textarea,
  .lm-input,
  .lm-select,
  .lm-textarea,
  .approval-input,
  .approval-select,
  .approval-textarea,
  .account-field input
):focus {
  border-color: #278869;
  outline: none;
  box-shadow: 0 0 0 3px var(--lm-ui-focus);
}

:where(
  .lm-function-directory,
  .lm-stat-grid,
  .lm-panel,
  .lm-project-list,
  .panel,
  .panel-card,
  .docuseal-status-card,
  .invite-link-box,
  .modal-panel,
  .drawer-panel,
  .system-card,
  .kv,
  .source-help,
  .unmatched-panel,
  .empty-state,
  .account-panel,
  .business-card-panel,
  .knowledge-index-card,
  .knowledge-search-hero,
  .file-manager-hero
) {
  border-radius: var(--lm-ui-radius);
  box-shadow: none;
}

.knowledge-search-hero,
.file-manager-hero {
  background: var(--lm-ui-surface);
}

.account-shell::before {
  display: none;
}

.account-grid,
.account-stack {
  gap: var(--lm-ui-section-gap);
}

.account-panel-header {
  padding: 18px 20px 14px;
}

.account-panel-body {
  padding: 18px 20px 20px;
}

.account-heading {
  margin-bottom: 24px;
}

.filter-chip,
.lm-chip,
.badge,
.status-chip {
  box-shadow: none;
  letter-spacing: 0;
}

.modal-panel,
.drawer-panel {
  box-shadow: 0 18px 48px rgba(16, 55, 47, 0.14);
}

.lm-system-shell :focus-visible,
.account-shell :focus-visible {
  outline: 2px solid rgba(39, 136, 105, 0.72);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .lm-page,
  .lm-shell-content,
  .account-main {
    padding-top: 24px;
    padding-bottom: 48px;
  }

  .lm-page-head h1,
  .account-heading h1,
  .knowledge-search-copy h2,
  .file-manager-hero h2 {
    font-size: 28px;
  }

  .knowledge-search-hero,
  .file-manager-hero {
    padding: 20px;
  }
}

/* High-specificity normalization for legacy page styles. */
.lm-system-shell .btn,
.lm-system-shell .lm-btn,
.lm-system-shell .approval-btn,
.account-shell .account-button {
  min-height: var(--lm-ui-button-height);
  border-radius: var(--lm-ui-radius);
  padding: 0 14px;
  gap: var(--lm-ui-button-gap);
  box-shadow: none;
  transform: none;
}

.lm-system-shell .lm-header-meta :where(a, button, summary),
.lm-system-shell .topbar .btn {
  min-height: 44px;
  border-radius: var(--lm-ui-radius);
}

.business-card-system-shell .btn {
  min-height: 40px;
  border-radius: var(--lm-ui-radius);
  padding: 0 14px;
}

.business-card-system-shell :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea),
.account-shell .account-field input {
  min-height: var(--lm-ui-control-height);
  margin-top: 6px;
  border-radius: var(--lm-ui-radius);
  padding: 9px 12px;
  font-size: 14px;
}

.business-card-system-shell input[type="file"] {
  border-radius: var(--lm-ui-radius);
}

.business-card-system-shell :where(.panel, .notice, .mini-public-card),
.account-shell .account-panel {
  border-radius: var(--lm-ui-radius);
  box-shadow: none;
}

.knowledge-standalone-shell .knowledge-google-bar {
  min-height: 48px;
  border-radius: var(--lm-ui-radius);
  box-shadow: none;
}

.knowledge-standalone-shell .knowledge-google-bar .btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
}

.knowledge-standalone-shell .knowledge-google-bar input {
  min-height: 42px;
  border-radius: var(--lm-ui-radius);
  font-size: 14px;
}
