/* Event editor dialog (admin only). All selectors are prefixed lgvas-ee-. Spec: specs/004-event-config-editor-dialog */

.lgvas-ee-openwrap { margin-top: 6px; }
.lgvas-ee-notice { margin-top: 6px; padding: 6px 10px; border-left: 4px solid #00a32a; background: #f0f6f0; max-width: 40em; }
.lgvas-ee-flash { outline: 3px solid #00a32a; outline-offset: 1px; }

.lgvas-ee-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

dialog.lgvas-ee {
	width: 90vw; max-width: 1100px; height: 85vh; max-height: 900px;
	padding: 0; border: 1px solid #c3c4c7; border-radius: 4px; box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
	background: #fff; color: #1d2327; box-sizing: border-box;
}
dialog.lgvas-ee[open] { display: flex; flex-direction: column; }
dialog.lgvas-ee::backdrop { background: rgba(0, 0, 0, .55); }
dialog.lgvas-ee *, dialog.lgvas-ee *::before, dialog.lgvas-ee *::after { box-sizing: border-box; }
dialog.lgvas-ee [hidden] { display: none !important; }

.lgvas-ee-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #dcdcde; }
.lgvas-ee-header h2 { margin: 0; font-size: 1.3em; }
.lgvas-ee-header h2:focus { outline: 2px solid #2271b1; outline-offset: 2px; }
.lgvas-ee-close { min-width: 32px; min-height: 32px; border: 0; background: transparent; font-size: 18px; cursor: pointer; }

.lgvas-ee-body { flex: 1 1 auto; display: flex; min-height: 0; }
.lgvas-ee-tabs { flex: 0 0 200px; display: flex; flex-direction: column; border-right: 1px solid #dcdcde; background: #f6f7f7; overflow-y: auto; }
.lgvas-ee-tab { text-align: left; padding: 10px 14px; min-height: 40px; border: 0; border-left: 4px solid transparent; background: transparent; cursor: pointer; font-size: 14px; }
.lgvas-ee-tab[aria-selected="true"] { background: #fff; border-left-color: #2271b1; font-weight: 600; }
.lgvas-ee-tab:focus-visible { outline: 2px solid #2271b1; outline-offset: -2px; }
.lgvas-ee-panels { flex: 1 1 auto; overflow: auto; padding: 14px 18px; }

.lgvas-ee-footer { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid #dcdcde; background: #f6f7f7; flex-wrap: wrap; }
.lgvas-ee-spacer { flex: 1 1 auto; }
.lgvas-ee-status { font-weight: 600; }
.lgvas-ee-problems { margin: 0; padding: 8px 16px 8px 32px; max-height: 140px; overflow: auto; border-top: 1px solid #dcdcde; background: #fcf9e8; }
.lgvas-ee-problems .button-link { text-align: left; }
.lgvas-ee-toast { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-top: 1px solid #dcdcde; background: #f0f6fc; }

dialog.lgvas-ee button, dialog.lgvas-ee input, dialog.lgvas-ee select { min-height: 32px; }
dialog.lgvas-ee button:focus-visible, dialog.lgvas-ee input:focus-visible, dialog.lgvas-ee select:focus-visible, dialog.lgvas-ee textarea:focus-visible {
	outline: 2px solid #2271b1; outline-offset: 1px;
}

/* parameter section */
.lgvas-ee-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.lgvas-ee-keeprow { display: inline-flex; align-items: center; gap: 6px; }
.lgvas-ee-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 12px; padding: 10px; border: 1px solid #dcdcde; background: #f6f7f7; }
.lgvas-ee-picker .lgvas-ee-hint, .lgvas-ee-picker .lgvas-ee-keeprow { grid-column: 1 / -1; }
.lgvas-ee-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; border: 1px solid #c3c4c7; background: #fff; cursor: pointer; min-height: 32px; height: auto; }
.lgvas-ee-kind:hover { border-color: #2271b1; }
.lgvas-ee-kinddesc { font-size: 12px; color: #50575e; }
.lgvas-ee-kindtech { font-size: 11px; color: #787c82; background: transparent; padding: 0; }
.lgvas-ee-split { display: flex; gap: 18px; align-items: flex-start; }
.lgvas-ee-left { flex: 0 0 32%; min-width: 0; }
.lgvas-ee-paramform { flex: 1 1 auto; min-width: 0; }
.lgvas-ee-paramlist { margin: 0 0 8px; padding: 0; list-style: none; border: 1px solid #dcdcde; max-height: 50vh; overflow: auto; }
.lgvas-ee-item { margin: 0; border-bottom: 1px solid #f0f0f1; }
.lgvas-ee-item.is-dragging { opacity: .5; }
.lgvas-ee-item.is-droptarget { box-shadow: inset 0 3px 0 #2271b1; }
.lgvas-ee-row { display: block; width: 100%; padding: 8px 10px; text-align: left; border: 0; background: transparent; cursor: pointer; min-height: 36px; height: auto; white-space: normal; }
.lgvas-ee-row.is-selected { background: #f0f6fc; font-weight: 600; }
.lgvas-ee-row:focus-visible { outline: 2px solid #2271b1; outline-offset: -2px; }
.lgvas-ee-badges { font-weight: 400; color: #50575e; font-size: 12px; }
.lgvas-ee-empty { padding: 10px; color: #50575e; }
.lgvas-ee-listactions { display: flex; gap: 6px; flex-wrap: wrap; }
.lgvas-ee-filter { margin-left: auto; }

/* fields */
.lgvas-ee-field { margin-bottom: 14px; }
.lgvas-ee-field > label { display: block; font-weight: 600; margin-bottom: 3px; }
.lgvas-ee-field input[type="text"], .lgvas-ee-field input[type="number"], .lgvas-ee-field select, .lgvas-ee-field textarea { width: 100%; max-width: 40em; }
.lgvas-ee-checkline { display: flex; align-items: center; gap: 8px; }
.lgvas-ee-checkline label { font-weight: 600; }
.lgvas-ee-check input[type="checkbox"], .lgvas-ee-keeprow input[type="checkbox"], .lgvas-ee-usedef input[type="checkbox"] { min-width: 20px; min-height: 20px; }
.lgvas-ee-usedef { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.lgvas-ee-help { color: #50575e; font-size: 12px; margin-top: 2px; }
.lgvas-ee-msg { margin-top: 3px; padding: 2px 6px; border-left: 4px solid #dba617; background: #fcf9e8; font-size: 13px; }
.lgvas-ee-msg[aria-live], .lgvas-ee-field [aria-invalid="true"] { border-color: #d63638; }
.lgvas-ee-field [aria-invalid="true"] { outline: 1px solid #d63638; }
.lgvas-ee-note { margin-top: 4px; padding: 4px 8px; background: #f0f0f1; font-size: 13px; }
.lgvas-ee-key { display: none; margin-left: 8px; font-weight: 400; font-size: 11px; color: #787c82; }
.lgvas-ee-showkeys .lgvas-ee-key { display: inline; }
.lgvas-ee-group { margin: 10px 0; border: 1px solid #dcdcde; padding: 6px 10px; }
.lgvas-ee-group summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }

/* selection values editor */
.lgvas-ee-sel { display: flex; flex-direction: column; gap: 6px; max-width: 40em; }
.lgvas-ee-selrow { display: flex; gap: 4px; align-items: center; }
.lgvas-ee-selrow input { flex: 1 1 auto; }
.lgvas-ee-selrow button { min-width: 32px; }
.lgvas-ee-paste { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* markup editor */
.lgvas-ee-toolbar-md { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.lgvas-ee-markuphelp { margin: 4px 0; }
.lgvas-ee-preview { margin-top: 4px; padding: 6px 10px; border: 1px dashed #c3c4c7; background: #fafafa; max-width: 40em; min-height: 24px; }
.lgvas-ee-datewrap { display: flex; gap: 6px; align-items: center; }

/* advanced */
.lgvas-ee-jsonpreview { max-height: 45vh; overflow: auto; padding: 8px; background: #f6f7f7; border: 1px solid #dcdcde; white-space: pre-wrap; }
.lgvas-ee-parseerror { padding: 20px; }
.lgvas-ee-errmsg { padding: 8px 10px; background: #fcf0f1; border-left: 4px solid #d63638; font-family: monospace; }
.lgvas-ee-actions { display: flex; gap: 8px; margin-top: 12px; }

/* overview: flash message, launch buttons, errors outside of fields, danger action */
.lgvas-ee-flashmsg { margin: 8px 0; padding: 8px 12px; border-left: 4px solid #00a32a; background: #f0f6f0; }
.lgvas-ee-flashmsg:empty { display: none; }
.lgvas-ee-launch { margin: 2px 4px 2px 0; }
.lgvas-ee-formerror { margin: 0; padding: 8px 16px; border-top: 1px solid #d63638; border-left: 4px solid #d63638; background: #fcf0f1; }
.lgvas-ee-formerror:empty { display: none; }
dialog.lgvas-ee .lgvas-ee-danger { color: #b32d2e; border-color: #b32d2e; }

@media (max-width: 782px) {
	dialog.lgvas-ee { width: 100vw; max-width: none; height: 100vh; max-height: none; border-radius: 0; }
	.lgvas-ee-body { flex-direction: column; }
	.lgvas-ee-tabs { flex: 0 0 auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid #dcdcde; }
	.lgvas-ee-tab { border-left: 0; border-bottom: 4px solid transparent; white-space: nowrap; }
	.lgvas-ee-tab[aria-selected="true"] { border-bottom-color: #2271b1; }
	.lgvas-ee-split { flex-direction: column; }
	.lgvas-ee-left { flex: 1 1 auto; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	dialog.lgvas-ee, dialog.lgvas-ee * { transition: none !important; animation: none !important; }
}
