.expandable-text-field {
    display: block;
    position: relative;
    min-width: 0;
}

.expandable-text-field > .form-control {
    padding-right: 21px !important;
}

.expandable-text-field-button {
    position: absolute;
    top: 1px;
    bottom: 1px;
    right: 2px;
    width: 18px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: white;
    color: #2865a5;
    font-size: 11px;
    line-height: 1;
}

.expandable-text-field-button:hover,
.expandable-text-field-button:focus-visible {
    background: #e6effa;
    outline: 1px solid #8cafd6;
}

.expandable-text-field-button:disabled {
    display: none;
}

.field-editor-dialog {
    position: fixed;
    width: 420px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    margin: 0;
    padding: 0;
    overflow: auto;
    border: 1px solid #afc3dd;
    border-radius: 6px;
    background: white;
    color: #193b64;
    box-shadow: 0 6px 24px #18395926;
    font-family: inherit;
    font-size: 14px;
}

.field-editor-dialog::backdrop {
    background: transparent;
}

.field-editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #d6dfeb;
    background: #f3f6fa;
}

.field-editor-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.field-editor-close {
    flex: 0 0 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #52647a;
}

.field-editor-close:hover {
    background: #e1eaf5;
}

.field-editor-body {
    padding: 12px;
}

.field-editor-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 6px 10px;
    border: 1px solid #9cb7d8;
    border-radius: 4px;
    background: white;
    color: inherit;
    font: inherit;
    box-sizing: border-box;
}

.field-editor-input:focus {
    border-color: #2865a5;
    outline: 2px solid #2865a526;
}

.field-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.field-editor-footer .btn {
    min-height: 30px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

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

    .field-editor-dialog::backdrop {
        background: #152c4840;
    }

    .field-editor-input {
        height: 42px;
        font-size: 16px;
    }

    .field-editor-footer .btn {
        min-height: 38px;
    }
}

@media print {
    .expandable-text-field-button,
    .field-editor-dialog {
        display: none !important;
    }
}
