/* liq-dialogs.css - LedgerIQ dialogs on the house standard.
 *
 * The chrome of every LedgerIQ dialog is the shared one from /js/iq-dialog.js
 * (ciqd-* classes). That stylesheet is injected with two-id specificity, so the
 * rules here only cover what sits INSIDE a dialog, plus the legacy LedgerIQ rules
 * that would otherwise leak into the enrichment prompt (#promptModal).
 * Loaded last, after every module stylesheet.
 */

/* ---------- Enrichment prompt (#promptModal) ---------- */

/* One scroll area: the dialog body. The old layers each gave the data container
   and the inner panel their own 46vh scroll, three nested scrollbars deep. */
#promptModal #promptDataContainer {
    display: block;
    gap: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
    background: none;
    border-radius: 0;
}
#promptModal #promptDataContainer > div:not([class]) { background: none; }
#promptModal .prompt-modal-buttons { flex-direction: row !important; }
#promptModal .prompt-modal-buttons > button { width: auto; }
#promptModal .enrich-data { max-height: none; overflow: visible; }

#promptModal #promptInstructionsElement:empty { display: none; }
#promptModal #promptInstructionsElement { margin: 0 0 12px; color: #3d3a34; }

/* Older prompts (modules that write their own markup) */
#promptModal .data-pill {
    display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px;
    font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.82rem; font-weight: 500;
    color: #3d3a34; background: #fff; border: 1px solid #e4dfd5; border-radius: 999px;
    box-shadow: none; transition: none;
}
#promptModal .data-pill:hover { border-color: #1a1a1a; background: #faf8f5; color: #1a1a1a; }
#promptModal .data-pill.selected { background: rgba(74, 144, 128, 0.08); border-color: #4a9080; color: #2f6457; font-weight: 600; box-shadow: none; }
#promptModal .prompt-pill-container { display: flex; flex-wrap: wrap; gap: 6px; }
#promptModal .fixed-variable-item { padding: 8px 0; margin: 0; border-bottom: 1px solid #e4dfd5; }
#promptModal .prompt-item-label,
#promptModal .prompt-form-label {
    font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase; color: #6b6459;
}
#promptModal #promptDataContainer select,
#promptModal #promptDataContainer input[type="number"],
#promptModal #promptDataContainer input[type="text"],
#promptModal #promptDataContainer input[type="date"],
#promptModal .prompt-form-input {
    box-sizing: border-box; min-height: 34px; padding: 0 10px;
    font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.875rem; color: #1a1a1a;
    background-color: #fff; border: 1px solid #c9c2b5; border-radius: 2px; box-shadow: none;
}
#promptModal #promptDataContainer select:focus,
#promptModal #promptDataContainer input:focus { outline: none; border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08); }
#promptModal input[type="checkbox"],
#promptModal input[type="radio"] { accent-color: #4a9080; }

/* Phones: footer actions share the row (the house dialog stretches them) */
@media (max-width: 520px) {
    #promptModal .prompt-modal-buttons > button { flex: 1 1 auto; }
    #promptModal .prompt-modal-buttons > .enrich-btn-skip-all { flex: 1 1 100%; margin-right: 0; }
}

/* ---------- Module search ---------- */
.liq-modsearch-list {
    margin: 12px -18px -18px;
    max-height: min(52vh, 460px);
    overflow-y: auto;
    border-top: 1px solid #e4dfd5;
}
.liq-modsearch-list .module-search-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    width: 100%; padding: 10px 18px; margin: 0;
    font: inherit; text-align: left; cursor: pointer;
    background: #fff; border: 0; border-bottom: 1px solid #efebe3; border-radius: 0;
}
.liq-modsearch-list .module-search-item:last-child { border-bottom: 0; }
.liq-modsearch-list .module-search-item:hover,
.liq-modsearch-list .module-search-item[aria-selected="true"] { background: #f7f4ee; }
.liq-modsearch-list .module-search-item[aria-selected="true"] { box-shadow: inset 2px 0 0 #4a9080; }
.liq-modsearch-name { font-size: 0.9rem; font-weight: 500; color: #1a1a1a; }
.liq-modsearch-cat { flex: none; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #6b6459; }
.liq-modsearch-empty { margin: 0; padding: 14px 18px; color: #6b6459; }
#moduleSearchOverlay .ciqd-input { margin-top: 0; }
@media (max-width: 520px) {
    .liq-modsearch-list { max-height: calc(100vh - 220px); }
    .liq-modsearch-list .module-search-item { flex-direction: column; gap: 2px; }
}
