/* Bytrix IPO GMP Tracker. Colors come from the Settings page via the --bx-* variables on .bxipo. */

.bxipo {
	--bx-primary: #0a8f63;
	--bx-dark: #064e3b;
	--bx-soft: #e8f6ef;
	--bx-text: #10201a;
	--bx-muted: #5c6c65;
	--bx-border: #dbe7e1;
	--bx-surface: #ffffff;
	--bx-pos: #0a8f63;
	--bx-neg: #d64545;
	--bx-warn: #d98e04;
	--bx-closed: #8a9a93;
	--bx-ease: cubic-bezier(.4, 0, .2, 1);
	position: relative;
	max-width: 1120px;
	margin: 0 auto;
	color: var(--bx-text);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
}
.bxipo *, .bxipo *::before, .bxipo *::after { box-sizing: border-box; }
.bxipo .bxipo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons: reset so theme and Elementor button styles never leak in */
.bxipo.bxipo button.bxipo-b {
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.bxipo.bxipo button.bxipo-b:focus-visible,
.bxipo .bxipo-search input:focus-visible,
.bxipo .bxipo-link:focus-visible { outline: 2px solid var(--bx-primary); outline-offset: 2px; }
.bxipo.bxipo button.bxipo-b:disabled { cursor: not-allowed; opacity: .4; }

/* ---------- Tabs ---------- */
.bxipo-top { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.bxipo-tabwrap { border-bottom: 1px solid var(--bx-border); }
.bxipo-tabs { position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bxipo-tabs::-webkit-scrollbar { display: none; }

.bxipo.bxipo button.bxipo-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 13px 16px;
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
	color: var(--bx-muted);
	transition: color .2s var(--bx-ease);
}
.bxipo.bxipo button.bxipo-tab:hover { color: var(--bx-dark); }
.bxipo.bxipo button.bxipo-tab[aria-selected="true"] { color: var(--bx-dark); }

.bxipo-count {
	min-width: 24px;
	padding: 1px 8px;
	border-radius: 99px;
	background: var(--bx-soft);
	color: var(--bx-dark);
	font-size: 12px;
	font-weight: 700;
	text-align: center;
	font-variant-numeric: tabular-nums;
	transition: background .25s var(--bx-ease), color .25s var(--bx-ease);
}
.bxipo-tab[aria-selected="true"] .bxipo-count { background: var(--bx-primary); color: #fff; }

.bxipo-ind {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 0;
	border-radius: 3px 3px 0 0;
	background: var(--bx-primary);
	pointer-events: none;
}
.bxipo.is-ready .bxipo-ind { transition: transform .38s var(--bx-ease), width .38s var(--bx-ease); }

/* ---------- Filters ---------- */
.bxipo-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.bxipo-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--bx-border); border-radius: 10px; background: var(--bx-surface); }
.bxipo.bxipo button.bxipo-sg {
	padding: 7px 14px;
	border-radius: 7px;
	font-size: 14px;
	font-weight: 600;
	color: var(--bx-muted);
	transition: background .2s var(--bx-ease), color .2s var(--bx-ease);
}
.bxipo.bxipo button.bxipo-sg:hover { color: var(--bx-dark); }
.bxipo.bxipo button.bxipo-sg[aria-pressed="true"] { background: var(--bx-soft); color: var(--bx-dark); }

.bxipo-search { flex: 1 1 220px; max-width: 320px; }
.bxipo .bxipo-search input {
	display: block;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--bx-border);
	border-radius: 10px;
	background: var(--bx-surface);
	color: var(--bx-text);
	font: inherit;
	font-size: 14px;
	box-shadow: none;
	transition: border-color .2s var(--bx-ease);
}
.bxipo .bxipo-search input:focus { border-color: var(--bx-primary); outline: none; }
.bxipo .bxipo-search input:focus-visible { outline: 2px solid var(--bx-primary); outline-offset: 1px; }

