/* 차트 비교 메이커: settings on the left, compared results on the right (tools.json "wide"). */
[hidden] {
	display: none !important;
}

/* Two columns with a draggable splitter between them; --cm-side is the left width (main.js). */
.cm {
	display: grid;
	grid-template-columns: var(--cm-side, 360px) 20px minmax(0, 1fr);
	align-items: start;
	max-width: 1600px;
	margin: 0 auto;
}
.cm-split {
	position: relative;
	align-self: stretch;
	cursor: col-resize;
	touch-action: none;
}
.cm-split::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
	border-radius: 2px;
	background: transparent;
	transition: background 0.15s;
}
.cm-split:hover::before,
.cm-split:focus-visible::before,
.cm.is-resizing .cm-split::before {
	background: var(--accent);
}
.cm-split:focus-visible {
	outline: none;
}
/* The grip stays in view next to the sticky left column. */
.cm-split__grip {
	position: sticky;
	top: calc(50vh - 20px);
	display: block;
	width: 10px;
	height: 40px;
	margin: 0 auto;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--bg) radial-gradient(circle, var(--text-soft) 1px, transparent 1.5px) center / 4px 6px repeat-y;
	background-size: 4px 6px;
}
.cm-split:hover .cm-split__grip,
.cm.is-resizing .cm-split__grip {
	border-color: var(--accent);
}
.cm.is-resizing {
	cursor: col-resize;
	user-select: none;
}
.cm.is-resizing iframe,
.cm.is-resizing .cm-card__chart {
	pointer-events: none;
}
/* Chart type and options stay in view while the stacked results scroll. */
.cm-side {
	position: sticky;
	top: 12px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-height: calc(100vh - 24px);
	overflow-y: auto;
	overscroll-behavior: contain;
}
.cm-step__title {
	margin: 0 0 12px;
	font-size: 1.05rem;
}
.cm-muted {
	color: var(--text-soft);
	font-weight: 400;
	font-size: 0.85rem;
}
.cm-small {
	min-height: 36px;
	padding: 0 14px;
	font-size: 0.9rem;
}
.cm-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--accent);
	font: inherit;
	font-size: 0.9rem;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.cm-link:hover {
	color: var(--accent-hover);
}
/* Shown but unavailable, e.g. SVG for a library that draws on a canvas. */
.cm-link:disabled,
.button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.cm-link:disabled {
	color: var(--text-soft);
	text-decoration: none;
}
.button--ghost:disabled:hover {
	background: transparent;
	color: var(--accent);
}

/* 1. Data */
.cm-file {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 12px;
}
#data-panel.is-drop {
	border-color: var(--accent);
	background: var(--accent-soft);
}
#data {
	min-height: 150px;
	white-space: pre;
	overflow-x: auto;
	tab-size: 12;
}
.cm-summary {
	margin: 10px 0 0;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--dw-teal-dark);
}
.cm-summary:empty {
	display: none;
}
.cm-notes {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
	color: #8a5a00;
}
.cm-notes li {
	position: relative;
	padding-left: 1.1em;
}
.cm-notes li::before {
	content: '!';
	position: absolute;
	left: 0;
	font-weight: 700;
}

