/*!
 * Metro Enterprise Charts - charts on a page.
 * Colours come from the page (currentColor, inherit) so a chart sits in a dark
 * band as well as a light one; set --mec-card-bg / --mec-line to adjust.
 * @license Apache-2.0
 */
.mec-chart { margin: 0; color: inherit; font: inherit; min-width: 0; position: relative; }
.mec-chart__title { margin: 0 0 .5rem; font-size: 1.1rem; line-height: 1.3; }
.mec-chart__canvas { width: 100%; min-width: 0; }
.mec-chart__canvas--drill { cursor: pointer; }
.mec-chart__summary { margin-top: .75rem; line-height: 1.55; opacity: .9; }
.mec-chart__tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.mec-chart__tool, .mec-chart__back {
	font: inherit; font-size: .8rem; line-height: 1.2; padding: .35rem .7rem; border-radius: 999px; cursor: pointer;
	border: 1px solid var(--mec-line, rgba(127, 127, 127, .35)); background: transparent; color: inherit;
}
.mec-chart__tool:hover, .mec-chart__back:hover { background: rgba(127, 127, 127, .12); }
.mec-chart__tool:focus-visible, .mec-chart__back:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.mec-chart__tool[aria-pressed="true"] { background: rgba(127, 127, 127, .18); }
.mec-chart__crumbs { margin: .25rem 0 .5rem; }
.mec-chart.mec-is-loading .mec-chart__canvas { opacity: .45; transition: opacity .2s; }
.mec-chart__note { opacity: .7; font-style: italic; }

/* The data table: read by screen readers always, seen when "Show data" is on
   (and always for the table chart). */
