/* Combustibles RD Frontend Styles v3.1 — RD flag colors + 300x250 banner */

/* ===== CSS Variables & Dominican Theme ===== */
.crd-app {
	/* Dominican flag palette */
	--crd-flag-blue: #002D62;
	--crd-flag-red: #CE1126;
	--crd-flag-white: #FFFFFF;

	/* Functional colors */
	--crd-text: #14356b;
	--crd-muted: #64748b;
	--crd-card: rgba(255, 255, 255, 0.94);
	--crd-card-border: #e0e7ef;
	--crd-primary: #002D62;
	--crd-accent: #CE1126;
	--crd-up: #CE1126;
	--crd-down: #079455;
	--crd-stable: #94a3b8;
	--crd-price-color: #14356b;
	--crd-ticker-bg: #0d1117;
	--crd-ticker-text: #c9d1d9;
	--crd-ticker-label: #1f883d;
	--crd-ticker-badge-text: #ffffff;
	--crd-shadow: 0 24px 70px rgba(0, 45, 98, 0.12);
	--crd-radius: 28px;
	--crd-card-radius: 16px;

	font-family: inherit;
	color: var(--crd-text);
	background: var(--crd-bg, linear-gradient(135deg, rgba(0, 45, 98, 0.06), rgba(206, 17, 38, 0.06), rgba(255, 255, 255, 0.9)));
	border: 1px solid rgba(148, 163, 184, 0.25);
	border-radius: var(--crd-radius);
	padding: clamp(18px, 3vw, 32px);
	box-shadow: var(--crd-shadow);
	overflow: hidden;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	position: relative;
	line-height: 1.4;
}

/* ── Dark mode ── */
.crd-dark {
	--crd-bg: #0f172a;
	--crd-text: #f1f5f9;
	--crd-muted: #94a3b8;
	--crd-card: rgba(30, 41, 59, 0.92);
	--crd-card-border: rgba(71, 85, 105, 0.5);
	--crd-stable: #64748b;
	--crd-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
	background: linear-gradient(135deg, #0a1628, #002D62, #1a0a0a);
	color: var(--crd-text);
}


/* ==================================================================
 * SIZES — Pixel-perfect with responsive fallback
 * ================================================================== */

/* ── Responsive / Full width (default) ── */
.crd-size-responsive,
.crd-size-full {
	width: 100%;
}

/* ── 728×90 — Leaderboard banner ── */
.crd-size-728x90 {
	width: 728px;
	max-width: 100%;
	min-height: 90px;
	padding: 8px 14px;
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.crd-size-728x90 .crd-header {
	margin-bottom: 6px;
}

.crd-size-728x90 .crd-header h2 {
	font-size: 1rem;
}

.crd-size-728x90 .crd-eyebrow {
	font-size: 0.65rem;
	margin-bottom: 0;
}

.crd-size-728x90 .crd-header time {
	font-size: 0.7rem;
}

.crd-size-728x90 .crd-main-grid {
	gap: 4px 10px;
}

.crd-size-728x90 .crd-col {
	gap: 4px;
}

.crd-size-728x90 .crd-card {
	padding: 6px 8px;
	border-radius: 8px;
}

.crd-size-728x90 .crd-card h3 {
	font-size: 0.72rem;
}

.crd-size-728x90 .crd-price {
	font-size: 0.85rem;
}

.crd-size-728x90 .crd-variation {
	font-size: 0.7rem;
}

.crd-size-728x90 .crd-triangle-up {
	border-left-width: 6px;
	border-right-width: 6px;
	border-bottom-width: 10px;
}

.crd-size-728x90 .crd-triangle-down {
	border-left-width: 6px;
	border-right-width: 6px;
	border-top-width: 10px;
}

.crd-size-728x90 .crd-triangle-eq {
	border-left-width: 6px;
	border-right-width: 6px;
	height: 4px;
	width: 12px;
}

.crd-size-728x90 .crd-equals {
	width: 12px;
	height: 6px;
}

.crd-size-728x90 .crd-equals::before,
.crd-size-728x90 .crd-equals::after {
	height: 2px;
}

.crd-size-728x90 .crd-logo {
	width: var(--crd-logo-width, 34px);
	height: var(--crd-logo-height, 34px);
	max-width: 60px;
	max-height: 60px;
}


/* ==================================================================
 * HEADER
 * ================================================================== */

.crd-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
	flex-wrap: wrap;
}

.crd-header h2 {
	margin: 0;
	font-size: clamp(1.4rem, 3vw, 2.25rem);
	line-height: 1.1;
	font-weight: 800;
	color: var(--crd-text);
}

.crd-eyebrow {
	margin: 0 0 6px;
	color: var(--crd-primary);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.78rem;
}

.crd-header time {
	color: var(--crd-muted);
	font-weight: 600;
	font-size: 0.88rem;
	white-space: nowrap;
}

.crd-header-brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Logo shared */
.crd-logo {
	width: var(--crd-logo-width, 48px);
	height: var(--crd-logo-height, 48px);
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	flex: 0 0 auto;
	display: inline-block;
}

.crd-logo svg,
.crd-logo img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

.crd-logo-default {
	color: var(--crd-text);
}


/* ==================================================================
 * GRID LAYOUT
 * ================================================================== */

.crd-main-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 24px;
}