/* Folding panels above the results: chart type and chart libraries */
.cm-fold {
	margin-bottom: 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
}
.cm-fold__head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 10px 16px;
	list-style: none;
	cursor: pointer;
}
.cm-fold__head::-webkit-details-marker {
	display: none;
}
.cm-fold__head::before {
	content: '';
	flex: none;
	align-self: center;
	width: 7px;
	height: 7px;
	border-right: 2px solid var(--text-soft);
	border-bottom: 2px solid var(--text-soft);
	transform: rotate(-45deg);
	transition: transform 0.15s;
}
.cm-fold[open] > .cm-fold__head::before {
	transform: rotate(45deg);
}
.cm-fold__head:hover {
	background: var(--surface);
	border-radius: var(--radius);
}
.cm-fold__title {
	flex: none;
	color: var(--heading);
	font-weight: 700;
}
.cm-fold__value {
	min-width: 0;
	color: var(--dw-teal-dark);
	font-size: 0.92rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cm-fold__value::before {
	content: '· ';
	color: var(--text-soft);
}
.cm-fold[open] > .cm-fold__head .cm-fold__value {
	display: none;
}
.cm-fold__body {
	padding: 4px 16px 16px;
}
/* Chart type and options on the left fold the same way; the column's gap spaces them. */
.cm-side .cm-fold {
	margin-bottom: 0;
}

/* Chart type: category pills, then that category's types in as many columns as fit. */
.cm-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}
.cm-cat,
.cm-pill {
	display: inline-block;
	padding: 3px 11px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #fff;
	color: var(--text-soft);
	font: inherit;
	font-size: 0.85rem;
	line-height: 1.4;
}
.cm-cat {
	cursor: pointer;
}
.cm-cat:hover {
	border-color: var(--accent);
	color: var(--dw-teal-dark);
}
.cm-cat[aria-pressed='true'] {
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--dw-teal-dark);
	font-weight: 500;
}
.cm-cat:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
/* Folded: the category pill, then the type in bold. */
.cm-fold__value--type::before {
	content: none;
}
.cm-fold__value--type .cm-pill {
	margin-right: 6px;
	padding: 1px 9px;
	background: var(--accent-soft);
	border-color: transparent;
	color: var(--dw-teal-dark);
	font-size: 0.8rem;
}
.cm-fold__value--type b {
	font-weight: 700;
}
.cm-types {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
	gap: 6px;
}
.cm-type {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 8px 4px;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 0.85rem;
	cursor: pointer;
}
.cm-type[hidden] {
	display: none;
}
/* How many libraries draw this type. */
.cm-type__count {
	position: absolute;
	top: 3px;
	right: 5px;
	color: var(--text-soft);
	font-size: 0.68rem;
	font-weight: 400;
}
.cm-type input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.cm-type__icon svg {
	width: 22px;
	height: 22px;
	color: var(--text-soft);
}
.cm-type:hover {
	border-color: var(--accent);
}
.cm-type:has(input:checked) {
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--dw-teal-dark);
	font-weight: 500;
}
.cm-type:has(input:checked) svg {
	color: var(--accent);
}
.cm-type:has(input:focus-visible) {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Libraries */
.cm-libs__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	margin-bottom: 10px;
}
.cm-hint-top {
	margin: 0;
}
.cm-libs__all {
	display: flex;
	gap: 14px;
}
/* A title and legend around a chart that draws neither (adapters.js framed, Chartist). */
.cm-framed {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	background: #ffffff;
}
.cm-framed__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.cm-framed--right .cm-framed__body {
	flex-direction: row;
}
.cm-framed__chart {
	flex: 1;
	min-width: 0;
	min-height: 0;
}
.cm-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 14px;
	margin: 4px 0;
	padding: 0;
	list-style: none;
	color: #444444;
	font-size: calc(12px * var(--cm-fs, 1));
	line-height: 1.4;
}
.cm-framed--right .cm-legend {
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: center;
	margin: 0 12px 0 4px;
}
.cm-legend__item {
	display: flex;
	align-items: center;
	gap: 6px;
}
.cm-legend__swatch {
	flex: none;
	width: 12px;
	height: 12px;
	border-radius: 2px;
}
/* Chartist: labels in the page font, white labels on pie slices, the gauge's value and name. */
.cm-ct .ct-label {
	font-family: var(--dw-font-body);
	font-size: calc(11px * var(--cm-fs, 1));
	color: #666666;
	fill: #666666;
}
.cm-ct .ct-chart-pie .ct-label,
.cm-ct .ct-chart-donut .ct-label {
	fill: #ffffff;
	color: #ffffff;
	font-size: calc(12px * var(--cm-fs, 1));
	font-weight: 700;
}
.cm-ct .ct-value {
	font-family: var(--dw-font-body);
	font-size: calc(11px * var(--cm-fs, 1));
	fill: #333333;
}
.cm-ct .ct-value--in {
	fill: #ffffff;
	font-weight: 700;
}
.cm-ct .ct-axis-title {
	font-family: var(--dw-font-body);
	font-size: calc(11px * var(--cm-fs, 1));
	fill: #666666;
}
.cm-ct .ct-area {
	fill-opacity: 0.25;
}
.cm-ct .ct-gauge-value {
	font-family: var(--dw-font-body);
	font-size: calc(22px * var(--cm-fs, 1));
	font-weight: 700;
	fill: #222222;
}
.cm-ct .ct-center-label {
	font-family: var(--dw-font-body);
	font-size: calc(12px * var(--cm-fs, 1));
	fill: #666666;
}
.cm-ct .ct-gauge-label {
	font-family: var(--dw-font-body);
	font-size: calc(12px * var(--cm-fs, 1));
	fill: #555555;
}

