/*
 * Every panel rule below is anchored on #dmm-cg, the id the markup already carries.
 * That is deliberate. A theme styling bare elements — body.mds-body h2 { font-size:
 * clamp(40px, 2.8vw, 60px) } is a real one — scores (0,1,1) and beats a lone
 * .dmm-cg__title at (0,1,0) whatever order the stylesheets load in, so the notice ends
 * up with a 60px heading. The id lifts these rules to (1,1,0), which outranks any
 * element+class rule and any single-id rule a theme is likely to have, without turning
 * the file into a wall of !important. A site owner restyling the notice anchors on the
 * same id and wins on source order, so it stays overridable.
 *
 * The three properties on the root are still !important because they are the panel's
 * contract with the page, not styling: a theme rule such as [region="..."] { position:
 * relative } would otherwise drop the notice into the document flow, buried mid-page,
 * in a mode whose entire job is to be seen.
 */
#dmm-cg.dmm-cg {
	position: fixed !important;
	inset: auto 0 0 0 !important;
	/* 2147483647 is the signed 32-bit ceiling: browsers clamp anything higher, so there is no
	   value a theme or a plugin can pick that sits above this one. Page builders and sticky
	   header plugins routinely reach for 99999 and 999999, which the old value only tied. */
	z-index: 2147483647 !important;
	display: flex;
	justify-content: center;
	padding: 16px;
	pointer-events: none;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#dmm-cg[hidden] { display: none; }

/*
 * Specificity alone only settles the properties this file actually declares. A theme that
 * also puts letter-spacing, a text-transform or a decorative ::after bar on every h2 would
 * still land those, because nothing here says otherwise. This block cancels what themes
 * reach for on headings and copy; it sits above the component rules so anything they do
 * set — the title's font-size, the link's underline — wins on source order. :where() keeps
 * the element list at zero specificity, so the score stays the prefix's (1,1,0).
 */
#dmm-cg .dmm-cg__panel :where(h2, p, span, em, strong, a, label) {
	font-family: inherit;
	font-style: normal;
	letter-spacing: normal;
	word-spacing: normal;
	text-transform: none;
	text-indent: 0;
	text-shadow: none;
	text-align: left;
	text-decoration: none;
	background: none;
	border: 0;
	float: none;
	position: static;
	transform: none;
	width: auto;
	max-width: none;
	min-height: 0;
}

#dmm-cg .dmm-cg__panel :where(h2, p, span, em, strong, a, label)::before,
#dmm-cg .dmm-cg__panel :where(h2, p, span, em, strong, a, label)::after {
	content: none;
}

#dmm-cg .dmm-cg__panel {
	pointer-events: auto;
	width: 100%;
	max-width: 640px;
	background: #fff;
	color: #16202e;
	border: 1px solid #d6dde6;
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(15, 26, 43, .22);
	padding: 22px 24px;
}

#dmm-cg .dmm-cg__title {
	display: block;
	margin: 0 0 8px;
	font-size: 17px;
	line-height: 1.3;
	font-weight: 650;
	color: inherit;
}

#dmm-cg .dmm-cg__body {
	display: block;
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.55;
	color: #46566b;
}

#dmm-cg .dmm-cg__cats {
	display: grid;
	gap: 8px;
	margin: 0 0 16px;
	max-height: 40vh;
	overflow-y: auto;
}

#dmm-cg .dmm-cg__cat {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px 12px;
	border: 1px solid #e3e8ee;
	border-radius: 10px;
	cursor: pointer;
	font-size: 13px;
	line-height: 1.45;
	color: inherit;
}

#dmm-cg .dmm-cg__cat input {
	margin-top: 2px;
	width: auto;
	height: auto;
	min-height: 0;
	position: static;
	opacity: 1;
}
#dmm-cg .dmm-cg__cat span { display: grid; gap: 2px; }
#dmm-cg .dmm-cg__cat em { font-style: normal; color: #6b7a8d; }

#dmm-cg .dmm-cg__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

#dmm-cg .dmm-cg__btn {
	flex: 1 1 auto;
	min-width: 132px;
	width: auto;
	height: auto;
	margin: 0;
	padding: 11px 18px;
	border-radius: 9px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	border: 1px solid transparent;
}

#dmm-cg .dmm-cg__btn::before,
#dmm-cg .dmm-cg__btn::after { content: none; }

#dmm-cg .dmm-cg__btn--primary { background: #16202e; color: #fff; }
#dmm-cg .dmm-cg__btn--primary:hover { background: #24384f; }
#dmm-cg .dmm-cg__btn--ghost { background: #fff; color: #16202e; border-color: #cbd5e1; }
#dmm-cg .dmm-cg__btn--ghost:hover { background: #f3f6f9; }
#dmm-cg .dmm-cg__btn:focus-visible { outline: 3px solid #2f6df6; outline-offset: 2px; }

/* Disclaimer mode: one row, copy left, single button right. Wider panel than the consent
   dialog because there are no choices to scan, just a paragraph to read. */
#dmm-cg.dmm-cg--notice .dmm-cg__panel { max-width: 960px; }

#dmm-cg .dmm-cg__notice {
	display: flex;
	align-items: center;
	gap: 24px;
}

