/* Generate SQL Script modal — theme-aware, matches the schema modal family. */
.script-modal .modal-content { border: 0; border-radius: 16px; overflow: hidden; }
.script-modal .modal-header {
    background: linear-gradient(120deg, #0f172a, #1e293b);
    color: #fff; border-bottom: 0;
}
.psql-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: #a5b4fc; display: flex; align-items: center; gap: .4rem; margin-bottom: .15rem; }

.psql-body { padding: 1.25rem 1.4rem; }

.psql-conn { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; margin-bottom: 1rem;
    border: 1px solid var(--pp-border, #e6e9f0); border-radius: 12px; background: var(--pp-surface-2, #f8fafc); }
.psql-eyebrow { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--pp-text-muted, #94a3b8); }
.psql-conn strong { font-size: .95rem; color: var(--pp-text, #172033); }
.psql-engine { margin-left: auto; font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px;
    color: #4f46e5; background: color-mix(in srgb, #4f46e5 12%, transparent); }

.psql-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .psql-grid { grid-template-columns: 1fr; } }

.psql-card { border: 1px solid var(--pp-border, #e6e9f0); border-radius: 12px; padding: 1rem 1.05rem;
    background: var(--pp-surface, #fff); margin-bottom: 1rem; }
.psql-card h6 { font-size: .82rem; font-weight: 800; margin: 0 0 .7rem; display: flex; align-items: center; gap: .45rem;
    color: var(--pp-text, #172033); }
.psql-card h6 .bi { color: #4f46e5; }

.psql-radio, .psql-check { display: flex; align-items: flex-start; gap: .55rem; padding: .32rem 0; cursor: pointer;
    font-size: .88rem; color: var(--pp-text, #172033); }
.psql-radio input, .psql-check input { margin-top: .15rem; flex: none; }
.psql-radio em { font-style: normal; font-weight: 700; color: var(--pp-text-muted, #64748b); margin-left: .3rem;
    font-size: .78rem; }
.psql-check em { display: block; font-style: normal; font-weight: 400; color: var(--pp-text-muted, #64748b); font-size: .78rem; }
.psql-hint { font-size: .76rem; color: var(--pp-text-muted, #64748b); margin: .5rem 0 0; }

.psql-rowlimit { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-top: .7rem;
    font-size: .84rem; color: var(--pp-text, #172033); }
.psql-rowlimit input { width: 5.5rem; padding: .3rem .5rem; border-radius: 8px; text-align: center; font-weight: 700;
    border: 1px solid var(--pp-border, #cbd5e1); background: var(--pp-surface, #fff); color: inherit; }
.psql-rowlimit.disabled { opacity: .45; pointer-events: none; }

.psql-advanced { border: 1px solid var(--pp-border, #e6e9f0); border-radius: 12px; padding: .3rem .5rem; margin-bottom: 1rem;
    background: var(--pp-surface, #fff); }
.psql-advanced > summary { cursor: pointer; font-weight: 700; font-size: .82rem; padding: .5rem .55rem; list-style: none;
    display: flex; align-items: center; gap: .45rem; color: var(--pp-text, #172033); }
.psql-advanced > summary::-webkit-details-marker { display: none; }
.psql-advanced > summary .bi { color: #4f46e5; }
.psql-opts { padding: .3rem .55rem .6rem; }

.psql-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.psql-selectall { padding: 0; font-size: .8rem; font-weight: 700; }
.psql-objects { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .9rem; max-height: 220px; overflow: auto;
    margin-top: .4rem; padding-right: .3rem; }
@media (max-width: 720px) { .psql-objects { grid-template-columns: 1fr; } }
.psql-obj { display: flex; align-items: center; gap: .5rem; padding: .3rem .1rem; font-size: .84rem;
    border-bottom: 1px solid var(--pp-border, #f1f5f9); }
.psql-obj input { flex: none; }
.psql-obj .name { font-weight: 600; color: var(--pp-text, #172033); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psql-obj .rows { margin-left: auto; font-size: .74rem; color: var(--pp-text-muted, #94a3b8); white-space: nowrap; }
.psql-obj .badge-view { font-size: .62rem; font-weight: 700; padding: .05rem .35rem; border-radius: 5px;
    color: #0891b2; background: color-mix(in srgb, #0891b2 14%, transparent); }
.psql-obj .badge-sys { font-size: .62rem; font-weight: 700; padding: .05rem .35rem; border-radius: 5px;
    color: #b45309; background: color-mix(in srgb, #b45309 14%, transparent); }

.psql-footnote { font-size: .78rem; color: #16a34a; }
.script-modal .btn-primary#scriptGenerate.busy { pointer-events: none; opacity: .8; }