.mec-chart__table {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mec-chart--table .mec-chart__table {
	position: static; width: 100%; height: auto; margin: .75rem 0 0; overflow: visible; clip: auto; white-space: normal;
	border-collapse: collapse; font-size: .9rem;
}
.mec-chart--table .mec-chart__table caption { caption-side: top; text-align: left; font-weight: 600; padding-bottom: .4rem; }
.mec-chart--t-table .mec-chart__table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.mec-chart--table .mec-chart__table th, .mec-chart--table .mec-chart__table td {
	padding: .45rem .6rem; border-bottom: 1px solid var(--mec-line, rgba(127, 127, 127, .25)); text-align: left;
}
.mec-chart--table .mec-chart__table td[data-value] { text-align: right; font-variant-numeric: tabular-nums; }
.mec-chart--table .mec-chart__table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.mec-chart--table:not(.mec-chart--t-table) .mec-chart__table { display: block; max-height: 320px; overflow: auto; }

/* Layouts */
.mec-chart--card {
	background: var(--mec-card-bg, #ffffff); color: var(--mec-card-fg, #0f172a); border-radius: var(--mec-radius, 16px);
	padding: 1.25rem 1.25rem 1rem; box-shadow: 0 12px 32px -18px rgba(15, 23, 42, .35); border: 1px solid rgba(15, 23, 42, .06);
}
.mec-chart--full .mec-chart__summary, .mec-chart--full .mec-chart__tools, .mec-chart--full .mec-chart__title { padding: 0 1rem; }
.mec-chart__side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: center; }
/* Side by side when the chart's own box is wide enough - not the screen: a
   side layout in a narrow column stacks, as on a phone. */
.mec-chart--side, .mec-chart--banner, .mec-chart--datatable { container-type: inline-size; }
@container (min-width: 560px) {
	.mec-chart__side { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
	.mec-chart--side.mec-chart--reverse .mec-chart__main { order: 2; }
}
.mec-chart__aside .mec-chart__title { font-size: 1.4rem; }

/* KPI tile */
.mec-chart--kpi {
	background: var(--mec-card-bg, #ffffff); color: var(--mec-card-fg, #0f172a); border-radius: var(--mec-radius, 16px);
	padding: 1.1rem 1.25rem; box-shadow: 0 12px 32px -18px rgba(15, 23, 42, .35); border: 1px solid rgba(15, 23, 42, .06);
}
.mec-chart--kpi .mec-chart__title { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.mec-kpi { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; margin-bottom: .4rem; }
.mec-kpi__value { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.mec-kpi__delta { font-size: .85rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.mec-kpi__delta--up { color: #15803d; background: rgba(22, 163, 74, .12); }
.mec-kpi__delta--down { color: #b91c1c; background: rgba(220, 38, 38, .12); }
.mec-kpi__label { flex-basis: 100%; font-size: .8rem; opacity: .7; }
.mec-chart--kpi .mec-chart__summary { font-size: .85rem; margin-top: .4rem; }

/* A dashboard: a category of charts in a grid, or in tabs. */
.mec-dash { display: grid; gap: var(--mec-gap, 20px); grid-template-columns: repeat(var(--mec-cols-m, 1), minmax(0, 1fr)); }
@media (min-width: 768px) { .mec-dash { grid-template-columns: repeat(var(--mec-cols-t, 2), minmax(0, 1fr)); } }
@media (min-width: 1100px) { .mec-dash { grid-template-columns: repeat(var(--mec-cols-d, 3), minmax(0, 1fr)); } }
.mec-dash > .mec-chart--kpi { align-self: start; }
.mec-tabs__list { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.mec-tabs__tab { font: inherit; font-size: .9rem; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--mec-line, rgba(127, 127, 127, .35)); background: transparent; color: inherit; cursor: pointer; }
.mec-tabs__tab[aria-selected="true"] { background: currentColor; }
.mec-tabs__tab[aria-selected="true"] > span { color: var(--mec-card-bg, #ffffff); }
.mec-tabs__panel[hidden] { display: none; }

@media print {
	.mec-chart__tools, .mec-chart__crumbs { display: none; }
	.mec-chart { break-inside: avoid; }
}

/* ---- 1.1.0: layouts and the placement's own style ----
   --mec-accent, --mec-radius, --mec-pad, --mec-title-size, --mec-border,
   --mec-card-bg, --mec-card-fg come from the Metro add-on, the module or the
   shortcode; each layout reads them. */
.mec-chart { text-align: left; }
.mec-chart__title { display: flex; align-items: center; gap: .5rem; font-size: var(--mec-title-size, 1.1rem); }
.mec-chart__icon { display: inline-flex; align-items: center; justify-content: center; width: 2em; height: 2em; border-radius: .6em; flex: none;
	background: color-mix(in srgb, var(--mec-accent, #6366f1) 14%, transparent); color: var(--mec-accent, #6366f1); font-size: .95em; }
.mec-chart--card, .mec-chart--kpi, .mec-chart--compact, .mec-chart--outline, .mec-chart--glass, .mec-chart--dark,
.mec-chart--metric, .mec-chart--spotlight, .mec-chart--datatable { border-radius: var(--mec-radius, 16px); padding: var(--mec-pad, 1.25rem); }
.mec-chart--compact, .mec-chart--metric, .mec-chart--spotlight, .mec-chart--datatable {
	background: var(--mec-card-bg, #ffffff); color: var(--mec-card-fg, #0f172a); box-shadow: 0 12px 32px -18px rgba(15, 23, 42, .35); border: 1px solid rgba(15, 23, 42, .06);
}
.mec-chart--compact { padding: var(--mec-pad, .85rem); }
.mec-chart--compact .mec-chart__title { font-size: var(--mec-title-size, .95rem); margin-bottom: .25rem; }
.mec-chart--compact .mec-chart__summary { font-size: .85rem; margin-top: .4rem; }
.mec-chart--outline { background: var(--mec-card-bg, transparent); color: var(--mec-card-fg, inherit); border: 1.5px solid var(--mec-border, rgba(127, 127, 127, .35)); }
.mec-chart--glass { background: var(--mec-card-bg, rgba(255, 255, 255, .14)); color: var(--mec-card-fg, inherit); border: 1px solid rgba(255, 255, 255, .35);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .45); }
.mec-chart--dark { background: var(--mec-card-bg, #0f172a); color: var(--mec-card-fg, #e2e8f0); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .6); }
.mec-chart--banner { border-radius: var(--mec-radius, 20px); padding: var(--mec-pad, 2rem);
	background: var(--mec-card-bg, linear-gradient(135deg, color-mix(in srgb, var(--mec-accent, #6366f1) 92%, #000), color-mix(in srgb, var(--mec-accent, #6366f1) 55%, #0ea5e9)));
	color: var(--mec-card-fg, #ffffff); }
.mec-chart--banner .mec-chart__main { background: rgba(255, 255, 255, .96); color: #0f172a; border-radius: calc(var(--mec-radius, 20px) - 6px); padding: 1rem; }
.mec-chart--banner .mec-chart__aside .mec-chart__title { font-size: var(--mec-title-size, 1.6rem); }
@container (min-width: 560px) {
	.mec-chart--banner .mec-chart__side { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
	.mec-chart--banner .mec-chart__main { order: 2; }
}
.mec-chart__side--table { align-items: start; }
@container (min-width: 560px) { .mec-chart__side--table { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.mec-chart--datatable .mec-chart__aside { max-height: 420px; overflow: auto; }
.mec-chart--datatable .mec-chart__table { display: table; max-height: none; margin-top: 0; }
.mec-chart--metric .mec-kpi { margin-bottom: 0; }
.mec-chart--metric { border-top: 4px solid var(--mec-accent, #6366f1); }
.mec-chart--spotlight .mec-kpi__value { font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--mec-accent, inherit); }
.mec-chart--kpi { border-left: 4px solid var(--mec-accent, transparent); }
.mec-chart--card { border-radius: var(--mec-radius, 16px); padding: var(--mec-pad, 1.25rem 1.25rem 1rem); }

.mec-shadow-none { box-shadow: none !important; }
.mec-shadow-soft { box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35) !important; }
.mec-shadow-strong { box-shadow: 0 26px 60px -24px rgba(15, 23, 42, .6) !important; }
.mec-has-border { border: 1px solid var(--mec-border) !important; }
.mec-align-center, .mec-align-center .mec-chart__title, .mec-align-center .mec-kpi { text-align: center; justify-content: center; }
.mec-align-center .mec-chart__tools { justify-content: center; }
@container (min-width: 560px) {
	.mec-chart--datatable.mec-chart--reverse .mec-chart__main { order: 2; }
	.mec-chart--banner.mec-chart--reverse .mec-chart__main { order: 0; }
}

/* 1.2.0: a width, and where a narrower chart sits in its column. */
.mec-chart.mec-has-width { width: 100%; max-width: var(--mec-width, none); }
.mec-chart.mec-place-center { margin-left: auto; margin-right: auto; }
.mec-chart.mec-place-right { margin-left: auto; margin-right: 0; }

/* 1.4.0: space around a chart, a picture behind it, and phones. */
.mec-chart { margin-top: var(--mec-mt, 0); margin-bottom: var(--mec-mb, 0); }
.mec-chart.mec-has-bg { background-image: var(--mec-bg-image); background-size: cover; background-position: var(--mec-bg-pos, center); background-repeat: no-repeat; }
@media (max-width: 767px) {
	.mec-chart.mec-has-mh .mec-chart__canvas { height: var(--mec-h-m) !important; }
	.mec-chart.mec-m-hide-title .mec-chart__title,
	.mec-chart.mec-m-hide-summary .mec-chart__summary,
	.mec-chart.mec-m-hide-tools .mec-chart__tools { display: none; }
}

/* 1.5.0: lazy charts and loading animations. */
.mec-lazy { position: relative; min-height: var(--mec-lazy-h, 420px); display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: .6rem; }
.mec-lazy__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.mec-lazy__shape { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; flex: 1; width: 100%; }
.mec-sk { display: block; border-radius: .4rem; background: linear-gradient(90deg, rgba(127,127,127,.14) 25%, rgba(127,127,127,.26) 37%, rgba(127,127,127,.14) 63%); background-size: 400% 100%; animation: mec-shimmer 1.4s ease infinite; }
.mec-sk--title { width: 45%; height: 1.1rem; align-self: flex-start; }
.mec-sk--chart { width: 100%; flex: none; height: calc(var(--mec-lazy-h, 360px) * .6); display: flex; align-items: flex-end; gap: 6%; padding: 6% 6% 0; background: none; animation: none; }
.mec-sk--chart i { flex: 1; border-radius: .3rem .3rem 0 0; background: rgba(127,127,127,.18); animation: mec-shimmer 1.4s ease infinite; background-image: linear-gradient(90deg, rgba(127,127,127,.14) 25%, rgba(127,127,127,.26) 37%, rgba(127,127,127,.14) 63%); background-size: 400% 100%; }
.mec-sk--chart i:nth-child(1) { height: 45%; } .mec-sk--chart i:nth-child(2) { height: 70%; } .mec-sk--chart i:nth-child(3) { height: 55%; }
.mec-sk--chart i:nth-child(4) { height: 85%; } .mec-sk--chart i:nth-child(5) { height: 60%; } .mec-sk--chart i:nth-child(6) { height: 75%; }
.mec-sk--line { width: 90%; height: .75rem; align-self: flex-start; } .mec-sk--short { width: 55%; }
@keyframes mec-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.mec-ld-spin, .mec-chart.mec-is-loading.mec-loading--spinner::after { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 3px solid rgba(127,127,127,.25); border-top-color: var(--mec-accent, #6366f1); animation: mec-spin .8s linear infinite; }
@keyframes mec-spin { to { transform: rotate(360deg); } }
.mec-ld-pulse, .mec-chart.mec-is-loading.mec-loading--pulse::after { width: 3rem; height: 3rem; border-radius: 50%; background: var(--mec-accent, #6366f1); animation: mec-pulse 1.2s ease-in-out infinite; }
@keyframes mec-pulse { 0%, 100% { transform: scale(.55); opacity: .35; } 50% { transform: scale(1); opacity: .85; } }
.mec-ld-bars { display: flex; align-items: flex-end; gap: .35rem; height: 3rem; }
.mec-ld-bars i { width: .55rem; height: 100%; border-radius: .2rem; background: var(--mec-accent, #6366f1); transform-origin: bottom; animation: mec-grow 1s ease-in-out infinite; }
.mec-ld-bars i:nth-child(2) { animation-delay: .1s; } .mec-ld-bars i:nth-child(3) { animation-delay: .2s; } .mec-ld-bars i:nth-child(4) { animation-delay: .3s; } .mec-ld-bars i:nth-child(5) { animation-delay: .4s; }
@keyframes mec-grow { 0%, 100% { transform: scaleY(.3); opacity: .5; } 50% { transform: scaleY(1); opacity: 1; } }
.mec-ld-dots { display: flex; gap: .5rem; } .mec-ld-dots i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--mec-accent, #6366f1); animation: mec-dot 1s ease-in-out infinite; }
.mec-ld-dots i:nth-child(2) { animation-delay: .15s; } .mec-ld-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes mec-dot { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-.6rem); opacity: 1; } }
/* While a drill-down or a live refresh loads, the chart's own loader sits over it. */
.mec-chart.mec-is-loading::after { content: ''; position: absolute; left: 50%; top: 45%; margin: -1.3rem 0 0 -1.3rem; z-index: 2; }
.mec-chart.mec-is-loading.mec-loading--none::after, .mec-chart.mec-is-loading.mec-loading--skeleton::after,
.mec-chart.mec-is-loading.mec-loading--bars::after, .mec-chart.mec-is-loading.mec-loading--dots::after { content: none; }
.mec-chart.mec-is-loading.mec-loading--skeleton .mec-chart__canvas { animation: mec-fade 1s ease-in-out infinite alternate; }
@keyframes mec-fade { from { opacity: .35; } to { opacity: .7; } }
.mec-lazy.mec-lazy-arrived { animation: mec-arrive .35s ease; }
@keyframes mec-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.mec-sk, .mec-sk--chart i, .mec-ld-spin, .mec-ld-pulse, .mec-ld-bars i, .mec-ld-dots i, .mec-chart.mec-is-loading::after, .mec-lazy-arrived, .mec-chart.mec-is-loading .mec-chart__canvas { animation: none !important; }
}