/* Bump chart lines, thick like the other libraries'. */
.cm-bb--bump .bb-line {
	stroke-width: 3px;
}
/* The donut's total under its '합계' line. */
.cm-bb .bb-chart-arcs-title tspan:last-child {
	font-size: calc(20px * var(--cm-fs, 1));
	font-weight: 700;
}
/* billboard.js sets a 10px sans-serif on its SVG; use the page font. */
.cm-bb.bb svg {
	font-family: var(--dw-font-body);
	font-size: calc(12px * var(--cm-fs, 1));
}
/* Radar without fill ('안쪽 채우기' off). */
.cm-bb--nofill .bb-chart-radars polygon {
	fill-opacity: 0 !important;
}
.cm-bb .bb-title {
	font-size: calc(16px * var(--cm-fs, 1));
	font-weight: 700;
	fill: #333333;
}
/* Libraries: one chip (pill) per library, on when filled. A chip is dimmed when the library
   cannot draw the chosen chart type; it can still be turned on. */
.cm-box {
	margin-bottom: 10px;
	padding: 10px 16px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
}
.cm-box__title {
	margin: 0;
	color: var(--heading);
	font-size: 1rem;
	font-weight: 700;
}
.cm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.cm-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #fff;
	color: var(--text-soft);
	font-size: 0.88rem;
	cursor: pointer;
	user-select: none;
}
.cm-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.cm-chip::before {
	content: '+';
	font-weight: 700;
}
.cm-chip:hover {
	border-color: var(--accent);
	color: var(--dw-teal-dark);
}
.cm-chip:has(input:checked) {
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--dw-teal-dark);
	font-weight: 500;
}
.cm-chip:has(input:checked)::before {
	content: '✓';
}
.cm-chip:has(input:focus-visible) {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
.cm-chip.is-unable {
	opacity: 0.45;
	border-style: dashed;
}

/* A short select on its own line. */
.cm-field--narrow {
	max-width: 180px;
}

/* Sample or own data, and what changing the chart type does. */
.cm-mode {
	margin: 10px 0 6px;
	padding: 6px 10px;
	border-left: 3px solid var(--border);
	color: var(--text-soft);
	font-size: 0.85rem;
}
.cm-mode.is-own {
	border-left-color: var(--accent);
	color: var(--dw-teal-dark);
}
.cm-mode .cm-link {
	margin-left: 6px;
	font-size: 0.85rem;
}
.cm-card__msg--error {
	flex-direction: column;
	gap: 8px;
}
/* With the visitor's data: chart types it cannot be drawn as. */
.cm-type.is-misfit {
	opacity: 0.4;
	border-style: dashed;
}
.cm-type.is-misfit:has(input:checked) {
	opacity: 0.75;
}

/* The data box's label with the 'how to enter data' button beside it. */
.cm-data-label {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
}
.cm-hint-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--accent);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}
.cm-hint-btn span {
	display: inline-grid;
	place-items: center;
	width: 16px;
	height: 16px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	font-size: 0.7rem;
	font-weight: 700;
}
.cm-hint-btn:hover,
.cm-hint-btn[aria-expanded='true'] {
	color: var(--accent-hover);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.cm-help {
	margin: 0 0 8px;
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--accent-soft);
}

/* Library details popup. */
.cm-zoom.cm-info {
	width: min(720px, calc(100vw - 32px));
	height: auto;
	max-height: calc(100vh - 48px);
}
.cm-zoom.cm-info .cm-info__list {
	overflow-y: auto;
}
.cm-info__intro {
	margin: 0 20px 8px;
}
.cm-info__list {
	margin: 0;
	padding: 0 20px 20px;
	list-style: none;
}
.cm-info__item {
	padding: 12px 0;
	border-top: 1px solid var(--border);
}
.cm-info__item h3 {
	margin: 0 0 2px;
	color: var(--heading);
	font-size: 1rem;
}
.cm-info__meta {
	margin: 0 0 4px;
	color: var(--dw-teal-dark);
	font-size: 0.82rem;
}
.cm-info__blurb {
	margin: 0;
	font-size: 0.9rem;
}

