:root {
  --ui-font-family: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --ui-regular-weight: 400;
  --ui-medium-weight: 500;
  --ui-control-weight: 600;
  --ui-title-weight: 700;
}

html,
body,
button,
input,
select,
textarea,
table,
dialog {
  font-family: var(--ui-font-family) !important;
}

body {
  font-weight: var(--ui-regular-weight);
  line-height: 1.5;
}

p,
li,
dd,
td,
.hint,
.page-note,
.page-subtitle,
.inline-help,
.field-hint,
.helper-text,
.page-desc {
  font-weight: var(--ui-regular-weight) !important;
}

input,
select,
textarea {
  font-weight: var(--ui-medium-weight) !important;
  line-height: 1.45 !important;
}

button,
.btn,
.button-like,
[role="button"],
label,
th,
.nav-link,
.tab-button,
.badge,
[class*="-badge"] {
  font-weight: var(--ui-control-weight) !important;
  line-height: 1.4;
}

.mobile-topbar-pill,
.toast {
  font-weight: var(--ui-control-weight) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-head h2,
.section-title h2,
.panel h2,
.modal-head h2,
.material-name-pane-title {
  font-weight: var(--ui-title-weight) !important;
  line-height: 1.3;
}

strong,
b {
  font-weight: var(--ui-control-weight) !important;
}

.eyebrow,
.sidebar-brand strong,
.profile-meta strong {
  font-size: 15px !important;
  font-weight: var(--ui-control-weight) !important;
  line-height: 1.4;
}

.sidebar-brand span,
.profile-meta span,
.nav-link {
  font-size: 15px !important;
  line-height: 1.45;
}

table th,
table td {
  font-size: 15px !important;
  line-height: 1.45 !important;
}

.stat strong,
.stock-badge,
.material-card-stock strong,
.material-card-stock-button strong,
.material-card-stocktake-summary strong,
.material-rack-item-stock strong,
.material-finder-selection-stock,
.material-stocktake-number,
.tx-col-inbound,
.tx-col-outbound,
.tx-col-stock,
.pdr-weather-readings strong,
.pdr-robot-state {
  font-weight: var(--ui-title-weight) !important;
}

.material-card-stock strong,
.material-card-stock-button strong,
.material-card-stocktake-summary strong,
.material-rack-item-stock strong,
.material-finder-selection-stock,
.material-stocktake-number,
.tx-col-inbound,
.tx-col-outbound,
.tx-col-stock,
.pdr-weather-readings strong {
  font-size: max(16px, 1em);
}

.pdr-weather-readings .pdr-weather-current strong {
  font-weight: var(--ui-title-weight) !important;
}

.pdr-rate-line {
  font-weight: var(--ui-medium-weight) !important;
}

.pdr-rate-line--unit {
  font-weight: var(--ui-control-weight) !important;
}

.material-card em {
  font-style: normal;
  font-weight: var(--ui-control-weight) !important;
}

.material-card-photo-empty {
  font-size: 15px !important;
  font-weight: var(--ui-medium-weight) !important;
  line-height: 1.45 !important;
}

.md-project-floor {
  font-weight: var(--ui-title-weight) !important;
}

.md-status-chip,
.md-open-date-chip,
.md-flag-badge {
  font-size: 15px !important;
  font-weight: var(--ui-control-weight) !important;
  line-height: 1.4 !important;
}

.pdr-weekday-time-button span,
.pdr-robot-times span,
.pdr-op-field > span,
.pdr-op-field label span {
  font-weight: var(--ui-control-weight) !important;
}

.tx-list-table th,
.tx-list-table td {
  font-size: 15px !important;
  line-height: 1.45 !important;
}

/* Shared material workflows keep readable copy and controls inside every popup. */
.material-reference-dialog,
.material-finder-modal,
.material-stocktake-dialog,
.material-auth-dialog {
  font-size: 15px;
  line-height: 1.45;
}

.material-reference-dialog :is(p, span, small, label, em, b),
.material-finder-modal :is(p, span, small, label, em, b),
.material-stocktake-dialog :is(p, span, small, label, em, b),
.material-auth-dialog :is(p, span, small, label, em, b) {
  font-size: 15px !important;
  line-height: 1.4 !important;
}

.material-reference-dialog :is(p, span, small, em),
.material-finder-modal :is(p, span, small, em),
.material-stocktake-dialog :is(p, span, small, em),
.material-auth-dialog :is(p, span, small, em) {
  font-weight: var(--ui-medium-weight) !important;
}

.material-finder-selection .selected-material-summary .summary-stock > span {
  font-size: 16px !important;
  font-weight: var(--ui-title-weight) !important;
}

/* The six compact parts-cabinet labels must stay on one line at 360px. */
.material-reference-dialog .material-rack-level-label.is-parts-cabinet > strong,
.material-finder-modal .material-rack-level-label.is-parts-cabinet > strong {
  font-size: 14px !important;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.material-name-preview .material-name-preview-stock > em,
.material-name-preview .material-name-preview-action-stock > strong {
  color: #1257b8 !important;
  font-size: 16px !important;
  font-weight: var(--ui-title-weight) !important;
}

.material-reference-dialog .panel-label,
.material-finder-modal .panel-label {
  font-size: 15px !important;
  font-weight: var(--ui-control-weight) !important;
  line-height: 1.4 !important;
}

.material-reference-dialog :is(button, input, select, textarea, [role="button"]),
.material-finder-modal :is(button, input, select, textarea, [role="button"]),
.material-stocktake-dialog :is(button, input, select, textarea, [role="button"]),
.material-auth-dialog :is(button, input, select, textarea, [role="button"]) {
  min-height: 44px !important;
  font-size: 15px !important;
  font-weight: var(--ui-control-weight) !important;
  line-height: 1.4 !important;
}

.material-finder-modal #issueIssuerChecklist .issue-issuer-btn {
  font-size: 15px !important;
}

@media (max-width: 900px) {
  /* Keep issuer pills on the same mobile size contract as the attendance
   * picker.  The generic popup control clamp above would otherwise force
   * these back to 44px/15px after mobile.css has established 48px/16px. */
  .material-finder-modal #issueIssuerChecklist .issue-issuer-btn {
    min-height: 48px !important;
    font-size: 16px !important;
  }
}

