@font-face {
	font-family: 'Geist';
	src: url('../fonts/geist-sans-400.woff2') format('woff2');
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Geist';
	src: url('../fonts/geist-sans-500.woff2') format('woff2');
	font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Geist';
	src: url('../fonts/geist-sans-600.woff2') format('woff2');
	font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Geist';
	src: url('../fonts/geist-sans-700.woff2') format('woff2');
	font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Geist Mono';
	src: url('../fonts/geist-mono-400.woff2') format('woff2');
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Geist Mono';
	src: url('../fonts/geist-mono-500.woff2') format('woff2');
	font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Geist Mono';
	src: url('../fonts/geist-mono-600.woff2') format('woff2');
	font-weight: 600; font-style: normal; font-display: swap;
}

.vixts-container {
	--brand: #CD1316;
	--brand-tint: #FCEBEC;
	--ink: #1A1A1F;
	--text: #333333;
	--muted: #71717A;
	--faint: #9A9AA2;
	--bg: #F4F4F7;
	--card: #FFFFFF;
	--border: #E7E7EC;
	--border-2: #EFEFF3;
	--chip: #F6F6F9;
	--grid: #ECECEF;
	--grid-v: #F3F3F5;
	--axis-base: #D9D9E0;
	--pos: #1F9D57;
	--neg: #D23B34;
	--badge-bg: #E6F5EC;
	--badge-fg: #1C7A44;
	--font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	--r-card: 14px;
	--r-ctrl: 8px;
	--r-pill: 999px;
	--gap: 16px;
	--pad: 18px;
	--edge: 24px;

	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	max-width: 1360px;
	margin-left: auto;
	margin-right: auto;
	padding: var(--pad) var(--edge);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	background: var(--card);
	font-family: var(--font-sans);
	color: var(--text);
}
.vixts-container,
.vixts-container *,
.vixts-container *::before,
.vixts-container *::after { box-sizing: border-box; }
.vixts-container button,
.vixts-container select,
.vixts-container input { font-family: inherit; }
.vixts-container .vixts-mono,
.vixts-container .vixts-date,
.vixts-container .vixts-hist-table,
.vixts-container .vixts-table,
.vixts-container .vixts-rolling,
.vixts-container .vixts-contango-summary,
.vixts-container .vixts-footer {
	font-family: var(--font-mono);
	font-feature-settings: "tnum" 1;
}
.vixts-container[aria-busy="true"] {
	cursor: progress;
}

.vixts-container.vixts-busy .vixts-canvas-wrap canvas {
	opacity: 0.55;
	transition: opacity 0.15s ease-out;
}
.vixts-container .vixts-canvas-wrap canvas {
	transition: opacity 0.15s ease-out;
}
.vixts-busy-pill {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(21, 101, 192, 0.95);
	color: #fff;
	padding: 8px 16px;
	border-radius: 4px;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.2px;
	z-index: 3;
	pointer-events: none;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	display: none;
}
.vixts-container.vixts-busy .vixts-busy-pill {
	display: block;
}

.vixts-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.vixts-container .vixts-btn:focus-visible,
.vixts-container .vixts-date:focus-visible,
.vixts-container .vixts-underlying:focus-visible,
.vixts-container .vixts-field-chip input[type="checkbox"]:focus-visible {
	outline: 2px solid #2196f3;
	outline-offset: 2px;
}
.vixts-field-chip:focus-within {
	box-shadow: 0 0 0 2px #2196f3;
}
.vixts-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}
.vixts-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
}

.vixts-container .vixts-help-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 1px solid #c4c9d0;
	border-radius: 50%;
	background: #fff;
	color: #555;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.vixts-container .vixts-help-btn:hover,
.vixts-container .vixts-help-btn:focus-visible {
	background: #eef2f6;
	color: #1565c0;
	border-color: #b6d4f0;
}
.vixts-container .vixts-help-btn:focus-visible {
	outline: 2px solid #2196f3;
	outline-offset: 2px;
}