/* Options */
#opts .field {
	padding: 7px 10px;
}
.cm-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 12px;
}
.cm-row--3 {
	grid-template-columns: repeat(3, 1fr);
	margin-top: 0;
}
/* 색 구성, 글자 크기, 간격 under the title. */
.cm-row--3.cm-row--top {
	margin-top: 12px;
}
.cm-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.9rem;
	font-weight: 500;
}
#opts div[data-for] {
	margin-top: 12px;
}
.cm-seg {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 0 0 6px;
	padding: 0;
	border: 0;
}
.cm-seg .field-label {
	width: 100%;
	margin-bottom: 2px;
	font-size: 0.9rem;
}
.cm-check {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 6px 0;
	font-size: 0.95rem;
}
#opts input[type='checkbox'],
#opts input[type='radio'] {
	accent-color: var(--accent);
}

/* Results */
.cm-main {
	min-width: 0;
}
/* One card per library, stacked top to bottom. */
.cm-results {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 16px;
}
.cm-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: #ffffff;
	overflow: hidden;
}
.cm-card__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--border);
	background: var(--surface);
}
.cm-card__head h3 {
	margin: 0;
	font-size: 1rem;
}
.cm-card__notes {
	padding: 6px 14px 0;
}
.cm-card__notes:empty {
	display: none;
}
.cm-card__chart {
	position: relative;
	height: 380px;
	margin: 8px 10px;
}
.cm-fill {
	width: 100%;
	height: 100%;
}
.cm-checks {
	margin-top: 10px;
}
.cm-checks .cm-check {
	margin: 4px 0;
}
#opts p.field-hint[data-for] {
	margin-top: 10px;
}
/* A library that cannot draw the chosen type. */
.cm-card__msg--none {
	font-size: 0.95rem;
}
.cm-card.is-none .cm-card__chart {
	height: 64px !important;
}
.cm-card.is-none .cm-card__actions {
	display: none;
}
.cm-card__msg {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	padding: 0 16px;
	color: var(--text-soft);
	font-size: 0.9rem;
	text-align: center;
}
.cm-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-top: 1px solid var(--border);
}
.cm-card__out {
	display: flex;
	gap: 16px;
	margin-left: auto;
}
.cm-empty {
	padding: 40px 16px;
	border: 1px dashed var(--border);
	border-radius: var(--radius);
	color: var(--text-soft);
	text-align: center;
}
/* A grid of gauges under one title (adapters.js gaugeGrid). */
.cm-multi {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	background: #ffffff;
}
.cm-multi__title {
	flex: none;
	padding: 4px 0 var(--cm-title-gap, 8px);
	color: #333333;
	font-size: calc(16px * var(--cm-fs, 1));
	font-weight: 700;
	line-height: 1.5;
	text-align: center;
}
.cm-multi__grid {
	flex: 1;
	display: grid;
	gap: 8px 12px;
	min-height: 0;
}
.cm-multi__cell {
	position: relative;
	min-width: 0;
	min-height: 0;
}
.cm-multi__cell.cm-frappe {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Frappe styles its SVG with CSS; give it the page font, and its sizes times '글자 크기' (--cm-fs). */
.cm-frappe {
	font-family: var(--dw-font-body);
}
.cm-frappe svg text {
	font-size: calc(10px * var(--cm-fs, 1));
}
.cm-frappe .chart-container .axis,
.cm-frappe .chart-container .chart-label,
.cm-frappe .chart-container .legend-dataset-text {
	font-size: calc(11px * var(--cm-fs, 1));
}
.cm-frappe .chart-container .title {
	font-size: calc(12px * var(--cm-fs, 1));
}
.cm-frappe .title {
	font-weight: 700;
}

/* Candidates */
.cm-cands {
	margin-top: 28px;
	padding: 16px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}
.cm-cands__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}
.cm-cands__head .cm-step__title {
	margin: 0;
}
.cm-cands__head .button:disabled {
	opacity: 0.45;
	cursor: default;
}
.cm-cands__hint {
	margin: 6px 0 6px;
}
.cm-cands__note {
	margin: 0 0 12px;
	padding: 6px 10px;
	border-left: 3px solid var(--accent);
	border-radius: 4px;
	background: var(--bg);
	color: var(--text-soft);
	font-size: 0.85rem;
}
.cm-cands__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.cm-cand {
	position: relative;
}
.cm-cand__open {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #ffffff;
	font: inherit;
	text-align: left;
	cursor: zoom-in;
	overflow: hidden;
}
.cm-cand__open:hover {
	border-color: var(--accent);
	box-shadow: 0 2px 10px rgba(8, 63, 68, 0.12);
}
.cm-cand__open img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: contain;
	background: #ffffff;
}
.cm-cand__cap {
	padding: 6px 10px;
	border-top: 1px solid var(--border);
	font-size: 0.82rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cm-cand.is-picked .cm-cand__open {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px var(--accent);
}
.cm-cand__pick {
	position: absolute;
	top: 6px;
	left: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.92);
	cursor: pointer;
}
.cm-cand__pick input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--accent);
	cursor: pointer;
}
.cm-cand__del {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--text-soft);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}
.cm-cand__del:hover {
	color: #b42318;
	border-color: #b42318;
}
.cm-cands__empty {
	margin: 0;
	color: var(--text-soft);
	font-size: 0.9rem;
}

