/* Form containers, not browser widths, determine usable field columns. */
.fi-sc-form, .fi-modal-content, .fi-section-content, .fi-fo-repeater-item-content, .dw-editor { container-type: inline-size; min-width: 0; }
.fi-sc-form .fi-sc.fi-grid, .fi-modal-content .fi-sc.fi-grid, .dw-editor .fi-sc.fi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.fi-sc-form .fi-grid-col, .fi-modal-content .fi-grid-col, .dw-editor .fi-grid-col { min-width: 0; grid-column: auto !important; }
.fi-sc-form .fi-grid-col:has(.fi-sc-section), .fi-modal-content .fi-grid-col:has(.fi-sc-section),
.dw-editor .fi-grid-col:has(.fi-sc-section), .fi-grid-col:has(.fi-sc-wizard),
.fi-sc-form .fi-grid-col:has(textarea, .fi-fo-file-upload, .fi-fo-repeater),
.fi-modal-content .fi-grid-col:has(textarea, .fi-fo-file-upload, .fi-fo-repeater),
.dw-editor .fi-grid-col:has(textarea, .fi-fo-file-upload, .fi-fo-repeater) { grid-column: 1 / -1 !important; }
.fi-fo-field-wrp-label, .fi-fo-field-wrp-helper-text, .fi-fo-field-wrp-error-message { overflow-wrap: anywhere; }
.fi-section-header, .fi-header-heading, .fi-header-actions-ctn { min-width: 0; flex-wrap: wrap; }
.fi-header { flex-wrap: wrap !important; gap: 1rem; }
.fi-header > div, .fi-header-actions-ctn, .fi-ac { min-width: 0; max-width: 100%; }
.fi-header .fi-ac, .fi-sc-form .fi-ac, .fi-modal .fi-ac { flex-wrap: wrap !important; }
.fi-header .fi-btn-label { white-space: normal; overflow-wrap: anywhere; }
.fi-ta { max-width: 100%; min-width: 0; }
@container (max-width: 700px) {
    .fi-sc-form .fi-sc.fi-grid, .fi-modal-content .fi-sc.fi-grid, .dw-editor .fi-sc.fi-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .fi-sc-form .fi-grid-col, .fi-modal-content .fi-grid-col, .dw-editor .fi-grid-col { grid-column: 1 / -1 !important; }
}
.dw-stack { display: grid; gap: 1.25rem; min-width: 0; }
.dw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.dw-card { padding: 1.25rem; border: 1px solid #dfe5ed; border-radius: .85rem; background: #fff; min-width: 0; }
.dw-card h2 { font-size: 1rem; font-weight: 650; margin-bottom: .7rem; }
.dw-muted { color: #64748b; font-size: .875rem; }
.dw-value { font-size: 1.5rem; font-weight: 650; }
.dw-actions, .dw-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.dw-actions a, .dw-actions button, .dw-tabs button, .dw-tabs a { padding: .55rem .85rem; border: 1px solid #dfe5ed; border-radius: .5rem; font-size: .875rem; text-decoration: none; cursor: pointer; }
.dw-actions .dw-primary, .dw-tabs .is-active { background: #1d4ed8; border-color: #1d4ed8; color: white; }
.dw-row { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: .75rem; padding: .85rem 0; border-bottom: 1px solid #edf1f5; }
.dw-row:last-child { border: 0; }
.dw-row a { color: #1d4ed8; font-weight: 550; }
.dw-row small { display: block; color: #64748b; margin-top: .2rem; }
.dw-search { min-width: 0; width: 100%; border: 1px solid #cbd5e1; border-radius: .6rem; padding: .65rem .85rem; }
.dw-total { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: .75rem; padding: 1rem; }
.dw-warning { background: #fffbeb; border: 1px solid #fde68a; border-radius: .6rem; padding: .85rem; color: #92400e; }
.dw-table-wrap { overflow-x: auto; }
.dw-table { width: 100%; text-align: left; border-collapse: collapse; }
.dw-table th, .dw-table td { padding: .7rem; border-bottom: 1px solid #e2e8f0; }
.dw-table th { font-size: .8rem; color: #64748b; }
html.dark .dw-card { background: #111827; border-color: #334155; }
html.dark .dw-muted, html.dark .dw-row small { color: #94a3b8; }
html.dark .dw-row, html.dark .dw-table td, html.dark .dw-table th, html.dark .dw-actions a, html.dark .dw-actions button, html.dark .dw-tabs button { border-color: #334155; }
html.dark .dw-total { background: #172554; border-color: #1e40af; }
html.dark .dw-row a { color: #93c5fd; }
@media (max-width: 640px) { .dw-card { padding: 1rem; } .dw-actions > * { flex: 1 1 auto; text-align: center; } }