.vixts-help-modal[hidden] {
	display: none !important;
}
.vixts-help-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.vixts-help-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 28, 40, 0.55);
	cursor: pointer;
}
.vixts-help-panel {
	position: relative;
	max-width: 620px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	color: #1c1c1c;
	border-radius: 8px;
	padding: 20px 28px 24px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	font-size: 0.95rem;
	line-height: 1.5;
}
.vixts-help-panel h2 {
	margin: 0 0 12px;
	font-size: 1.25rem;
	color: #1a3a6c;
	padding-right: 32px;
}
.vixts-help-panel h3 {
	margin: 18px 0 6px;
	font-size: 1rem;
	color: #1a3a6c;
	border-bottom: 1px solid #e3e6ea;
	padding-bottom: 4px;
}
.vixts-help-panel p,
.vixts-help-panel ul,
.vixts-help-panel dl {
	margin: 6px 0 8px;
}
.vixts-help-panel ul {
	padding-left: 22px;
}
.vixts-help-panel li {
	margin: 2px 0;
}
.vixts-help-dl dt {
	font-weight: 600;
	margin-top: 6px;
	color: #1565c0;
}
.vixts-help-dl dd {
	margin: 0 0 4px 0;
	padding-left: 12px;
}
.vixts-help-close {
	position: absolute;
	top: 8px;
	right: 8px;
	border: 0;
	background: transparent;
	color: #555;
	font-size: 1.6rem;
	line-height: 1;
	padding: 4px 8px;
	cursor: pointer;
	border-radius: 4px;
}
.vixts-help-close:hover,
.vixts-help-close:focus-visible {
	background: #eef2f6;
	color: #b71c1c;
}
.vixts-help-close:focus-visible {
	outline: 2px solid #2196f3;
	outline-offset: 1px;
}

body.vixts-help-open {
	overflow: hidden;
}
.vixts-notice {
	background: #fff8e1;
	border: 1px solid #ffe082;
	color: #6d4c00;
	padding: 6px 10px;
	border-radius: 4px;
	font-size: 0.85rem;
}
.vixts-notice[hidden] {
	display: none !important;
}
.vixts-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.78);
	color: #333;
	font-size: 0.95rem;
	font-weight: 500;
	pointer-events: none;
	z-index: 2;
	padding: 12px;
	text-align: center;
	border-radius: 4px;
}
.vixts-overlay[hidden] {
	display: none !important;
}
.vixts-overlay.vixts-error {
	color: #b71c1c;
	background: rgba(255, 235, 238, 0.92);
	pointer-events: auto;
}
.vixts-controls-nav {
	padding-bottom: 0;
}
.vixts-compare-label {
	color: #555;
	margin-right: 2px;
}
.vixts-compare-chips {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
}
.vixts-compare-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 4px 2px 8px;
	border: 1px solid #c4c9d0;
	border-radius: 999px;
	background: #fff;
	color: #333;
	font-size: 0.85rem;
	user-select: none;
	cursor: pointer;
	transition: background 120ms ease, color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.vixts-compare-chip:hover {
	background: #f5f7fa;
}
.vixts-compare-chip:focus-visible {
	outline: 2px solid #2196f3;
	outline-offset: 1px;
}
.vixts-compare-chip.is-disabled {
	background: #f1f3f5;
	border-color: #d8dde2;
	color: #8a8f96;
	opacity: 0.65;
}
.vixts-compare-chip-date {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
}
.vixts-compare-chip-swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 2px;
}
.vixts-compare-chip-remove {
	border: 0;
	background: transparent;
	color: #777;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	padding: 0 4px;
	border-radius: 50%;
}
.vixts-compare-chip-remove:hover {
	background: #eef2f6;
	color: #b71c1c;
}
.vixts-container .vixts-btn-link {
	background: transparent !important;
	border: 0 !important;
	color: #2196f3 !important;
	padding: 4px 4px !important;
	font-size: 0.85rem !important;
	text-decoration: underline;
}
.vixts-container .vixts-btn-link:hover {
	color: #1565c0 !important;
	background: transparent !important;
}