/* Zoom */
.cm-zoom {
	width: min(1280px, calc(100vw - 32px));
	height: calc(100vh - 48px);
	max-width: none;
	max-height: none;
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	box-shadow: 0 20px 60px rgba(8, 63, 68, 0.3);
}
.cm-zoom[open] {
	display: flex;
	flex-direction: column;
}
.cm-zoom::backdrop {
	background: rgba(20, 23, 31, 0.6);
}
.cm-zoom__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px 10px 20px;
	border-bottom: 1px solid var(--border);
	background: var(--surface);
}
.cm-zoom__title {
	margin: 0;
	font-size: 1.05rem;
}
.cm-zoom__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.cm-zoom__ratio {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.9rem;
}
.cm-zoom__ratio select {
	padding: 6px 8px;
	border: 1px solid var(--border);
	border-radius: 6px;
	font: inherit;
}
.cm-zoom__close {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--text-soft);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}
.cm-zoom__close:hover {
	background: var(--bg);
	color: var(--text);
}
.cm-zoom__notes {
	padding: 0 20px;
}
.cm-zoom__notes:empty {
	display: none;
}
.cm-zoom__stage {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	margin: 16px;
}
.cm-zoom__chart {
	position: relative;
	border: 1px solid var(--border);
	background: #ffffff;
}

/* Compare view: the compare box's charts large, side by side */
.cm-compare {
	width: calc(100vw - 32px);
	max-width: 1800px;
}
.cm-compare__grid {
	flex: 1;
	display: grid;
	grid-auto-rows: max-content;
	gap: 16px;
	align-content: start;
	min-height: 0;
	margin: 0;
	padding: 16px;
	list-style: none;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--surface);
}
.cm-compare__item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: #ffffff;
	overflow: hidden;
}
/* The chart's name, then its actions; on a narrow cell the actions wrap to a second line. */
.cm-compare__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 8px 14px;
	border-bottom: 1px solid var(--border);
	font-size: 0.9rem;
	font-weight: 500;
}
.cm-compare__name {
	min-width: 0;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cm-compare__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-left: auto;
	font-weight: 400;
}
.cm-compare__tools .cm-link {
	font-size: 0.85rem;
}
.cm-compare__chart {
	position: relative;
	flex: none; /* keep the 16:10 height; the grid scrolls instead */
	aspect-ratio: 16 / 10;
	/* Without these, content (resizing canvases) can stretch an aspect-ratio box taller. */
	min-height: 0;
	overflow: hidden;
	margin: 8px 10px;
}

.cm-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 100;
	margin: 0;
	padding: 10px 18px;
	border-radius: 999px;
	background: #1f2933;
	color: #ffffff;
	font-size: 0.92rem;
	transform: translateX(-50%);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

@media (max-width: 860px) {
	.cm {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.cm-split {
		display: none;
	}
	.cm-side {
		position: static;
		max-height: none;
		overflow: visible;
	}
	.cm-card__chart {
		height: 320px;
	}
}
