.dn-chart-modal-backdrop {
	position: fixed;
	z-index: 99998;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.58);
}

.dn-chart-modal-backdrop[hidden] { display: none; }

.dn-chart-modal {
	width: min(680px, 100%);
	max-height: calc(100vh - 40px);
	overflow: auto;
	border-radius: 14px;
	background: #ffffff;
	box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
	font-family: Inter, Arial, sans-serif;
}

.dn-chart-modal-header,
.dn-chart-modal-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
}

.dn-chart-modal-header { border-bottom: 1px solid #eaf4ff; }

.dn-chart-modal-header h2 {
	margin: 0;
	color: #1d2327;
	font-size: 20px;
	line-height: 1.3;
}

.dn-chart-modal-close {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #f5faff;
	color: #1d2327;
	font-size: 22px;
	cursor: pointer;
}

.dn-chart-modal-body { padding: 20px; }

.dn-chart-fieldset {
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.dn-chart-fieldset legend {
	margin-bottom: 12px;
	color: #1d2327;
	font-size: 14px;
	font-weight: 700;
}

.dn-chart-choice-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.dn-chart-choice {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 48px;
	border: 1px solid #b3d9ff;
	border-radius: 9px;
	background: #ffffff;
	color: #05509c;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.dn-chart-choice > input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.dn-chart-choice-label {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	cursor: pointer;
}

.dn-chart-choice:has(> input[type="radio"]:checked) {
	border-color: #05509c;
	background: #eaf4ff;
	box-shadow: inset 0 0 0 1px #05509c;
}

.dn-chart-choice:has(> input[type="radio"]:focus-visible) {
	outline: 2px solid #2586db;
	outline-offset: 2px;
}

.dn-chart-custom-height-row {
	display: grid;
	grid-template-columns: auto minmax(130px, 180px) 1fr;
	align-items: center;
	gap: 10px 14px;
	margin-top: 12px;
	padding: 12px 14px;
	border: 1px solid #eaf4ff;
	border-radius: 9px;
	background: #f8fbff;
}

.dn-chart-custom-height-row[hidden] { display: none; }

.dn-chart-custom-height-row > label {
	color: #1d2327;
	font-size: 13px;
	font-weight: 700;
}

.dn-chart-custom-height-control {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	overflow: hidden;
	border: 1px solid #b3d9ff;
	border-radius: 7px;
	background: #ffffff;
}

.dn-chart-custom-height-control input {
	width: 100%;
	min-width: 0;
	min-height: 38px;
	padding: 7px 10px;
	border: 0;
	outline: 0;
	background: transparent;
	color: #1d2327;
	font: 14px/1.3 Inter, Arial, sans-serif;
}

.dn-chart-custom-height-control span {
	padding: 0 10px;
	border-left: 1px solid #eaf4ff;
	color: #475569;
	font-size: 12px;
}

.dn-chart-custom-height-row small {
	color: #64748b;
	font-size: 12px;
}

.dn-chart-embed-code-label {
	display: block;
	margin-bottom: 8px;
	color: #1d2327;
	font-size: 14px;
	font-weight: 700;
}

.dn-chart-embed-code {
	width: 100%;
	min-height: 135px;
	padding: 12px;
	border: 1px solid #b3d9ff;
	border-radius: 8px;
	background: #ffffff;
	color: #1d2327;
	resize: vertical;
	font-family: Consolas, Monaco, monospace;
	font-size: 12px;
	line-height: 1.5;
}

.dn-chart-modal-footer {
	justify-content: flex-end;
	border-top: 1px solid #eaf4ff;
}

.dn-chart-modal-button {
	min-height: 40px;
	padding: 9px 15px;
	border: 0;
	border-radius: 8px;
	background: #05509c;
	color: #ffffff;
	font: 600 14px/1.2 Inter, Arial, sans-serif;
	cursor: pointer;
}

body.dn-chart-modal-open { overflow: hidden; }

@media (max-width: 620px) {
	.dn-chart-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dn-chart-custom-height-row { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
	.dn-chart-choice-grid { grid-template-columns: 1fr; }
}


.dn-chart-embed-publisher-note {
	margin: 16px 0;
	padding: 12px 14px;
	border: 1px solid #dbeafe;
	border-radius: 10px;
	background: #f8fbff;
	color: #475569;
	font-size: 13px;
	line-height: 1.5;
}

.dn-chart-embed-publisher-note strong {
	display: block;
	margin-bottom: 5px;
	color: #001f5c;
}

.dn-chart-embed-publisher-note p {
	margin: 0;
}

.dn-chart-embed-publisher-note a {
	display: inline-block;
	margin-top: 7px;
	color: #05509c;
	font-weight: 600;
	text-decoration: none;
}