.vixts-snapshot {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.vixts-container .vixts-btn-snapshot {
	background: var(--chip);
	border-color: var(--border);
	color: var(--text);
	font-weight: 500;
	white-space: nowrap;
}
.vixts-container .vixts-btn-snapshot:hover {
	background: var(--brand-tint);
	border-color: var(--brand);
	color: var(--brand);
}

.vixts-toast {
	position: absolute;
	right: 14px;
	bottom: 14px;
	left: auto;
	transform: translateY(8px);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--ink);
	color: #fff;
	font-family: var(--font-sans);
	font-size: 0.8rem;
	padding: 8px 14px;
	border-radius: var(--r-ctrl);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
	opacity: 0;
	pointer-events: none;
	transition: opacity 160ms ease, transform 160ms ease;
	z-index: 20;
}
.vixts-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.vixts-toast.is-error {
	background: var(--neg);
}
.vixts-toast-spinner {
	width: 12px;
	height: 12px;
	flex: none;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: vixts-toast-spin 0.8s linear infinite;
}
@keyframes vixts-toast-spin {
	to { transform: rotate(360deg); }
}
.vixts-field-chip.is-suppressed {
	opacity: 0.35;
	cursor: not-allowed;
}
.vixts-field-chip.is-suppressed input[type="checkbox"] {
	pointer-events: none;
}

.vixts-xaxis-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--text);
	font-size: 0.85rem;
}
.vixts-xaxis-legend {
	color: var(--muted);
}
.vixts-xaxis-select {
	border: 1px solid var(--border);
	border-radius: var(--r-ctrl);
	padding: 5px 8px;
	background: var(--card);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 0.8rem;
	cursor: pointer;
	min-width: 210px;
}
.vixts-xaxis-select:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 1px;
}
.vixts-date-nav {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: nowrap;
}
.vixts-underlying-label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #555;
	font-size: 0.85rem;
	margin-right: 8px;
}
.vixts-underlying {
	border: 1px solid #c4c9d0;
	border-radius: 4px;
	padding: 4px 6px;
	background: #fff;
	color: #333;
	font-size: 0.9rem;
	max-width: 240px;
}
.vixts-controls .vixts-date {
	border: 1px solid #c4c9d0;
	border-radius: 4px;
	padding: 4px 6px;
	background: #fff;
	color: #333;
	font-size: 0.9rem;
}
.vixts-field-chip input[type="checkbox"] {
	margin: 0;
}
.vixts-field-swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
	background: #888;
}
.vixts-canvas-wrap {
	position: relative;
	height: var(--vixts-height, 520px);
	width: 100%;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	padding: var(--pad);
}
.vixts-chart-menu {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	display: flex;
	gap: 4px;
}
.vixts-icon-btn {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border);
	border-radius: var(--r-ctrl);
	background: var(--card);
	color: var(--muted);
	cursor: pointer;
	font-size: 0.9rem;
}
.vixts-icon-btn:hover {
	background: var(--chip);
	color: var(--ink);
}
.vixts-rolling {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8rem;
	margin-top: 6px;
	table-layout: fixed;
}
.vixts-rolling[hidden] { display: none !important; }
.vixts-rolling th,
.vixts-rolling td {
	padding: 6px 4px;
	border-bottom: 1px solid var(--border);
	text-align: center;
}
.vixts-rolling th[scope="row"] {
	background: transparent;
	color: var(--muted);
	font-weight: 600;
	font-family: var(--font-sans);
	width: 88px;
	text-align: left;
}
.vixts-rolling td + td { border-left: 1px solid var(--border-2); }
.vixts-rolling .vixts-roll-pair {
	font-size: 0.72rem;
	color: var(--faint);
	font-weight: 400;
}
.vixts-rolling .vixts-contango { color: var(--pos); }
.vixts-rolling .vixts-backward { color: var(--neg); }

