/* Quiz Enhancer for LearnDash: answer editor. Colours follow the LearnDash accent where the theme sets it. */
.qeld:not(#qeld_){
	--qeld-accent: var(--ld-color-primary, #2563eb);
	--qeld-line: #d8dce3;
	--qeld-soft: #f6f7f9;
	--qeld-ink: #1f2937;
	--qeld-muted: #6b7280;
	position: relative;
	box-sizing: border-box;
	width: 100%;
	margin: 6px 0 12px;
	border: 1px solid var(--qeld-line);
	border-radius: 10px;
	background: #fff;
	color: var(--qeld-ink);
	text-align: left;
	transition: border-color .2s, box-shadow .2s;
}
.qeld:not(#qeld_):focus-within{ border-color: var(--qeld-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--qeld-accent) 18%, transparent); }
.qeld.is-error:not(#qeld_){ border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.qeld.is-locked:not(#qeld_){ background: var(--qeld-soft); }
.qeld.is-locked:not(#qeld_) .qeld-bar{ opacity: .5; pointer-events: none; }
textarea.qeld-hidden:not(#qeld_){ display: none !important; }/* Toolbar */


.qeld-bar:not(#qeld_){ position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--qeld-line); border-radius: 10px 10px 0 0; background: var(--qeld-soft); }
.qeld-grp:not(#qeld_){ display: inline-flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--qeld-line); }
.qeld-grp:not(#qeld_):last-of-type{ border-right: 0; }
.qeld-grp--table:not(#qeld_){ display: none; }
.qeld-bar.in-table:not(#qeld_) .qeld-grp--table{ display: inline-flex; }
.qeld:not(#qeld_) *, .qeld:not(#qeld_) *::before, .qeld:not(#qeld_) *::after{ box-sizing: border-box; }
.qeld:not(#qeld_) .qeld-btn{ all: unset; box-sizing: border-box; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: transparent; color: var(--qeld-ink); line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s; }
.qeld:not(#qeld_) .qeld-btn:hover{ background: #e7e9ee; }
.qeld:not(#qeld_) .qeld-btn:focus-visible{ outline: 2px solid var(--qeld-accent); outline-offset: 1px; }
.qeld:not(#qeld_) .qeld-btn.is-on{ background: color-mix(in srgb, var(--qeld-accent) 14%, #fff); color: var(--qeld-accent); }
.qeld:not(#qeld_) .qeld-btn:disabled{ opacity: .4; cursor: default; }
.qeld:not(#qeld_) .qeld-btn svg{ width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qeld:not(#qeld_) .qeld-btn svg circle{ fill: currentColor; stroke: none; }
.qeld:not(#qeld_) .qeld-btn[data-cmd="bold"] svg{ stroke-width: 2.4; }/* Table size picker */


.qeld-pick:not(#qeld_){ position: absolute; top: 100%; z-index: 50; margin-top: 4px; padding: 8px; border: 1px solid var(--qeld-line); border-radius: 8px; background: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .15); }
.qeld-pick[hidden]:not(#qeld_){ display: none; }
.qeld-pick__grid:not(#qeld_){ display: grid; grid-template-columns: repeat(8, 18px); gap: 3px; }
.qeld-pick__grid:not(#qeld_) span{ display: block; width: 18px; height: 18px; border: 1px solid var(--qeld-line); border-radius: 3px; background: #fff; cursor: pointer; }
.qeld-pick__grid:not(#qeld_) span.is-on{ border-color: var(--qeld-accent); background: color-mix(in srgb, var(--qeld-accent) 22%, #fff); }
.qeld-pick__label:not(#qeld_){ margin-top: 6px; color: var(--qeld-muted); font-size: 12px; text-align: center; }/* Notice */


.qeld-notice:not(#qeld_){ display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 12px; border-bottom: 1px solid #fde68a; background: #fffbeb; color: #92400e; font-size: 14px; }
.qeld-notice[hidden]:not(#qeld_){ display: none; }
.qeld:not(#qeld_) .qeld-notice button{ all: unset; color: #92400e; font-family: inherit; font-size: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }/* Writing area */


.qeld-ed:not(#qeld_){ max-height: 70vh; color: var(--qeld-ink); background: transparent; text-align: left; overflow: auto; padding: 14px 16px; outline: 0; font-size: 16px; line-height: 1.6; word-wrap: break-word; cursor: text; }
.qeld-ed.is-empty:not(#qeld_)::before{ content: attr(data-placeholder); position: absolute; margin-top: 0; color: #9ca3af; pointer-events: none; }
.qeld-ed:not(#qeld_) > :first-child{ margin-top: 0; }
.qeld-ed:not(#qeld_) p{ margin: 0 0 .8em; }
.qeld-ed:not(#qeld_) h2, .qeld-ed:not(#qeld_) h3, .qeld-ed:not(#qeld_) h4{ margin: 1em 0 .5em; font-weight: 700; line-height: 1.3; }
.qeld-ed:not(#qeld_) h2{ font-size: 1.35em; }
.qeld-ed:not(#qeld_) h3{ font-size: 1.18em; }
.qeld-ed:not(#qeld_) h4{ font-size: 1.05em; }
.qeld-ed:not(#qeld_) ul, .qeld-ed:not(#qeld_) ol{ margin: 0 0 .8em 1.4em; padding: 0; }
.qeld-ed:not(#qeld_) ul{ list-style: disc; }
.qeld-ed:not(#qeld_) ol{ list-style: decimal; }
.qeld-ed:not(#qeld_) li{ margin: .2em 0; }
.qeld-ed:not(#qeld_) blockquote{ margin: 0 0 .8em; padding-left: 12px; border-left: 3px solid var(--qeld-line); color: var(--qeld-muted); }
.qeld-ed:not(#qeld_) table{ width: auto; min-width: 50%; max-width: 100%; margin: .4em 0 1em; border-collapse: collapse; font-size: .95em; }
.qeld-ed:not(#qeld_) th, .qeld-ed:not(#qeld_) td{ min-width: 60px; padding: 6px 10px; border: 1px solid #c9ced8; text-align: left; vertical-align: top; }
.qeld-ed:not(#qeld_) th, .qeld-ed:not(#qeld_) thead td{ background: var(--qeld-soft); font-weight: 600; }
.qeld-ed:not(#qeld_) td:focus-within, .qeld-ed:not(#qeld_) th:focus-within{ background: color-mix(in srgb, var(--qeld-accent) 6%, #fff); }/* Footer */


.qeld-foot:not(#qeld_){ display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; border-top: 1px solid #eef0f3; color: var(--qeld-muted); font-size: 13px; }
.qeld-count.is-bad:not(#qeld_){ color: #dc2626; font-weight: 600; }
.qeld-count.is-good:not(#qeld_){ color: #15803d; }
.qeld-state.is-saving:not(#qeld_){ color: var(--qeld-muted); }
.qeld-state.is-saved:not(#qeld_)::before{ content: "✓ "; color: #15803d; }
.qeld-err:not(#qeld_){ padding: 8px 12px; border-top: 1px solid #fecaca; border-radius: 0 0 10px 10px; background: #fef2f2; color: #b91c1c; font-size: 14px; font-weight: 600; }

@media (max-width: 600px) {
	.qeld:not(#qeld_) .qeld-btn{ width: 36px; height: 36px; }
	.qeld-ed:not(#qeld_){ padding: 12px; }
}
/* Bold stays bold even when the theme uses a light body weight. */
.qeld-ed:not(#qeld_) strong, .qeld-ed:not(#qeld_) b, .qeld-ed:not(#qeld_) th { font-weight: 700; }
.qeld-ed:not(#qeld_) em, .qeld-ed:not(#qeld_) i { font-style: italic; }
/* Copy-protection plugins switch off text selection page-wide; answers must stay selectable. */
.qeld-ed:not(#qeld_), .qeld-ed:not(#qeld_) * { -webkit-user-select: text !important; -moz-user-select: text !important; user-select: text !important; -webkit-touch-callout: default !important; }
