.modal-component {
    width: min(92vw, 58rem);
    max-height: min(88vh, 58rem);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #dce6eb;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1.5rem 4rem rgba(19, 42, 59, .28);
    color: #284a64;
}

.modal-component::backdrop {
    background: rgba(20, 38, 52, .58);
    backdrop-filter: blur(4px);
}

.modal-component.modal-small { width: min(92vw, 30rem); }
.modal-component.modal-medium { width: min(92vw, 44rem); }
.modal-component.modal-large { width: min(94vw, 72rem); }
.modal-component.modal-full { width: min(96vw, 96rem); max-height: 92vh; }
.modal-component.modal-drawer {
    width: min(96vw, 34rem);
    max-width: 34rem;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 0 0 auto;
    border-radius: 0;
}

.modal-component.modal-drawer .modal-container-component {
    height: 100%;
}

.modal-component.modal-drawer .modal-body {
    flex: 1;
    overflow-y: auto;
}

.modal-container-component {
    display: flex;
    max-height: inherit;
    flex-direction: column;
    background: #fff;
}

.modal-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5edf1;
    background: #fff;
}

.modal-component__title {
    margin: 0;
    color: #284a64;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 800;
    line-height: 1.25;
}

.modal-component__subtitle {
    margin: .35rem 0 0;
    color: #71808b;
    font-size: .8rem;
    line-height: 1.45;
}

.modal-component__close {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid #dce6eb;
    border-radius: .6rem;
    background: #fff;
    color: #607784;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.modal-component__close:hover { border-color: #efbfc0; background: #fff1f1; color: #c64f4f; }
.modal-component__close:focus-visible { outline: 3px solid rgba(44, 102, 154, .2); outline-offset: 2px; }

.modal-body {
    min-height: 0;
    padding: 1.15rem 1.5rem;
    overflow: auto;
    background: #fff;
}

.content-section-modal,
.form-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: .7rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5edf1;
    background: #f8fafb;
}

.grid-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.section-title { grid-column: 1 / -1; margin-bottom: .25rem; padding-bottom: .55rem; border-bottom: 1px solid #e5edf1; color: #c87924; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.toggle-group { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem; border-radius: .65rem; background: #f4f8fa; }
.toggle-group div { display: flex; flex-direction: column; gap: .3rem; }
.dynamic-item { display: flex; flex-direction: column; }
.dynamic-item-check { display: flex; flex-direction: row; gap: .35rem; }

@media (max-width: 640px) {
    .modal-component,
    .modal-component.modal-small,
    .modal-component.modal-medium,
    .modal-component.modal-large,
    .modal-component.modal-full { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
    .modal-header,
    .modal-body,
    .modal-footer { padding-right: 1rem; padding-left: 1rem; }
    .grid-row { grid-template-columns: 1fr; }
    .modal-footer { flex-wrap: wrap; }
}