.vixts-contango-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: var(--gap);
	padding: var(--pad);
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	font-size: 0.82rem;
}
.vixts-contango-summary[hidden] { display: none !important; }
.vixts-contango-legend {
	font-family: var(--font-sans);
	font-weight: 600;
	color: var(--muted);
}
.vixts-contango-sel {
	border: 1px solid var(--border);
	border-radius: var(--r-ctrl);
	padding: 4px 8px;
	background: var(--card);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 0.82rem;
	cursor: pointer;
	max-width: 150px;
}
.vixts-contango-arrow { color: var(--faint); }
.vixts-contango-result {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-left: 4px;
}
.vixts-contango-span { color: var(--muted); }
.vixts-contango-result .vixts-contango { color: var(--pos); font-weight: 600; }
.vixts-contango-result .vixts-backward { color: var(--neg); font-weight: 600; }
.vixts-contango-tag {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 3px 10px;
	border-radius: var(--r-pill);
	font-family: var(--font-sans);
}
.vixts-contango-tag.vixts-contango { background: var(--badge-bg); color: var(--badge-fg); }
.vixts-contango-tag.vixts-backward { background: #FDECEA; color: var(--neg); }
.vixts-contango-na { color: var(--faint); }

.vixts-tabs {
	display: flex;
	gap: 20px;
	margin-top: var(--gap);
	border-bottom: 1px solid var(--border);
}
.vixts-container .vixts-tab {
	background: none !important;
	border: 0 !important;
	border-bottom: 2px solid transparent !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	margin: 0 0 -1px 0;
	padding: 8px 2px;
	font-family: var(--font-sans);
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--faint);
	cursor: pointer;
}
.vixts-container .vixts-tab:hover { color: var(--ink); }
.vixts-container .vixts-tab.is-active {
	color: var(--ink);
	font-weight: 700;
	border-bottom: 2px solid var(--brand) !important;
}
.vixts-tabpanel[hidden] { display: none !important; }