/* The active-state control keeps a native checkbox inside a 48px hit area. */
.material-reference-dialog .material-form-active input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px !important;
}

.material-reference-dialog .material-name-spec-list .material-rack-item,
.material-finder-modal .material-name-spec-list .material-rack-item {
  height: auto !important;
  min-height: 94px !important;
}

.material-reference-dialog #unlockItemNoBtn {
  min-height: 44px !important;
  font-size: 15px !important;
  font-weight: var(--ui-control-weight) !important;
}

.material-reference-dialog .material-rack-item-category,
.material-reference-dialog .material-finder-category,
.material-finder-modal .material-rack-item-category,
.material-finder-modal .material-finder-category {
  font-size: 14px !important;
  font-weight: var(--ui-control-weight) !important;
  line-height: 1 !important;
}

@media (max-width: 900px) {
  .material-reference-dialog .material-name-spec-list .material-rack-item,
  .material-finder-modal .material-name-spec-list .material-rack-item {
    min-height: 100px !important;
  }
}

.material-rack-item.is-category-match .material-rack-item-category {
  font-weight: var(--ui-title-weight) !important;
}

.material-reference-dialog :is(
  .material-rack-item-stock strong,
  .material-finder-stock strong,
  .material-finder-selection-stock,
  .material-name-preview-action-stock strong
),
.material-finder-modal :is(
  .material-rack-item-stock strong,
  .material-finder-stock strong,
  .material-finder-selection-stock,
  .material-name-preview-action-stock strong
),
.material-stocktake-dialog .material-stocktake-number {
  font-size: 16px !important;
  font-weight: var(--ui-title-weight) !important;
}