.crd-col {
	display: flex;
	flex-direction: column;
	gap: 12px;
}


/* ==================================================================
 * CARDS (shared)
 * ================================================================== */

.crd-card {
	background: var(--crd-card);
	border: 1px solid var(--crd-card-border);
	border-radius: var(--crd-card-radius);
	padding: 14px 12px;
	box-shadow: 0 2px 8px rgba(0, 45, 98, 0.07);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-sizing: border-box;
}

.crd-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 45, 98, 0.14);
}

.crd-card.crd-up {
	border-left: 3px solid var(--crd-up);
}

.crd-card.crd-down {
	border-left: 3px solid var(--crd-down);
}

.crd-card.crd-stable {
	border-left: 3px solid var(--crd-stable);
}


/* ==================================================================
 * COLLAPSIBLE SECONDARY FUELS (Avtur, Fuel Oil, Kerosene, Fuel Oil 1%)
 * ================================================================== */

.crd-secondary-wrap {
	margin-top: 16px;
	text-align: center;
}

.crd-secondary-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 20px;
	background: var(--crd-card);
	border: 1px dashed var(--crd-card-border);
	border-radius: 24px;
	color: var(--crd-muted);
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.crd-secondary-toggle:hover {
	border-color: var(--crd-primary);
	color: var(--crd-primary);
	background: rgba(0, 45, 98, 0.04);
}

.crd-secondary-toggle[aria-expanded="true"] {
	border-style: solid;
	border-color: var(--crd-primary);
	color: var(--crd-primary);
	background: rgba(0, 45, 98, 0.06);
}

.crd-toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--crd-primary);
	color: #fff;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1;
	transition: transform 0.25s ease;
}

.crd-secondary-toggle[aria-expanded="true"] .crd-toggle-icon {
	transform: rotate(45deg);
	background: var(--crd-accent);
}

.crd-secondary-row {
	display: flex;
	gap: 10px;
	margin-top: 14px;
	flex-wrap: wrap;
	justify-content: center;
	overflow: hidden;
	transition: max-height 0.35s ease, opacity 0.35s ease, margin 0.35s ease;
}

.crd-secondary-row[hidden] {
	display: none;
}


/* Secondary cards */
.crd-card.crd-secondary {
	background: rgba(0, 45, 98, 0.04);
	border: 1px solid rgba(0, 45, 98, 0.12);
	border-radius: 12px;
	padding: 10px 8px;
	box-shadow: none;
	flex: 1 1 140px;
	min-width: 140px;
	max-width: 170px;
}