.vixts-hist-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 10px 0 8px;
}
.vixts-hist-caption { font-size: 0.8rem; color: var(--muted); }
.vixts-hist-scroll {
	max-height: 360px;
	overflow: auto;
	border: 1px solid var(--border);
	border-radius: var(--r-card);
}
.vixts-hist-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.78rem;
}
.vixts-hist-table th,
.vixts-hist-table td {
	padding: 6px 10px;
	text-align: right;
	white-space: nowrap;
	border-bottom: 1px solid var(--border-2);
}
.vixts-hist-table thead th {
	position: sticky; top: 0;
	background: var(--chip);
	color: var(--faint);
	font-weight: 700;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	z-index: 1;
}
.vixts-hist-table thead th:first-child,
.vixts-hist-table tbody th {
	position: sticky; left: 0;
	background: var(--card);
	text-align: left;
	color: var(--ink);
	font-weight: 600;
}
.vixts-hist-table thead th:first-child { z-index: 2; }
.vixts-hist-table tbody tr:nth-child(even) td { background: #FAFAFC; }
.vixts-hist-na { color: var(--border); }
.vixts-hist-status { font-size: 0.8rem; color: var(--muted); padding: 6px 2px; }

.vixts-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	margin-top: var(--gap);
}
.vixts-table th,
.vixts-table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--border);
	text-align: left;
}
.vixts-table th {
	background: transparent;
	color: var(--faint);
	font-weight: 700;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	font-family: var(--font-sans);
}
.vixts-table tbody tr:nth-child(even) td { background: #FAFAFC; }
.vixts-disclaimer {
	font-size: 0.7rem;
	color: #666;
	background: #f6f7f7;
	padding: 6px 10px;
	margin: 6px 0 0 0;
	border-left: 3px solid #c4c9d0;
	line-height: 1.4;
}
.vixts-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.vixts-title-group {
	display: flex;
	align-items: center;
	gap: 8px;
}
.vixts-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--ink);
	letter-spacing: -0.2px;
}
.vixts-live-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.78rem;
	color: var(--muted);
	background: var(--chip);
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	padding: 6px 12px;
	white-space: nowrap;
	font-family: var(--font-sans);
}
.vixts-live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--pos);
	flex: none;
}
.vixts-live-pill-time {
	font-family: var(--font-mono);
	color: var(--faint);
}
.vixts-footer {
	font-size: 0.75rem;
	color: var(--faint);
	text-align: right;
	cursor: help;
}
.vixts-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	font-size: 0.85rem;
}
.vixts-controls-date {
	gap: 10px;
}
.vixts-toolbar-spacer {
	flex: 1 1 auto;
}
.vixts-container .vixts-btn {
	height: 30px;
	border: 1px solid var(--border);
	border-radius: var(--r-ctrl);
	background: var(--card);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 0.8rem;
	font-weight: 500;
	padding: 0 12px;
	cursor: pointer;
}
.vixts-container .vixts-btn:hover {
	background: var(--chip);
}
.vixts-container .vixts-btn-compare {
	/* OFF: neutral, so the ON (solid red) state is unmistakable. */
	background: #fff;
	border-color: #c4c9d0;
	color: #333;
	font-weight: 600;
	position: relative;
	padding-left: 26px;
}
.vixts-container .vixts-btn-compare::before {
	content: "";
	position: absolute;
	left: 10px;
	top: 50%;
	width: 9px;
	height: 9px;
	margin-top: -4.5px;
	border-radius: 50%;
	background: #c4c9d0;
	transition: background 120ms ease, box-shadow 120ms ease;
}
.vixts-container .vixts-btn-compare:hover {
	border-color: var(--brand);
	color: var(--brand);
}
.vixts-container .vixts-btn-compare.is-active {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
	box-shadow: 0 0 0 3px var(--brand-tint);
}
.vixts-container .vixts-btn-compare.is-active:hover {
	color: #fff;
}
.vixts-container .vixts-btn-compare.is-active::before {
	background: #fff;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
.vixts-series-drawer-wrap {
	position: relative;
}
.vixts-series-drawer {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 10;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	padding: var(--pad);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	min-width: 260px;
}
.vixts-series-drawer[hidden] {
	display: none !important;
}
.vixts-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	border: 0;
	padding: 0;
	margin: 0;
}
.vixts-fields-legend {
	width: 100%;
	color: var(--faint);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	margin: 0 0 4px;
	padding: 0;
}
.vixts-field-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 28px;
	padding: 0 12px 0 8px;
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	background: var(--card);
	font-family: var(--font-sans);
	font-size: 0.78rem;
	color: var(--muted);
	cursor: pointer;
}
.vixts-field-chip:has(input:checked) {
	border-color: var(--brand);
	background: var(--brand-tint);
	color: var(--ink);
	font-weight: 600;
}
.vixts-controls-compare {
	background: var(--chip);
	border-radius: var(--r-ctrl);
	padding: 8px 12px;
}
.vixts-controls-compare[hidden] {
	display: none !important;
}

/* --- refinement pass: series pills, x-axis nowrap, softer/rounder tables --- */
.vixts-controls-fields { gap: 9px; }
.vixts-fields {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 9px;
	border: 0;
	padding: 0;
	margin: 0;
}
.vixts-fields-legend {
	width: auto;
	margin: 0 4px 0 0;
	padding: 0;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--faint);
}
.vixts-field-chip {
	height: 30px;
	padding: 0 14px;
	gap: 8px;
	border-radius: var(--r-pill);
}
.vixts-field-swatch {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	opacity: 0.45;
}
.vixts-field-chip:has(input:checked) .vixts-field-swatch { opacity: 1; }