#dmm-cg .dmm-cg__notice-copy { flex: 1 1 auto; min-width: 0; }
#dmm-cg .dmm-cg__notice .dmm-cg__body { margin-bottom: 0; }

#dmm-cg .dmm-cg__actions--single { flex: 0 0 auto; }
#dmm-cg .dmm-cg__actions--single .dmm-cg__btn { flex: 0 0 auto; white-space: nowrap; }

#dmm-cg .dmm-cg__inline-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 640px) {
	#dmm-cg .dmm-cg__notice { display: block; }
	#dmm-cg .dmm-cg__actions--single { margin-top: 16px; }
	#dmm-cg .dmm-cg__actions--single .dmm-cg__btn { width: 100%; }
}

#dmm-cg .dmm-cg__link {
	display: inline-block;
	margin-top: 12px;
	font-size: 13px;
	line-height: 1.4;
	color: #46566b;
	text-decoration: underline;
}

#dmm-cg .dmm-cg__always {
	margin: 0 0 10px;
	padding: 10px 12px;
	border-radius: 9px;
	background: #f3f6f9;
	font-size: 12.5px;
	line-height: 1.5;
	color: #46566b;
}

/*
 * The reopen triggers and the embed placeholders sit in the page, not inside #dmm-cg, and
 * the shortcode can appear more than once — so there is no id to anchor on. Repeating the
 * class is the cheapest way to (0,2,0), which clears the element+class rules themes put on
 * buttons without an !important on every line.
 */

/* Inline trigger: inherits the surrounding text so it sits in a footer or menu unnoticed. */
.dmm-cg-open.dmm-cg-open--inline {
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	margin: 0;
	padding: 0;
	width: auto;
	min-width: 0;
	height: auto;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-shadow: none;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.dmm-cg-open.dmm-cg-open--inline::before,
.dmm-cg-open.dmm-cg-open--inline::after { content: none; }

.dmm-cg-footer.dmm-cg-footer {
	margin: 0;
	padding: 12px 16px 20px;
	text-align: center;
	font-size: 13px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #6b7a8d;
}

/* Same reasoning as #dmm-cg: this is the only way back into the consent choice, so a theme
   must not be able to drop it into the flow and lose it. */
.dmm-cg-open.dmm-cg-open--badge {
	position: fixed !important;
	left: 16px !important;
	bottom: 16px !important;
	z-index: 2147483646 !important;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #16202e;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 12px;
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(15, 26, 43, .14);
}

.dmm-cg-open.dmm-cg-open--badge::before,
.dmm-cg-open.dmm-cg-open--badge::after { content: none; }

.dmm-cg-showing .dmm-cg-open.dmm-cg-open--badge { display: none; }

.dmm-cg-embed[data-dmm-placeholder] {
	display: grid;
	gap: 10px;
	place-items: center;
	align-content: center;
	min-height: var(--dmm-embed-h, 260px);
	padding: 28px 24px;
	background: #eef1f5;
	border: 1px solid #dde3ea;
	border-radius: 10px;
	text-align: center;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.dmm-cg-embed[data-dmm-placeholder] > iframe { display: none; }

.dmm-cg-embed[data-dmm-placeholder] .dmm-cg-embed__btn {
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 10px 20px;
	border-radius: 8px;
	border: 1px solid #16202e;
	background: #16202e;
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
}

.dmm-cg-embed[data-dmm-placeholder] .dmm-cg-embed__btn::before,
.dmm-cg-embed[data-dmm-placeholder] .dmm-cg-embed__btn::after { content: none; }

@media (prefers-color-scheme: dark) {
  #dmm-cg .dmm-cg__panel * {
    color: #fff;
  }
}

.dmm-cg-embed[data-dmm-placeholder] .dmm-cg-embed__btn:hover { background: #24384f; }
.dmm-cg-embed[data-dmm-placeholder] .dmm-cg-embed__btn:focus-visible { outline: 3px solid #2f6df6; outline-offset: 2px; }

.dmm-cg-embed[data-dmm-placeholder] .dmm-cg-embed__note {
	font-size: 12px;
	line-height: 1.5;
	color: #7a8698;
	max-width: 34ch;
}

@media (prefers-color-scheme: dark) {
	#dmm-cg .dmm-cg__panel { background: #131a24; color: #e8eef6; border-color: #2a3646; }
	#dmm-cg .dmm-cg__body { color: #a4b3c6; }
	#dmm-cg .dmm-cg__cat { border-color: #2a3646; }
	#dmm-cg .dmm-cg__cat em { color: #8d9db2; }
	#dmm-cg .dmm-cg__btn--primary { background: #4c8dff; color: #05101f; }
	#dmm-cg .dmm-cg__btn--ghost { background: transparent; color: #e8eef6; border-color: #37475c; }
	#dmm-cg .dmm-cg__always { background: #1b2430; color: #a4b3c6; }
	.dmm-cg-open.dmm-cg-open--badge { background: #131a24; color: #e8eef6; border-color: #2a3646; }
	.dmm-cg-embed[data-dmm-placeholder] { background: #101720; border-color: #2a3646; }
}