.crd-dark .crd-card.crd-secondary {
	background: rgba(30, 41, 59, 0.7);
	border-color: rgba(71, 85, 105, 0.4);
}

.crd-card.crd-secondary:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 45, 98, 0.08);
}

.crd-card.crd-secondary h3 {
	font-size: 0.98rem;
}

.crd-card.crd-secondary .crd-price {
	font-size: 1.12rem;
}

.crd-card.crd-secondary .crd-variation {
	font-size: 0.92rem;
}


/* ==================================================================
 * CARD INNER ELEMENTS
 * ================================================================== */

.crd-card-top {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.crd-card h3 {
	margin: 0;
	font-size: 1.08rem;
	line-height: 1.15;
	font-weight: 700;
	color: var(--crd-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.crd-price {
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1.1;
	margin-bottom: 2px;
	color: var(--crd-price-color, var(--crd-text));
	letter-spacing: -0.5px;
}

.crd-variation {
	font-size: 0.95rem;
	font-weight: 600;
	margin: 0;
}

/* Variation colors */
.crd-var-up   { color: var(--crd-up); }
.crd-var-down { color: var(--crd-down); }
.crd-var-stable { color: var(--crd-muted); }


/* ==================================================================
 * TRIANGLE ICONS
 * ================================================================== */

.crd-triangle,
.crd-equals {
	display: inline-block;
	flex: 0 0 auto;
	width: 0;
	height: 0;
	vertical-align: middle;
}

.crd-triangle-up {
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-bottom: 20px solid var(--crd-up);
}

.crd-triangle-down {
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-top: 20px solid var(--crd-down);
}

.crd-triangle-eq {
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-top: 0;
	border-bottom: 0;
	height: 8px;
	background: var(--crd-stable);
	border-radius: 2px;
	width: 24px;
}

/* Two-bar equals icon (used as stable icon in 300x250) */
.crd-equals {
	width: 22px;
	height: 14px;
	position: relative;
	background: transparent;
}

.crd-equals::before,
.crd-equals::after {
	content: '';
	position: absolute;
	left: 0;
	width: 100%;
	height: 4px;
	background: var(--crd-stable);
	border-radius: 1px;
}

.crd-equals::before { top: 1px; }
.crd-equals::after  { bottom: 1px; }

/* Smaller triangles for secondary cards */
.crd-card.crd-secondary .crd-triangle-up {
	border-left-width: 9px;
	border-right-width: 9px;
	border-bottom-width: 15px;
}

.crd-card.crd-secondary .crd-triangle-down {
	border-left-width: 9px;
	border-right-width: 9px;
	border-top-width: 15px;
}

.crd-card.crd-secondary .crd-triangle-eq {
	border-left-width: 9px;
	border-right-width: 9px;
	height: 6px;
	width: 18px;
}

.crd-card.crd-secondary .crd-equals {
	width: 18px;
	height: 10px;
}

.crd-card.crd-secondary .crd-equals::before,
.crd-card.crd-secondary .crd-equals::after {
	height: 3px;
}


/* ==================================================================
 * TABLE LAYOUT
 * ================================================================== */

.crd-table {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.crd-table-head {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 8px;
	padding: 10px 12px;
	font-weight: 700;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--crd-muted);
	border-bottom: 2px solid var(--crd-card-border);
}

.crd-table-head .crd-th-fuel { text-align: left; }
.crd-table-head .crd-th-price { text-align: right; }
.crd-table-head .crd-th-var   { text-align: right; }

.crd-table-row {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 8px;
	align-items: center;
	padding: 10px 12px;
	border-bottom: 1px solid var(--crd-card-border);
	transition: background 0.15s ease;
}

.crd-table-row:hover {
	background: rgba(0, 45, 98, 0.04);
}

.crd-table-row.crd-up    { border-left: 3px solid var(--crd-up); }
.crd-table-row.crd-down  { border-left: 3px solid var(--crd-down); }
.crd-table-row.crd-stable { border-left: 3px solid transparent; }

.crd-td-fuel {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	min-width: 0;
}

.crd-td-price { text-align: right; font-weight: 700; }
.crd-td-var   { text-align: right; font-weight: 600; font-size: 0.9rem; }


/* ==================================================================
 * COMPACT LAYOUT
 * ================================================================== */

.crd-compact {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.crd-compact .crd-card {
	flex: 1 1 200px;
	min-width: 160px;
}


/* ==================================================================
 * SLIDER LAYOUT
 * ================================================================== */

.crd-slider {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	gap: 16px;
	padding-bottom: 8px;
	scrollbar-width: thin;
	scrollbar-color: var(--crd-muted) transparent;
}

.crd-slider::-webkit-scrollbar { height: 6px; }
.crd-slider::-webkit-scrollbar-track { background: transparent; }
.crd-slider::-webkit-scrollbar-thumb { background: var(--crd-muted); border-radius: 3px; }

.crd-slider .crd-card {
	scroll-snap-align: start;
	min-width: 220px;
	flex: 0 0 auto;
}


/* ==================================================================
 * 300×250 BANNER — Official MICM-style card
 * ================================================================== */

.crd-size-300x250 {
	width: 300px;
	max-width: 100%;
	height: auto;
	min-height: 300px;
	padding: 0;
	border-radius: 14px;
	background: var(--crd-bg, var(--crd-primary, #0077c8));
	border: none;
	box-shadow: 0 6px 24px rgba(0, 45, 98, 0.22);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.crd-size-300x250 .crd-header {
	display: none;
}

/* Banner header: logo + title + week */
.crd-banner-header {
	text-align: center;
	padding: 10px 10px 6px;
	color: #fff;
	flex-shrink: 0;
}

.crd-banner-header .crd-logo {
	width: var(--crd-logo-width, 56px);
	height: var(--crd-logo-height, 48px);
	max-width: 80px;
	max-height: 80px;
	margin: 0 auto 5px;
	display: block;
	color: #fff;
}

.crd-banner-header .crd-logo-custom {
	width: auto;
	max-width: var(--crd-logo-width, 56px);
	max-height: var(--crd-logo-height, 48px);
	object-fit: contain;
	margin: 0 auto;
	display: block;
}

.crd-banner-header h2 {
	margin: 0;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.15;
	color: #fff;
}

.crd-banner-week {
	margin: 2px 0 0;
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.92);
}

/* Main white card */
.crd-size-300x250 .crd-main-card {
	background: var(--crd-card, #fff);
	border-radius: 12px;
	margin: 0 8px 7px;
	padding: 7px 6px;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.crd-size-300x250 .crd-main-grid {
	gap: 5px 7px;
}

.crd-size-300x250 .crd-col {
	gap: 5px;
}

.crd-size-300x250 .crd-card {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 3px 4px;
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

.crd-size-300x250 .crd-card:hover {
	transform: none;
	box-shadow: none;
}

.crd-size-300x250 .crd-card.crd-up,
.crd-size-300x250 .crd-card.crd-down,
.crd-size-300x250 .crd-card.crd-stable {
	border-left: none;
}

.crd-size-300x250 .crd-card-top {
	gap: 5px;
	margin-bottom: 2px;
	padding-bottom: 2px;
	border-bottom: 1px solid #e0e7ef;
}

.crd-size-300x250 .crd-card h3 {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--crd-primary, #0077c8);
	white-space: normal;
	line-height: 1.1;
}

.crd-size-300x250 .crd-triangle-up {
	border-left-width: 7px;
	border-right-width: 7px;
	border-bottom-width: 11px;
}

.crd-size-300x250 .crd-triangle-down {
	border-left-width: 7px;
	border-right-width: 7px;
	border-top-width: 11px;
	border-top-color: var(--crd-down);
}

.crd-size-300x250 .crd-equals {
	width: 15px;
	height: 10px;
}

.crd-size-300x250 .crd-equals::before,
.crd-size-300x250 .crd-equals::after {
	height: 3px;
	background: var(--crd-stable, #0077c8);
}

.crd-size-300x250 .crd-price {
	font-size: 1.18rem;
	font-weight: 800;
	color: var(--crd-price-color, var(--crd-text, #14356b));
	margin: 0;
	letter-spacing: -0.5px;
	line-height: 1;
}

.crd-size-300x250 .crd-price span {
	font-weight: 700;
	font-size: 0.78rem;
}

.crd-size-300x250 .crd-variation {
	font-size: 0.64rem;
	font-weight: 700;
	margin-top: 2px;
	line-height: 1;
}

.crd-size-300x250 .crd-var-up::before {
	content: '';
}

.crd-size-300x250 .crd-variation .crd-var-stable {
	display: none;
}

/* Secondary fuels grid (2×2) */
.crd-size-300x250 .crd-secondary-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	padding: 0 8px 7px;
	flex-shrink: 0;
}

.crd-size-300x250 .crd-secondary-grid .crd-sec-card {
	background: #e8eef4;
	background: var(--crd-card, #fff);
	border-radius: 9px;
	padding: 5px 6px;
	color: var(--crd-text, #14356b);
	box-sizing: border-box;
}

.crd-size-300x250 .crd-secondary-grid .crd-sec-card h4 {
	margin: 0 0 2px;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--crd-text, #14356b);
	line-height: 1.1;
}

.crd-size-300x250 .crd-secondary-grid .crd-sec-row {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 0.86rem;
	font-weight: 800;
	color: var(--crd-price-color, var(--crd-text, #14356b));
	line-height: 1;
}

.crd-size-300x250 .crd-secondary-grid .crd-sec-row .crd-arrow {
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 8px solid var(--crd-down);
	flex: 0 0 auto;
}

.crd-size-300x250 .crd-secondary-grid .crd-sec-row .crd-arrow-up {
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-bottom: 8px solid var(--crd-up);
	border-top: none;
}

.crd-size-300x250 .crd-secondary-grid .crd-sec-row .crd-arrow-stable {
	border: none;
	width: 11px;
	height: 3px;
	background: var(--crd-stable);
	border-radius: 1px;
}

.crd-size-300x250 .crd-secondary-grid .crd-sec-var {
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--crd-down);
}

.crd-size-300x250 .crd-secondary-grid.crd-secondary-collapsed .crd-sec-card {
	display: none;
}

.crd-size-300x250 .crd-secondary-more {
	flex-shrink: 0;
	align-self: center;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin: 0 auto 7px;
	padding: 4px 12px;
	background: rgba(255, 255, 255, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 14px;
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease;
	font-family: inherit;
}

.crd-size-300x250 .crd-secondary-more:hover {
	background: rgba(255, 255, 255, 0.3);
}

.crd-size-300x250 .crd-secondary-more[aria-expanded="true"] .crd-more-icon {
	transform: rotate(45deg);
}

.crd-size-300x250 .crd-secondary-wrap,
.crd-size-300x250 .crd-secondary-row,
.crd-size-300x250 .crd-secondary-toggle {
	display: none;
}


/* ==================================================================
 * NEWS TICKER — Financial / exchange-rate style bar
 * ================================================================== */

/* Ticker mode: dark financial bar */
.crd-ticker-mode {
	padding: 0 !important;
	border-radius: 6px !important;
	border: none !important;
	box-shadow: none !important;
	background: var(--crd-ticker-bg, #0d1117) !important;
	overflow: hidden;
	height: 38px;
	min-height: 38px;
	display: flex;
	align-items: stretch;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.crd-dark.crd-ticker-mode {
	background: var(--crd-ticker-bg, #05070a) !important;
}

/* News label badge */
.crd-ticker-label {
	flex: 0 0 auto;
	background: var(--crd-ticker-label, #1f883d);
	color: var(--crd-ticker-badge-text, #fff);
	font-weight: 800;
	font-size: 0.7rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 0 12px 0 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	z-index: 3;
	position: relative;
}

.crd-ticker-label .crd-logo {
	width: var(--crd-logo-width, 18px);
	height: var(--crd-logo-height, 18px);
	max-width: 30px;
	max-height: 30px;
	color: var(--crd-ticker-badge-text, #fff);
}

.crd-ticker-label .crd-logo-custom {
	width: auto;
	max-width: var(--crd-logo-width, 18px);
	max-height: var(--crd-logo-height, 18px);
}

.crd-ticker-label::after {
	content: '';
	position: absolute;
	right: -8px;
	top: 0;
	bottom: 0;
	width: 0;
	height: 0;
	border-top: 19px solid transparent;
	border-bottom: 19px solid transparent;
	border-left: 8px solid var(--crd-ticker-label, #1f883d);
}

/* Ticker track wrapper */
.crd-ticker {
	overflow: hidden;
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
}

/* Fade edges */
.crd-ticker::before,
.crd-ticker::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	width: 24px;
	z-index: 2;
	pointer-events: none;
}

.crd-ticker::before {
	left: 0;
	background: linear-gradient(to right, var(--crd-ticker-bg, #0d1117) 0%, transparent 100%);
}

.crd-ticker::after {
	right: 0;
	background: linear-gradient(to left, var(--crd-ticker-bg, #0d1117) 0%, transparent 100%);
}

.crd-dark .crd-ticker::before {
	background: linear-gradient(to right, var(--crd-ticker-bg, #05070a) 0%, transparent 100%);
}

.crd-dark .crd-ticker::after {
	background: linear-gradient(to left, var(--crd-ticker-bg, #05070a) 0%, transparent 100%);
}

.crd-ticker-track {
	display: flex;
	align-items: center;
	gap: 42px;
	animation: crd-ticker-scroll 30s linear infinite;
	width: max-content;
	padding: 0 30px;
}

.crd-ticker:hover .crd-ticker-track {
	animation-play-state: paused;
}

@keyframes crd-ticker-scroll {
	0%   { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

/* Ticker item: Name  price / variation */
.crd-ticker-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	white-space: nowrap;
	color: var(--crd-ticker-text, #c9d1d9);
	font-size: 0.82rem;
	line-height: 1;
}

.crd-ticker-name {
	font-weight: 600;
	color: var(--crd-ticker-text, rgba(255, 255, 255, 0.78));
	font-size: 0.78rem;
	font-family: inherit;
}

.crd-ticker-price,
.crd-ticker-var {
	font-weight: 700;
	font-size: 0.84rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.crd-ticker-price {
	color: var(--crd-ticker-text, #fff);
}

.crd-ticker-sep {
	color: var(--crd-ticker-text, #484f58);
	opacity: 0.6;
	font-weight: 600;
}

.crd-tick-up   { color: #ff6b6b; }
.crd-tick-down { color: #51cf66; }
.crd-tick-stable { color: #8b949e; }


/* ==================================================================
 * STAGGERED FADE ANIMATION
 * ================================================================== */

.crd-app[data-animation="fade"] .crd-main-grid .crd-card,
.crd-app[data-animation="fade"] .crd-secondary-row .crd-card,
.crd-app[data-animation="fade"] .crd-table-row,
.crd-app[data-animation="fade"] .crd-compact .crd-card,
.crd-app[data-animation="fade"] .crd-slider .crd-card {
	animation: crd-fade-in 0.4s ease both;
}

.crd-app[data-animation="none"] .crd-card,
.crd-app[data-animation="none"] .crd-table-row {
	animation: none;
}

@keyframes crd-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Stagger delays */
.crd-col .crd-card:nth-child(1),
.crd-compact .crd-card:nth-child(1),
.crd-slider .crd-card:nth-child(1),
.crd-table-row:nth-child(2) { animation-delay: 0.05s; }

.crd-col .crd-card:nth-child(2),
.crd-compact .crd-card:nth-child(2),
.crd-slider .crd-card:nth-child(2),
.crd-table-row:nth-child(3) { animation-delay: 0.10s; }

.crd-col .crd-card:nth-child(3),
.crd-compact .crd-card:nth-child(3),
.crd-slider .crd-card:nth-child(3),
.crd-table-row:nth-child(4) { animation-delay: 0.15s; }

.crd-compact .crd-card:nth-child(4),
.crd-slider .crd-card:nth-child(4),
.crd-table-row:nth-child(5) { animation-delay: 0.20s; }

.crd-compact .crd-card:nth-child(5),
.crd-slider .crd-card:nth-child(5),
.crd-table-row:nth-child(6) { animation-delay: 0.25s; }

.crd-compact .crd-card:nth-child(6),
.crd-slider .crd-card:nth-child(6),
.crd-table-row:nth-child(7) { animation-delay: 0.30s; }

.crd-secondary-row .crd-card:nth-child(1) { animation-delay: 0.35s; }
.crd-secondary-row .crd-card:nth-child(2) { animation-delay: 0.40s; }
.crd-secondary-row .crd-card:nth-child(3) { animation-delay: 0.45s; }
.crd-secondary-row .crd-card:nth-child(4) { animation-delay: 0.50s; }


/* ==================================================================
 * RESPONSIVE
 * ================================================================== */

@media (max-width: 768px) {
	.crd-size-728x90 {
		width: 100% !important;
		min-height: auto;
		padding: 8px 10px;
		border-radius: 8px;
	}

	.crd-main-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.crd-table-head,
	.crd-table-row {
		grid-template-columns: 1.5fr 1fr 1fr;
		gap: 4px;
		padding: 8px 10px;
		font-size: 0.85rem;
	}

	.crd-slider .crd-card {
		min-width: 180px;
	}

	.crd-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.crd-ticker-item {
		gap: 4px;
		font-size: 0.76rem;
	}

	.crd-ticker-name  { font-size: 0.72rem; }
	.crd-ticker-price,
	.crd-ticker-var   { font-size: 0.78rem; }

	.crd-ticker-label {
		padding: 0 10px;
		font-size: 0.62rem;
	}
}

@media (max-width: 600px) {
	.crd-size-300x250 {
		width: 100% !important;
		height: auto;
		min-height: 300px;
	}

	.crd-size-300x250 .crd-main-card {
		margin: 0 8px 7px;
	}

	.crd-main-grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.crd-card.crd-secondary {
		flex: 1 1 100%;
		max-width: 100%;
	}

	.crd-table-head,
	.crd-table-row {
		grid-template-columns: 1fr 1fr;
	}

	.crd-th-var,
	.crd-td-var {
		display: none;
	}

	.crd-ticker::after {
		width: 20px;
	}

	.crd-ticker-track {
		gap: 20px;
		padding: 0 24px;
	}
}

@media (max-width: 400px) {
	.crd-card {
		padding: 10px 8px;
	}

	.crd-price {
		font-size: 1.15rem;
	}

	.crd-ticker-item {
		font-size: 0.72rem;
		gap: 4px;
	}

	.crd-ticker-name  { font-size: 0.66rem; }
	.crd-ticker-price,
	.crd-ticker-var   { font-size: 0.74rem; }

	.crd-secondary-toggle {
		padding: 6px 14px;
		font-size: 0.78rem;
	}
}

/* ===== Error / fallback message ===== */
.crd-error {
	padding: 12px 16px;
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 600;
}

.crd-dark .crd-error {
	background: #450a0a;
	color: #fecaca;
	border-color: #7f1d1d;
}

/* ===== Print ===== */
@media print {
	.crd-app {
		box-shadow: none !important;
		border: 1px solid #ccc !important;
		background: #fff !important;
		color: #000 !important;
	}

	.crd-card {
		box-shadow: none !important;
		break-inside: avoid;
	}

	.crd-ticker-mode {
		background: #fff !important;
		color: #000 !important;
	}
}
