:root {
  --tiweb-corner-radius: 8px;
  --tiweb-surface-radius: 14px;
}

body {
  --mud-default-borderradius: var(--tiweb-corner-radius);
}

/* POS preview dimensions and the original button shapes are part of the saved layout. */
:is(button, input[type="button"], input[type="submit"], input[type="reset"], [role="button"],
    .mud-button-root, a.button, a.btn, a.staff-action, .mud-input-outlined-border, .mud-popover,
    input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], .mud-input-slot),
    select, textarea):not(:where(.pos-key, .pos-key *, .pos-group-page, .pos-screen *,
    .function-board *, .function-key, .function-key *, .shift-brand, .mud-chip, .mud-avatar,
    .mud-icon-button, .mud-fab, .coin-balance-button)) {
  border-radius: var(--tiweb-corner-radius) !important;
}

:is(.mud-icon-button, .mud-fab):not(:where(.pos-screen *, .function-board *)) {
  border-radius: 50% !important;
}

:is(.mud-paper, .mud-card, .mud-dialog, .mud-alert, .mud-table, .mud-table-container,
    .tiweb-admin-table-scroll, .ti-modal, dialog, .sales-dashboard-kpi, .sales-dashboard-action,
    .journal-kpi, .ai-action-card, .planner-stat-card, .warehouse-item-card, .recipe-sales-card, .warehouse-kpis button,
    .dashboard-kpi, .coach-card, .staff-review-card, .team-home-grid button,
    .article-editor-action, .article-dashboard-metric, .article-duplicate-tile):not(:where(
    .mud-appbar, .mud-drawer, .mud-popover, .pos-screen *, .function-board *)) {
  border-radius: var(--tiweb-surface-radius) !important;
}

/* Round the coloured sections of dialogs without clipping focused or scrollable content. */
.mud-dialog > .mud-dialog-title {
  border-start-start-radius: inherit;
  border-start-end-radius: inherit;
}

.mud-dialog > .mud-dialog-actions {
  border-end-start-radius: inherit;
  border-end-end-radius: inherit;
}

@media (max-width: 600px) {
  .mud-dialog {
    max-width: calc(100vw - 24px);
  }

  .mud-dialog > .mud-dialog-content {
    min-width: 0 !important;
  }

  .mud-dialog > .mud-dialog-actions {
    flex-wrap: wrap;
    row-gap: .35rem;
  }
}
