/* Framework-neutral visual foundation. No business or dialog behavior. */
.mao-ui {
  box-sizing: border-box;
  background: var(--mao-bg);
  color: var(--mao-text);
  font-family: var(--mao-font);
  font-size: var(--mao-text-base);
  line-height: var(--mao-leading-base);
  font-weight: var(--mao-weight-regular);
}
.mao-ui *, .mao-ui *::before, .mao-ui *::after { box-sizing: inherit; }
.mao-ui :where(button, input, select, textarea) { font-family: inherit; }
.mao-ui :where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: var(--mao-focus-width) solid var(--mao-focus);
  outline-offset: var(--mao-focus-offset);
}
.mao-ui :where(.mao-page) {
  max-width: var(--mao-content-max);
  margin-inline: auto;
  padding: var(--mao-page-pad);
  display: grid;
  gap: var(--mao-section-gap);
  min-width: 0;
}
.mao-ui :where(.mao-page-header, .mao-task-heading, .mao-task-footer) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mao-space-4);
  flex-wrap: wrap;
}
.mao-ui :where(.mao-page-title, .mao-section-title, .mao-task-title) {
  margin: 0;
  font-weight: var(--mao-weight-semibold);
  overflow-wrap: anywhere;
}
.mao-ui :where(.mao-page-title) { font-size: var(--mao-text-page); line-height: var(--mao-leading-page); }
.mao-ui :where(.mao-section-title) { font-size: var(--mao-text-section); line-height: var(--mao-leading-section); }
.mao-ui :where(.mao-task-title) { font-size: var(--mao-text-task); line-height: var(--mao-leading-task); flex: 1 1 180px; }
.mao-ui :where(.mao-secondary) { color: var(--mao-text-secondary); font-size: var(--mao-text-sm); line-height: var(--mao-leading-sm); margin: 0; }
.mao-ui :where(.mao-muted) { color: var(--mao-text-muted); }
.mao-ui :where(.mao-danger-text) { color: var(--mao-danger); }
.mao-ui :where(.mao-panel, .mao-task, .mao-summary) {
  background: var(--mao-surface);
  border-radius: var(--mao-radius-panel);
  padding: var(--mao-panel-pad);
  box-shadow: var(--mao-shadow-card);
  min-width: 0;
}
.mao-ui :where(.mao-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mao-space-2);
  min-height: var(--mao-control-size);
  min-width: var(--mao-control-size);
  padding: var(--mao-space-2) var(--mao-space-4);
  border: var(--mao-border-width) solid var(--mao-control-border);
  border-radius: var(--mao-radius-control);
  background: var(--mao-surface);
  color: var(--mao-text);
  font-size: var(--mao-text-base);
  font-weight: var(--mao-weight-medium);
  line-height: var(--mao-leading-base);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--mao-duration-fast) var(--mao-ease), color var(--mao-duration-fast) var(--mao-ease);
}
.mao-ui :where(.mao-button--primary) { background: var(--mao-action); color: var(--mao-on-action); border-color: var(--mao-action); }
.mao-ui :where(.mao-button--text) { background: transparent; border-color: transparent; }
.mao-ui :where(.mao-button--danger) { background: var(--mao-danger); color: var(--mao-on-danger); border-color: var(--mao-danger); }
.mao-ui :where(.mao-button:active:not(:disabled):not([aria-disabled="true"])) { box-shadow: inset 0 0 0 var(--mao-border-width) currentColor; }
.mao-ui :where(.mao-button:disabled, .mao-button[aria-disabled="true"]) {
  background: var(--mao-disabled-bg); color: var(--mao-disabled-text); border-color: transparent; cursor: not-allowed;
}
/* aria-disabled only styles; the application must suppress activation. */
.mao-ui :where(.mao-button[aria-busy="true"]) { cursor: progress; }
@media (hover: hover) {
  .mao-ui :where(.mao-button:hover:not(:disabled):not([aria-disabled="true"])) { background: var(--mao-surface-subtle); }
  .mao-ui :where(.mao-button--primary:hover:not(:disabled):not([aria-disabled="true"])) { background: var(--mao-action-hover); }
  .mao-ui :where(.mao-button--danger:hover:not(:disabled):not([aria-disabled="true"])) { background: var(--mao-danger); text-decoration: underline; }
}
.mao-ui :where(.mao-field) { display: grid; gap: var(--mao-space-2); }
.mao-ui :where(.mao-field-label) { font-weight: var(--mao-weight-medium); }
.mao-ui :where(.mao-input) {
  width: 100%; min-width: 0; min-height: var(--mao-control-size);
  padding: var(--mao-space-2) var(--mao-space-3);
  border: var(--mao-border-width) solid var(--mao-control-border);
  border-radius: var(--mao-radius-control);
  background: var(--mao-surface); color: var(--mao-text);
  font-size: var(--mao-text-input); line-height: var(--mao-leading-task);
}
.mao-ui :where(.mao-input)::placeholder { color: var(--mao-text-muted); opacity: 1; }
.mao-ui :where(.mao-input[aria-invalid="true"]) { border-color: var(--mao-danger); }
.mao-ui :where(.mao-input:disabled) { background: var(--mao-disabled-bg); color: var(--mao-disabled-text); }
.mao-ui :where(.mao-field-error) { margin: 0; color: var(--mao-danger); font-size: var(--mao-text-sm); }
.mao-ui :where(.mao-badge) {
  display: inline-flex; align-items: center;
  padding: var(--mao-space-1) var(--mao-space-2);
  border-radius: var(--mao-radius-pill);
  background: var(--mao-surface-subtle); color: var(--mao-text-secondary);
  font-size: var(--mao-text-xs); line-height: var(--mao-leading-xs); font-weight: var(--mao-weight-medium);
  flex: 0 0 auto; max-width: 100%; overflow-wrap: anywhere;
}
.mao-ui :where(.mao-badge--danger) { background: var(--mao-danger-bg); color: var(--mao-danger); }
.mao-ui :where(.mao-badge--warning) { background: var(--mao-warning-bg); color: var(--mao-warning); }
.mao-ui :where(.mao-badge--success) { background: var(--mao-success-bg); color: var(--mao-success); }
.mao-ui :where(.mao-badge--info) { background: var(--mao-info-bg); color: var(--mao-info); }
.mao-ui :where(.mao-alert) {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--mao-space-4); padding: var(--mao-space-4);
  background: var(--mao-danger-bg); color: var(--mao-danger); border-radius: var(--mao-radius-panel);
}
.mao-ui :where(.mao-summary-shell) { container-type: inline-size; min-width: 0; }
.mao-ui :where(.mao-summary) { display: grid; gap: var(--mao-space-4); }
.mao-ui :where(.mao-summary-group) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mao-space-3); }
.mao-ui :where(.mao-summary-group--risk) { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: var(--mao-border-width) solid var(--mao-line); padding-top: var(--mao-space-4); }
.mao-ui :where(.mao-metric) { display: grid; align-content: start; gap: var(--mao-space-2); min-width: 0; overflow-wrap: anywhere; }
.mao-ui :where(.mao-metric > span) { color: var(--mao-text-secondary); font-size: var(--mao-text-sm); }
.mao-ui :where(.mao-metric-value) { font-size: var(--mao-text-metric); line-height: var(--mao-leading-metric); font-weight: var(--mao-weight-semibold); font-variant-numeric: tabular-nums; }
@container (min-width: 720px) {
  .mao-ui :where(.mao-summary) { grid-template-columns: 3fr 2fr; gap: var(--mao-space-6); }
  .mao-ui :where(.mao-summary-group--risk) { border-top: 0; padding-top: 0; border-left: var(--mao-border-width) solid var(--mao-line); padding-left: var(--mao-space-6); }
}
.mao-ui :where(.mao-task-list, .mao-task) { display: grid; gap: var(--mao-space-3); }
.mao-ui :where(.mao-task-meta) { display: flex; flex-wrap: wrap; gap: var(--mao-space-2) var(--mao-space-4); margin: 0; color: var(--mao-text-secondary); font-size: var(--mao-text-sm); }
.mao-ui :where(.mao-task-meta > div) { display: flex; flex-wrap: wrap; gap: var(--mao-space-1); }
.mao-ui :where(.mao-task-meta dd) { margin: 0; }
.mao-ui :where(.mao-task-progress) { margin: 0; color: var(--mao-text-secondary); overflow-wrap: anywhere; }
.mao-ui :where(.mao-task-footer) { align-items: center; }
.mao-ui :where(.mao-link) { color: var(--mao-info); text-underline-offset: 3px; }
.mao-ui :where(.mao-table-scroll) { overflow-x: auto; }
.mao-ui :where(.mao-table) { border-collapse: collapse; width: 100%; font-size: var(--mao-text-base); }
.mao-ui :where(.mao-table th, .mao-table td) { text-align: left; padding: var(--mao-space-4) var(--mao-space-3); border-bottom: var(--mao-border-width) solid var(--mao-line); vertical-align: middle; }
.mao-ui :where(.mao-table th) { background: var(--mao-surface-subtle); color: var(--mao-text-secondary); font-weight: var(--mao-weight-medium); }
.mao-ui :where(.mao-table .mao-numeric) { text-align: right; font-variant-numeric: tabular-nums; }
.mao-ui :where(.mao-table tr[aria-selected="true"]) { background: var(--mao-info-bg); }
@media (hover: hover) {
  .mao-ui :where(.mao-table tbody tr:hover:not([aria-selected="true"])) { background: var(--mao-surface-subtle); }
}
.mao-ui :where(.mao-state) { display: grid; gap: var(--mao-space-3); padding: var(--mao-space-8) var(--mao-space-4); justify-items: start; }
.mao-ui :where(.mao-skeleton) { background: var(--mao-surface-subtle); border-radius: var(--mao-radius-control); }
@media (prefers-reduced-motion: reduce) {
  .mao-ui *, .mao-ui *::before, .mao-ui *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