.vixts-xaxis-label { flex: 0 0 auto; white-space: nowrap; }
.vixts-xaxis-legend { white-space: nowrap; }

.vixts-canvas-wrap { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }

.vixts-rolling {
	border-collapse: separate;
	border-spacing: 0;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	overflow: hidden;
}
.vixts-rolling th,
.vixts-rolling td { border-bottom: 1px solid var(--border-2); }
.vixts-rolling tr:last-child th,
.vixts-rolling tr:last-child td { border-bottom: 0; }
.vixts-rolling td + td { border-left: 0; }

.vixts-table {
	border-collapse: separate;
	border-spacing: 0;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	overflow: hidden;
}
.vixts-table th,
.vixts-table td { border-bottom: 0; }
.vixts-table thead th { border-bottom: 1px solid var(--border); }

.vixts-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vixts-brand-link { color: var(--brand); font-weight: 600; text-decoration: none; white-space: nowrap; }
.vixts-brand-link:hover { text-decoration: underline; }

/* --- Mobile-only elements: hidden on desktop so >640px stays untouched --- */
.vixts-container .vixts-more-btn { display: none; }
.vixts-container .vixts-acc-toggle { display: none; }

/* ============================================================
   Mobile layout (max-width: 640px). Chart-first: stacked header
   and controls, bottom legend, collapsed accordions, card-style
   Current table. Desktop above this width is intentionally
   untouched — every rule here lives inside the media query.
   ============================================================ */
