.ld-modal-dialog {
    max-width: 640px;
    margin: 1rem auto;
}

.ld-modal-content {
    border-radius: 12px;
    border: none;
    padding: 20px 24px 16px;
    max-height: min(92vh, 720px);
    display: flex;
    flex-direction: column;
}

.ld-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ld-modal-title {
    color: #444;
    font-size: 20px;
    font-weight: 700;
}

.ld-modal-close {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.7;
}

.ld-modal-close:hover {
    opacity: 1;
}

.ld-modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    padding-right: 2px;
}

.ld-section {
    margin-bottom: 12px;
}

.ld-label {
    color: #555;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.ld-label em {
    color: #e85d04;
    font-style: normal;
}

.ld-hint {
    color: #999;
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

.ld-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ld-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
    background: #fff;
    line-height: 1.3;
}

.ld-chip-subject {
    min-width: 96px;
}

.ld-chip:hover {
    border-color: #3f8dfc;
}

.ld-chip-selected {
    border: 2px solid #3f8dfc;
    color: #3f8dfc;
    padding: 5px 9px;
}

.ld-flag {
    width: 20px;
    height: 20px;
    object-fit: cover;
}

.ld-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin-top: 4px;
}

.ld-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.ld-field-full {
    grid-column: 1 / -1;
}

.ld-field input,
.ld-field textarea {
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
    resize: vertical;
}

.ld-field input:focus,
.ld-field textarea:focus {
    outline: none;
    border-color: #3f8dfc;
}

.ld-error {
    margin-top: 8px;
    color: #d64545;
    font-size: 13px;
}

.ld-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    margin-top: 12px;
}

.ld-submit-btn,
.ld-cancel-btn {
    min-width: 120px;
}

@media (max-width: 576px) {
    .ld-modal-dialog {
        margin: 0.5rem;
        max-width: none;
    }

    .ld-modal-content {
        padding: 16px;
        max-height: 94vh;
    }

    .ld-fields {
        grid-template-columns: 1fr;
    }

    .ld-chip-subject {
        min-width: 0;
        flex: 1 1 calc(50% - 8px);
    }
}
