/* ─── Dialog shell ─────────────────────────────────────────────────────────── */

.syngli-panel {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.syngli-panel_backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 28, 34, 0.5);
}

.syngli-panel_dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1080px, calc(100vw - 48px));
    max-height: calc(100vh - 120px);
    margin: 60px auto;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.syngli-panel_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid #ececec;
    flex-shrink: 0;
}

.syngli-panel_title {
    display: inline-block;
    margin: 0;
    flex: 1;
    min-width: 0;
    color: #333333;
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
    text-transform: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.syngli-panel_close {
    background: none;
    border: none;
    font-size: 15px;
    color: #aaa;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
}

.syngli-panel_close:hover { color: #444; }

.syngli-panel_body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px 24px;
}

body.syngli-panel-open {
    overflow: hidden;
}

/* ─── Form fields ───────────────────────────────────────────────────────────── */

.syngli-panel_form_grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    align-items: start;
}

.syngli-panel_field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: start;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    font-weight: normal;
}

.syngli-panel_field-wide {
    grid-column: 1 / -1;
}

.syngli-panel_field_label {
    color: #6b6257;
    font-family: source_sans_prolight, serif;
    font-size: 13px;
    line-height: 18px;
    text-transform: lowercase;
}

.syngli-panel_field_hint {
    color: #b3261e;
    font-size: 12px;
    line-height: 16px;
}

.syngli-panel_static_value {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    background: #f8fafc;
    box-sizing: border-box;
    color: #5c6670;
    font-family: source_sans_prolight, serif;
    font-size: 14px;
    line-height: 20px;
}

.syngli-panel_input,
.syngli-panel_select,
.syngli-panel_textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d6dce3;
    border-radius: 8px;
    background: #ffffff;
    box-sizing: border-box;
    color: #2b3138;
    font-family: source_sans_prolight, serif;
    font-size: 14px;
    line-height: 20px;
}

.syngli-panel_textarea {
    resize: vertical;
}

.syngli-panel_input:focus,
.syngli-panel_select:focus,
.syngli-panel_textarea:focus,
.syngli-panel_close:focus {
    outline: none;
    border-color: #8fb6e8;
    box-shadow: 0 0 0 3px rgba(143, 182, 232, 0.18);
}

.syngli-panel_input:disabled,
.syngli-panel_select:disabled,
.syngli-panel_textarea:disabled {
    background: #f5f5f5;
    color: #666666;
    cursor: default;
    opacity: 1;
}

/* ─── Action bar ────────────────────────────────────────────────────────────── */

.syngli-panel_actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
    margin-top: 18px;
}

.syngli-panel_button {
    appearance: none;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    background: #ffffff;
    color: #444444;
    font-family: source_sans_proregular, serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    padding: 8px 14px;
}

.syngli-panel_button:hover,
.syngli-panel_button:focus {
    background: #f4f4f4;
    color: #222222;
    text-decoration: none;
    outline: none;
}

.syngli-panel_button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.syngli-panel_button-secondary {
    opacity: 0.82;
}

.syngli-panel_status {
    order: 1;
    flex: 1 1 auto;
    min-height: 20px;
    color: #7c705d;
    font-family: source_sans_prolight, serif;
    font-size: 14px;
    line-height: 20px;
    transition: color 120ms ease;
}

.syngli-panel_status-info    { color: #5d4b2e; }
.syngli-panel_status-success { color: #1f5d3b; }
.syngli-panel_status-error   { color: #9f1d2a; }

/* ─── Progress bar ──────────────────────────────────────────────────────────── */

.syngli-panel_progress {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #d8e1ea;
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(124, 169, 219, 0.18), transparent 38%),
        linear-gradient(135deg, #fafcff 0%, #f3f7fb 100%);
}

.syngli-panel_progress_header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.syngli-panel_progress_title {
    color: #38516b;
    font-family: baskerville, georgia, serif;
    font-size: 18px;
    line-height: 22px;
}

.syngli-panel_progress_timer {
    color: #6d7f92;
    font-family: source_sans_probold, serif;
    font-size: 13px;
    line-height: 18px;
    letter-spacing: 0.03em;
}

.syngli-panel_progress_bar {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(132, 159, 186, 0.22);
}

.syngli-panel_progress_fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 42%;
    border-radius: 999px;
    background: linear-gradient(90deg, #8ab4df 0%, #557fa8 45%, #9fc0e2 100%);
    animation: syngli-panel-progress-slide 1.6s ease-in-out infinite;
}

.syngli-panel_progress_note {
    margin-top: 10px;
    color: #617285;
    font-family: source_sans_prolight, serif;
    font-size: 14px;
    line-height: 20px;
}

@keyframes syngli-panel-progress-slide {
    0%   { transform: translateX(-72%); }
    50%  { transform: translateX(105%); }
    100% { transform: translateX(230%); }
}

/* ─── Shared centered modal (show_syngli_modal) ─────────────────────────────── */

body.syngli-modal_open {
    overflow: hidden;
}

.syngli-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    /* [CL] SYNGLI-6829 -- must outrank #premises-preview_overlay (z-index: 9999,
       includes/premises.css) since show_syngli_modal is now also opened from
       within the premise preview screen (the variant editor) -- at the
       previous z-index: 2000 it rendered behind the preview overlay and was
       invisible even though it was technically open. Modals are meant to be
       the topmost layer whenever open, so this raises the whole component,
       not just this one caller. */
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.syngli-modal-dialog {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.syngli-modal-header {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #ececec;
    flex-shrink: 0;
    gap: 10px;
}

.syngli-modal-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.syngli-modal-close {
    background: none;
    border: none;
    font-size: 15px;
    color: #aaa;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
}

.syngli-modal-close:hover { color: #444; }

.syngli-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px;
}

.syngli-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 18px;
    border-top: 1px solid #ececec;
    flex-shrink: 0;
}

.syngli-modal-error {
    flex: 1;
    font-size: 12px;
    color: #c0392b;
    margin: 0;
}

.syngli-modal-btn {
    appearance: none;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    background: #ffffff;
    color: #444444;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    padding: 8px 14px;
    cursor: pointer;
}

.syngli-modal-btn:hover,
.syngli-modal-btn:focus {
    background: #f4f4f4;
    color: #222222;
    outline: none;
}

.syngli-modal-btn--primary {
    background: #4f7ca7;
    border-color: #4f7ca7;
    color: #fff;
}

.syngli-modal-btn--primary:hover,
.syngli-modal-btn--primary:focus {
    background: #3e6489;
    border-color: #3e6489;
    color: #fff;
}