/* ---------- Panel swap ---------- */
.bxipo-panel { position: relative; }
.bxipo-body { transition: opacity .16s ease; }
.bxipo-panel.is-busy .bxipo-body { opacity: .35; pointer-events: none; }
.bxipo-body.is-in .bxipo-card { animation: bxipo-in .4s var(--bx-ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes bxipo-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.bxipo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; align-items: start; }

/* ---------- Card ---------- */
.bxipo-card {
	--st: var(--bx-warn);
	position: relative;
	padding: 18px 18px 14px 22px;
	border: 1px solid var(--bx-border);
	border-radius: 14px;
	background: var(--bx-surface);
	overflow: hidden;
	transition: border-color .2s var(--bx-ease), box-shadow .2s var(--bx-ease);
}
.bxipo-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: var(--st); }
.bxipo-card[data-s="open"] { --st: var(--bx-primary); }
.bxipo-card[data-s="closed"] { --st: var(--bx-closed); }
.bxipo-card[data-s="listed"] { --st: var(--bx-dark); }
.bxipo-card:hover, .bxipo-card.is-open { border-color: color-mix(in srgb, var(--st) 45%, var(--bx-border)); }
.bxipo-card.is-open { box-shadow: 0 8px 26px rgba(16, 32, 26, .08); }

/* Compact card summary: company on the left, prominent GMP on the right. */
.bxipo-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, 174px); align-items: center; gap: 12px; }
.bxipo-summary-gmp { min-width: 0; }
.bxipo-summary-gmp .bxipo-gmp { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; }
.bxipo-summary-gmp .bxipo-g1 { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.bxipo-summary-gmp .bxipo-gv { font-size: 25px; line-height: 1.1; }
.bxipo-summary-gmp .bxipo-gp { font-size: 14px; }
.bxipo-summary-gmp .bxipo-g2 { display: flex; flex-direction: row; align-items: baseline; gap: 5px; }
.bxipo-summary-gmp .bxipo-g2 .bxipo-gl { font-size: 10px; }
.bxipo-summary-gmp .bxipo-g2 strong { font-size: 13px; }
.bxipo-summary-gmp .bxipo-gu { font-size: 10px; line-height: 1.35; }

.bxipo-head { display: flex; align-items: center; gap: 12px; }
.bxipo-logo { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--bx-soft); display: flex; align-items: center; justify-content: center; }
.bxipo-logo img { width: 100%; height: 100%; object-fit: contain; display: block; margin: 0; }
.bxipo-logo.is-initials { color: var(--bx-dark); font-weight: 700; font-size: 15px; }
.bxipo-id { min-width: 0; }
.bxipo .bxipo-name {
	margin: 0 0 5px;
	padding: 0;
	color: var(--bx-text);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	overflow-wrap: anywhere;
}
.bxipo-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.bxipo-badge { padding: 2px 9px; border-radius: 99px; border: 1px solid var(--bx-border); color: var(--bx-muted); font-size: 12px; font-weight: 600; line-height: 1.5; }
.bxipo-badge.is-status { border-color: transparent; color: #fff; background: var(--st); }

.bxipo .bxipo-when { margin: 12px 0 10px; padding: 0; color: var(--bx-muted); font-size: 14px; font-weight: 600; }
.bxipo-card[data-s="open"] .bxipo-when { color: var(--bx-dark); }

/* GMP band: the number users come for */
.bxipo-gmp {
	--gc: var(--bx-muted);
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 6px 16px;
	padding: 12px 14px;
	border-radius: 10px;
	background: #f2f5f4;
	background: color-mix(in srgb, var(--bx-muted) 9%, var(--bx-surface));
}
.bxipo-gmp.is-up { --gc: var(--bx-pos); background: var(--bx-soft); background: color-mix(in srgb, var(--bx-pos) 11%, var(--bx-surface)); }
.bxipo-gmp.is-down { --gc: var(--bx-neg); background: #fdeeee; background: color-mix(in srgb, var(--bx-neg) 10%, var(--bx-surface)); }
.bxipo-g1, .bxipo-g2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.bxipo-g2 { flex-direction: column; align-items: flex-end; gap: 0; text-align: right; }
.bxipo-gl { color: var(--bx-muted); font-size: 12px; font-weight: 600; }
.bxipo-gv { color: var(--gc); font-size: 28px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bxipo-gp { color: var(--gc); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bxipo-g2 strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.bxipo-gu { flex: 1 0 100%; color: var(--bx-muted); font-size: 12px; }
.bxipo-gmp.is-none { align-items: center; justify-content: flex-start; gap: 10px; }
.bxipo-gn { color: var(--bx-muted); font-size: 14px; }

/* GMP forecast vs actual listing performance */
.bxipo-performance { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--bx-border); border-radius: 11px; background: var(--bx-surface); }
.bxipo-perf-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 8px; color: var(--bx-dark); font-size: 12px; font-weight: 800; }
.bxipo-perf-title span { color: var(--bx-muted); font-size: 10px; font-weight: 600; }
.bxipo-perf-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bxipo-perf-item { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bxipo-perf-item + .bxipo-perf-item { padding-left: 9px; border-left: 1px solid var(--bx-border); }
.bxipo-perf-item span { color: var(--bx-muted); font-size: 10px; line-height: 1.3; font-weight: 600; }
.bxipo-perf-item strong { color: var(--bx-text); font-size: 15px; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bxipo-perf-item em { color: var(--bx-muted); font-size: 11px; line-height: 1.3; font-style: normal; font-weight: 700; }
.bxipo-perf-item strong.is-up { color: var(--bx-pos); }
.bxipo-perf-item strong.is-down { color: var(--bx-neg); }
.bxipo-perf-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.bxipo-perf-overview > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border: 1px solid var(--bx-border); border-radius: 12px; background: var(--bx-surface); }
.bxipo-perf-overview span { color: var(--bx-muted); font-size: 12px; line-height: 1.35; }
.bxipo-perf-overview strong { color: var(--bx-dark); font-size: 19px; font-variant-numeric: tabular-nums; }
.bxipo-history-caption { padding: 14px 0 6px; color: var(--bx-muted); font-size: 12px; font-weight: 700; }
.bxipo-chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 4px; color: var(--bx-muted); font-size: 11px; }
.bxipo-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bxipo-chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--bx-pos); opacity: .6; }
.bxipo-chart-legend .is-line { width: 17px; height: 2px; border-radius: 0; background: var(--bx-primary); opacity: 1; }