@media (max-width: 640px) {
	.vixts-container {
		--pad: 14px;
		--edge: 14px;
		--gap: 12px;
	}

	/* Header: title line, then full-width live pill */
	.vixts-header {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}
	.vixts-live-pill {
		align-self: stretch;
		justify-content: flex-start;
		font-size: 0.72rem;
		padding: 5px 10px;
	}

	/* Touch targets */
	.vixts-container .vixts-btn {
		height: 40px;
		font-size: 0.85rem;
	}

	/* Toolbar: underlying flexes beside the "..." button; x-axis + Copy/PNG
	   fold into the "..." disclosure (vixts-more-open on the container). */
	.vixts-controls-nav { align-items: stretch; }
	.vixts-underlying-label {
		flex: 1 1 auto;
		margin-right: 0;
		min-width: 0;
	}
	.vixts-underlying {
		flex: 1 1 auto;
		width: 100%;
		max-width: none;
		min-width: 0;
		height: 40px;
	}
	.vixts-container .vixts-more-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		flex: 0 0 auto;
		font-size: 1.15rem;
		line-height: 1;
	}
	.vixts-toolbar-spacer { display: none; }
	.vixts-xaxis-label,
	.vixts-snapshot { display: none; }
	.vixts-container.vixts-more-open .vixts-xaxis-label {
		display: flex;
		width: 100%;
		order: 5;
	}
	.vixts-container.vixts-more-open .vixts-xaxis-select {
		flex: 1 1 auto;
		min-width: 0;
		height: 40px;
	}
	.vixts-container.vixts-more-open .vixts-snapshot {
		display: flex;
		width: 100%;
		order: 6;
		gap: 8px;
	}
	.vixts-container.vixts-more-open .vixts-btn-snapshot { flex: 1 1 0; }

	/* Date row full width; Compare gets its own full-width row */
	.vixts-date-nav {
		display: flex;
		width: 100%;
	}
	.vixts-controls .vixts-date {
		flex: 1 1 auto;
		min-width: 0;
		height: 40px;
	}
	.vixts-container .vixts-btn-compare {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 100%;
	}

	/* Price-series pills: 2-per-row grid */
	.vixts-fields {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
	.vixts-fields-legend {
		grid-column: 1 / -1;
		margin: 0;
	}
	.vixts-field-chip {
		height: 40px;
		width: 100%;
		justify-content: flex-start;
		padding: 0 12px;
		font-size: 0.82rem;
	}

	/* Chart: bottom legend is set by JS; cap height for phone viewports */
	.vixts-canvas-wrap {
		height: min(var(--vixts-height, 520px), 430px);
		padding: 10px;
	}

	/* Accordion toggle rows */
	.vixts-container .vixts-acc-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		min-height: 44px;
		padding: 0 14px;
		background: var(--card);
		border: 1px solid var(--border);
		border-radius: var(--r-card);
		font-family: var(--font-sans);
		font-size: 0.85rem;
		font-weight: 600;
		color: var(--ink);
		cursor: pointer;
	}
	.vixts-container .vixts-acc-toggle::after {
		content: "\25BE";
		color: var(--faint);
		transition: transform 120ms ease;
	}
	.vixts-container .vixts-acc-toggle[aria-expanded="true"]::after {
		transform: rotate(180deg);
	}
	/* Hide a toggle while its section has no data yet */
	.vixts-container:not(:has(.vixts-rolling:not([hidden]))) .vixts-acc-toggle[data-acc="roll"] { display: none; }
	.vixts-container:not(:has(.vixts-contango-summary:not([hidden]))) .vixts-acc-toggle[data-acc="contango"] { display: none; }
	.vixts-container:not(:has(.vixts-table:not([hidden]))) .vixts-acc-toggle[data-acc="data"] { display: none; }

	/* Sections collapsed by default; container class opens each one */
	.vixts-rolling { display: none; }
	.vixts-container.vixts-acc-open-roll .vixts-rolling:not([hidden]) {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.vixts-container.vixts-acc-open-roll .vixts-rolling th,
	.vixts-container.vixts-acc-open-roll .vixts-rolling td {
		white-space: nowrap;
		padding: 6px 10px;
	}
	.vixts-contango-summary { display: none; }
	.vixts-container.vixts-acc-open-contango .vixts-contango-summary:not([hidden]) {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		margin-top: 0;
	}
	.vixts-contango-sel {
		max-width: none;
		width: 100%;
		height: 40px;
	}
	.vixts-contango-arrow { display: none; }
	.vixts-contango-result { margin-left: 0; }

	.vixts-tabs { display: none; }
	.vixts-tabpanel { display: none; }
	.vixts-container.vixts-acc-open-data .vixts-tabs {
		display: flex;
		margin-top: 0;
	}
	.vixts-container.vixts-acc-open-data .vixts-tabpanel:not([hidden]) { display: block; }

	/* Current table -> stacked cards (labels come from td[data-label]) */
	.vixts-table:not([hidden]) {
		display: block;
		border: 0;
		background: transparent;
		overflow: visible;
	}
	.vixts-table thead { display: none; }
	.vixts-table tbody { display: block; }
	.vixts-table tr {
		display: block;
		background: var(--card);
		border: 1px solid var(--border);
		border-radius: var(--r-card);
		padding: 6px 12px;
		margin-bottom: 8px;
	}
	.vixts-table td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
		padding: 5px 0;
		border: 0;
		text-align: right;
	}
	.vixts-table td::before {
		content: attr(data-label);
		color: var(--muted);
		font-family: var(--font-sans);
		font-weight: 500;
		text-align: left;
	}
	.vixts-table td[data-label="#"] { display: none; }

	/* Historical keeps its scroll container; toolbar may wrap */
	.vixts-hist-toolbar { flex-wrap: wrap; }

	/* Compare chips & footer */
	.vixts-controls-compare { padding: 8px 10px; }
	.vixts-footer {
		flex-wrap: wrap;
		text-align: left;
	}
}

@media (max-width: 380px) {
	.vixts-container {
		--pad: 10px;
		--edge: 10px;
	}
	.vixts-container .vixts-btn {
		font-size: 0.8rem;
		padding: 0 10px;
	}
	.vixts-live-pill { font-size: 0.68rem; }
}
