.tsl-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;

    overflow-y: auto;
    padding: 24px 16px;
}

.tsl-modal.is-open {
    display: block;
}

.tsl-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.tsl-modal__panel {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.tsl-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
}

.tsl-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}

.tsl-modal__x {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fafafa;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.tsl-modal__body {
    padding: 16px 18px 18px;
    overflow-y: auto;
}

.tsl-field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.tsl-field__label {
    font-size: 12px;
    color: #555;
}

.tsl-field__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    outline: none;
}

.tsl-field__input:focus {
    border-color: #bbb;
}

.tsl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 520px) {
    .tsl-grid {
        grid-template-columns: 1fr;
    }
}

.tsl-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0;
    font-size: 13px;
    color: #333;
}

.tsl-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.tsl-btn {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
}

.tsl-btn--ghost {
    background: #939fb0;
}

.tsl-btn--primary {
    background: #111;
    border-color: #111;
    color: #fff;
}

.tsl-error {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff2f2;
    border: 1px solid #ffd3d3;
    color: #7a1a1a;
    font-size: 13px;
}

.tsl-btn--danger {
    background: #fff0f0;
    border-color: #ffbcbc;
    color: #a30000;
}

.tsl-grid--2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 640px) {
    .tsl-grid--2 {
        grid-template-columns: 1fr;
    }
}