/* Facts */
.bxipo .bxipo-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin: 14px 0 4px; padding: 0; }
.bxipo .bxipo-facts div { margin: 0; padding: 0; min-width: 0; }
.bxipo .bxipo-facts dt { margin: 0; padding: 0; color: var(--bx-muted); font-size: 12px; font-weight: 600; }
.bxipo .bxipo-facts dd { margin: 1px 0 0; padding: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.bxipo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--bx-border); }
.bxipo-foot:empty { display: none; }
.bxipo.bxipo button.bxipo-hbtn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 0; color: var(--bx-dark); font-size: 14px; font-weight: 700; }
.bxipo-hbtn svg { transition: transform .3s var(--bx-ease); }
.bxipo-hbtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.bxipo .bxipo-link { margin-left: auto; color: var(--bx-muted); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.bxipo .bxipo-link:hover { color: var(--bx-dark); }

/* History drawer: animates height with grid rows */
.bxipo-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s var(--bx-ease); }
.bxipo-card.is-open .bxipo-more { grid-template-rows: 1fr; }
.bxipo-more-in { min-height: 0; overflow: hidden; }

.bxipo-chart { min-height: 120px; transition: opacity .15s ease; }
.bxipo-chart.is-busy { opacity: .4; }
.bxipo-chart-scroll { max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; }
.bxipo-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.bxipo-bar { fill: var(--bx-pos); opacity: .42; }
.bxipo-bar.is-down { fill: var(--bx-neg); }
.bxipo-grid-l { stroke: var(--bx-border); stroke-width: 1; }
.bxipo-zero { stroke: var(--bx-muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
.bxipo-tick { fill: var(--bx-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.bxipo-line { fill: none; stroke: var(--bx-primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: bxipo-draw .9s var(--bx-ease) both; }
@keyframes bxipo-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.bxipo-area { animation: bxipo-fade .9s ease both; }
@keyframes bxipo-fade { from { opacity: 0; } to { opacity: 1; } }
.bxipo-s0 { stop-color: var(--bx-primary); stop-opacity: .28; }
.bxipo-s1 { stop-color: var(--bx-primary); stop-opacity: 0; }
.bxipo-dot { fill: var(--bx-surface); stroke: var(--bx-primary); stroke-width: 2; }
.bxipo-dot.is-last { fill: var(--bx-primary); }

.bxipo-hist { max-height: 220px; overflow: auto; margin: 6px 0 8px; border: 1px solid var(--bx-border); border-radius: 10px; }
.bxipo-hist:empty { display: none; }
.bxipo .bxipo-tbl { width: 100%; margin: 0; border: 0; border-collapse: collapse; font-size: 13px; }
.bxipo .bxipo-tbl th, .bxipo .bxipo-tbl td { padding: 8px 12px; border: 0; border-bottom: 1px solid var(--bx-border); text-align: left; background: none; font-variant-numeric: tabular-nums; }
.bxipo .bxipo-tbl th { position: sticky; top: 0; background: var(--bx-soft); color: var(--bx-dark); font-weight: 700; }
.bxipo .bxipo-tbl tr:last-child td { border-bottom: 0; }
.bxipo .bxipo-tbl td.is-up { color: var(--bx-pos); font-weight: 700; }
.bxipo .bxipo-tbl td.is-down { color: var(--bx-neg); font-weight: 700; }

/* ---------- Pager, empty, note ---------- */
.bxipo-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; }
.bxipo.bxipo button.bxipo-pg { min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid var(--bx-border); border-radius: 9px; font-size: 14px; font-weight: 600; transition: background .2s var(--bx-ease), color .2s var(--bx-ease), border-color .2s var(--bx-ease); }
.bxipo.bxipo button.bxipo-pg:hover:not(:disabled) { border-color: var(--bx-primary); color: var(--bx-dark); }
.bxipo.bxipo button.bxipo-pg.is-on { background: var(--bx-primary); border-color: var(--bx-primary); color: #fff; }
.bxipo-gap { color: var(--bx-muted); }

.bxipo .bxipo-empty { margin: 0; padding: 48px 20px; border: 1px dashed var(--bx-border); border-radius: 14px; color: var(--bx-muted); text-align: center; }
.bxipo .bxipo-note { margin: 22px 0 0; color: var(--bx-muted); font-size: 12.5px; line-height: 1.55; max-width: 80ch; }

.bxipo-skel { height: 300px; border-radius: 14px; background: linear-gradient(100deg, var(--bx-soft) 30%, var(--bx-surface) 50%, var(--bx-soft) 70%); background-size: 200% 100%; animation: bxipo-shimmer 1.2s linear infinite; }
@keyframes bxipo-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (max-width: 600px) {
	.bxipo-seg { width: 100%; }
	.bxipo-sg { flex: 1; }
	.bxipo-search { max-width: none; flex-basis: 100%; }
	.bxipo-card { padding: 12px 11px 10px 15px; border-radius: 12px; }
	.bxipo-summary { grid-template-columns: minmax(0, 1fr) minmax(105px, 118px); gap: 8px; }
	.bxipo-head { gap: 8px; align-items: flex-start; }
	.bxipo-logo { flex-basis: 36px; width: 36px; height: 36px; border-radius: 9px; }
	.bxipo .bxipo-name { margin-bottom: 4px; font-size: 14px; line-height: 1.25; }
	.bxipo-badges { gap: 4px; }
	.bxipo-badge { padding: 1px 6px; font-size: 10px; }
	.bxipo-summary-gmp .bxipo-gmp { padding: 8px; border-radius: 9px; gap: 3px; }
	.bxipo-summary-gmp .bxipo-gv { font-size: 21px; }
	.bxipo-summary-gmp .bxipo-gp { font-size: 12px; }
	.bxipo-summary-gmp .bxipo-g2 .bxipo-gl { font-size: 9px; }
	.bxipo-summary-gmp .bxipo-g2 strong { font-size: 12px; }
	.bxipo-summary-gmp .bxipo-gu { font-size: 9px; }
	.bxipo .bxipo-when { margin: 8px 0 7px; font-size: 12px; }
	.bxipo .bxipo-facts { gap: 7px 10px; margin: 10px 0 2px; }
	.bxipo .bxipo-facts dt { font-size: 10px; }
	.bxipo .bxipo-facts dd { font-size: 12px; }
	.bxipo-perf-title { align-items: flex-start; flex-direction: column; gap: 2px; }
	.bxipo-perf-item + .bxipo-perf-item { padding-left: 6px; }
	.bxipo-perf-item span { font-size: 9px; }
	.bxipo-perf-item strong { font-size: 13px; }
	.bxipo-perf-item em { font-size: 10px; }
	.bxipo-perf-overview { gap: 5px; }
	.bxipo-perf-overview > div { padding: 9px 8px; }
	.bxipo-perf-overview span { font-size: 10px; }
	.bxipo-perf-overview strong { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
	.bxipo *, .bxipo *::before, .bxipo *::after { animation: none !important; transition: none !important; }
}
