/* ==========================================================================
   TB Chest Counter — front-end styles
   Scoped under .tbcc so themes stay untouched.
   ========================================================================== */

.tbcc {
	--tbcc-accent: #d4a02a;
	--tbcc-bg: #ffffff;
	--tbcc-bg-alt: #f6f7f9;
	--tbcc-bg-soft: #fbfbfc;
	--tbcc-border: #e4e7ec;
	--tbcc-border-soft: #eef0f4;
	--tbcc-text: #1b1f2a;
	--tbcc-muted: #6a7382;
	--tbcc-ok: #16a34a;
	--tbcc-ok-bg: rgba(22, 163, 74, 0.12);
	--tbcc-bad: #dc2626;
	--tbcc-bad-bg: rgba(220, 38, 38, 0.12);
	--tbcc-info: #2563eb;
	--tbcc-warn: #b45309;
	--tbcc-warn-bg: rgba(217, 119, 6, 0.14);
	--tbcc-radius: 14px;
	--tbcc-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);

	box-sizing: border-box;
	color: var(--tbcc-text);
	font-size: 15px;
	line-height: 1.45;
	margin: 0 0 1.75em;
}

.tbcc *,
.tbcc *::before,
.tbcc *::after {
	box-sizing: border-box;
}

/* Our own display rules would otherwise beat the UA [hidden] rule. */
.tbcc [hidden] {
	display: none !important;
}

/*
 * Theme defence.
 *
 * An explicit rule on an element (a theme's `h4 { color: … }`) always beats a
 * colour inherited from an ancestor, no matter how specific that ancestor
 * selector is — so headings inside the widget must state their own colour or
 * they vanish into the card on themes with light heading text.
 */
.tbcc h2,
.tbcc h3,
.tbcc h4,
.tbcc h5 {
	background: none;
	border: 0;
	color: var(--tbcc-text);
	float: none;
	font-family: inherit;
	letter-spacing: normal;
	opacity: 1;
	text-align: left;
	text-transform: none;
	visibility: visible;
	width: auto;
}

.tbcc h2::before,
.tbcc h3::before,
.tbcc h4::before,
.tbcc h5::before,
.tbcc h2::after,
.tbcc h3::after,
.tbcc h4::after,
.tbcc h5::after {
	content: none;
}

.tbcc p,
.tbcc ul,
.tbcc ol,
.tbcc li,
.tbcc table,
.tbcc figure {
	color: inherit;
	font-family: inherit;
}

.tbcc ul,
.tbcc ol {
	list-style: none;
}

.tbcc li::before,
.tbcc li::marker {
	content: none;
}

.tbcc svg {
	max-width: 100%;
}

.tbcc a {
	box-shadow: none;
	text-decoration: none;
}

/* Themes do not always ship .screen-reader-text, so scope our own. */
.tbcc .screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute !important;
	white-space: nowrap;
	width: 1px;
}

.tbcc[data-theme="dark"],
.tbcc [data-theme="dark"] {
	--tbcc-bg: #141821;
	--tbcc-bg-alt: #1b2029;
	--tbcc-bg-soft: #191e27;
	--tbcc-border: #2a313d;
	--tbcc-border-soft: #232a34;
	--tbcc-text: #e8ecf3;
	--tbcc-muted: #98a2b3;
	--tbcc-ok-bg: rgba(34, 197, 94, 0.18);
	--tbcc-bad-bg: rgba(248, 113, 113, 0.18);
	--tbcc-warn-bg: rgba(251, 191, 36, 0.16);
	--tbcc-ok: #4ade80;
	--tbcc-bad: #f87171;
	--tbcc-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
	.tbcc[data-theme="auto"] {
		--tbcc-bg: #141821;
		--tbcc-bg-alt: #1b2029;
		--tbcc-bg-soft: #191e27;
		--tbcc-border: #2a313d;
		--tbcc-border-soft: #232a34;
		--tbcc-text: #e8ecf3;
		--tbcc-muted: #98a2b3;
		--tbcc-ok-bg: rgba(34, 197, 94, 0.18);
		--tbcc-bad-bg: rgba(248, 113, 113, 0.18);
		--tbcc-warn-bg: rgba(251, 191, 36, 0.16);
		--tbcc-ok: #4ade80;
		--tbcc-bad: #f87171;
		--tbcc-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
	}
}

/* Card shell ------------------------------------------------------------- */

.tbcc-widget {
	background: var(--tbcc-bg);
	border: 1px solid var(--tbcc-border);
	border-radius: var(--tbcc-radius);
	box-shadow: var(--tbcc-shadow);
	overflow: hidden;
	position: relative;
}

.tbcc-widget::before {
	background: linear-gradient(90deg, var(--tbcc-accent), transparent 65%);
	content: "";
	height: 3px;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
}

/* Header ----------------------------------------------------------------- */

.tbcc-head {
	align-items: flex-start;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	padding: 20px 20px 12px;
}

.tbcc-eyebrow {
	color: var(--tbcc-accent);
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.09em;
	margin-bottom: 4px;
	text-transform: uppercase;
}

.tbcc .tbcc-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
	padding: 0;
}

.tbcc .tbcc-sub {
	color: var(--tbcc-muted);
	font-size: 13px;
	margin: 4px 0 0;
	padding: 0;
}

.tbcc-stamp {
	background: var(--tbcc-bg-alt);
	border: 1px solid var(--tbcc-border-soft);
	border-radius: 999px;
	color: var(--tbcc-muted);
	display: inline-block;
	font-size: 12px;
	padding: 4px 11px;
	white-space: nowrap;
}

/* Stat cards ------------------------------------------------------------- */

.tbcc-stats {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	padding: 8px 20px 4px;
}

.tbcc-stat {
	background: var(--tbcc-bg-alt);
	border: 1px solid var(--tbcc-border-soft);
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
}

.tbcc-stat--accent {
	background: color-mix(in srgb, var(--tbcc-accent) 12%, var(--tbcc-bg-alt));
	border-color: color-mix(in srgb, var(--tbcc-accent) 35%, var(--tbcc-border-soft));
}

.tbcc-stat--ok {
	background: var(--tbcc-ok-bg);
}

/*
 * Coloured stat cards, matching the dashboard's KPI tiles so every view in
 * the plugin reads as one set.
 */
.tbcc-stat--green,
.tbcc-stat--blue,
.tbcc-stat--purple,
.tbcc-stat--amber,
.tbcc-stat--red,
.tbcc-stat--teal {
	border: 0;
	color: #fff;
}

.tbcc-stat--green .tbcc-stat__label,
.tbcc-stat--blue .tbcc-stat__label,
.tbcc-stat--purple .tbcc-stat__label,
.tbcc-stat--amber .tbcc-stat__label,
.tbcc-stat--red .tbcc-stat__label,
.tbcc-stat--teal .tbcc-stat__label,
.tbcc-stat--green .tbcc-stat__hint,
.tbcc-stat--blue .tbcc-stat__hint,
.tbcc-stat--purple .tbcc-stat__hint,
.tbcc-stat--amber .tbcc-stat__hint,
.tbcc-stat--red .tbcc-stat__hint,
.tbcc-stat--teal .tbcc-stat__hint {
	color: rgba(255, 255, 255, 0.88);
}

.tbcc-stat--green  { background: linear-gradient(135deg, #22bd79, #179961); }
.tbcc-stat--blue   { background: linear-gradient(135deg, #4b8bf5, #2f6ddb); }
.tbcc-stat--purple { background: linear-gradient(135deg, #8b5cf6, #6d3fe0); }
.tbcc-stat--amber  { background: linear-gradient(135deg, #f0ad3e, #d68a19); }
.tbcc-stat--red    { background: linear-gradient(135deg, #ef6259, #d8433a); }
.tbcc-stat--teal   { background: linear-gradient(135deg, #2fb8c6, #1d94a3); }

.tbcc-stat__label {
	color: var(--tbcc-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.tbcc-stat__value {
	font-size: 21px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.15;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tbcc-stat__hint {
	color: var(--tbcc-muted);
	font-size: 12px;
}

/* Toolbar ---------------------------------------------------------------- */

.tbcc-toolbar {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 14px 20px;
}

.tbcc-field {
	align-items: center;
	background: var(--tbcc-bg-alt);
	border: 1px solid var(--tbcc-border);
	border-radius: 9px;
	display: inline-flex;
	gap: 8px;
	padding: 0 10px;
}

.tbcc-field--search {
	flex: 1 1 200px;
	max-width: 320px;
}

.tbcc-field__label {
	color: var(--tbcc-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.tbcc .tbcc-input,
.tbcc .tbcc-select {
	appearance: none;
	background: transparent;
	border: 0;
	box-shadow: none;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	margin: 0;
	min-height: 36px;
	outline: 0;
	padding: 0;
	width: 100%;
}

.tbcc .tbcc-select {
	cursor: pointer;
	padding-right: 4px;
}

.tbcc-icon {
	fill: currentColor;
	flex: none;
	height: 16px;
	opacity: 0.6;
	width: 16px;
}

.tbcc .tbcc-btn {
	align-items: center;
	background: var(--tbcc-bg-alt);
	border: 1px solid var(--tbcc-border);
	border-radius: 9px;
	color: var(--tbcc-text);
	cursor: pointer;
	display: inline-flex;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	gap: 6px;
	line-height: 1;
	min-height: 38px;
	padding: 0 14px;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.tbcc .tbcc-btn:hover:not(:disabled) {
	background: color-mix(in srgb, var(--tbcc-accent) 14%, var(--tbcc-bg-alt));
	border-color: var(--tbcc-accent);
}

.tbcc .tbcc-btn:disabled {
	cursor: default;
	opacity: 0.45;
}

/* Table ------------------------------------------------------------------ */

.tbcc-tablewrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tbcc .tbcc-table {
	border-collapse: collapse;
	font-size: 14px;
	margin: 0;
	min-width: 100%;
	width: 100%;
}

.tbcc .tbcc-table th,
.tbcc .tbcc-table td {
	border: 0;
	border-bottom: 1px solid var(--tbcc-border-soft);
	padding: 10px 12px;
	text-align: right;
	vertical-align: middle;
	white-space: nowrap;
}

.tbcc .tbcc-table thead th {
	background: var(--tbcc-bg-soft);
	border-bottom: 1px solid var(--tbcc-border);
	color: var(--tbcc-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	position: sticky;
	top: 0;
	text-transform: uppercase;
	z-index: 1;
}

.tbcc .tbcc-table th[data-sortable] {
	cursor: pointer;
	user-select: none;
}

.tbcc .tbcc-table th[data-sortable]:hover {
	color: var(--tbcc-text);
}

.tbcc .tbcc-table th[data-sortable]::after {
	content: "";
	display: inline-block;
	margin-left: 5px;
	opacity: 0.35;
}

.tbcc .tbcc-table th[aria-sort="ascending"]::after {
	content: "▲";
	opacity: 1;
}

.tbcc .tbcc-table th[aria-sort="descending"]::after {
	content: "▼";
	opacity: 1;
}

.tbcc .tbcc-table tbody tr:hover {
	background: var(--tbcc-bg-alt);
}

.tbcc .tbcc-table tbody tr:last-child td {
	border-bottom: 0;
}

.tbcc .tbcc-table th:first-child,
.tbcc .tbcc-table td:first-child,
.tbcc .tbcc-table th:nth-child(2),
.tbcc .tbcc-table td:nth-child(2) {
	text-align: left;
}

.tbcc-th--rank,
.tbcc-td--rank {
	width: 46px;
}

.tbcc-td--rank {
	color: var(--tbcc-muted);
	font-variant-numeric: tabular-nums;
}

.tbcc .tbcc-table td {
	font-variant-numeric: tabular-nums;
}

.tbcc-td--player {
	white-space: normal;
}

.tbcc-row--penalty {
	background: var(--tbcc-bad-bg);
}

/* Rank badges ------------------------------------------------------------ */

.tbcc-rank {
	align-items: center;
	background: var(--tbcc-bg-alt);
	border-radius: 8px;
	display: inline-flex;
	font-size: 13px;
	font-weight: 700;
	height: 26px;
	justify-content: center;
	min-width: 26px;
	padding: 0 6px;
}

.tbcc-rank--1 {
	background: linear-gradient(135deg, #f5c451, #d19a1c);
	color: #33260a;
}

.tbcc-rank--2 {
	background: linear-gradient(135deg, #dfe3e8, #b3bbc5);
	color: #2c3138;
}

.tbcc-rank--3 {
	background: linear-gradient(135deg, #e3a877, #bf7d43);
	color: #38220f;
}

.tbcc-rank--lg {
	font-size: 15px;
	height: 34px;
	margin-left: auto;
	min-width: 44px;
}

/* Player cell ------------------------------------------------------------ */

.tbcc-player {
	align-items: center;
	display: flex;
	gap: 9px;
}

.tbcc-avatar {
	align-items: center;
	background: var(--tbcc-bg-alt);
	background: color-mix(in srgb, var(--tbcc-accent) 20%, var(--tbcc-bg-alt));
	border-radius: 50%;
	color: var(--tbcc-text);
	display: inline-flex;
	flex: none;
	font-size: 12px;
	font-weight: 700;
	height: 28px;
	justify-content: center;
	width: 28px;
}

.tbcc-avatar--lg {
	font-size: 20px;
	height: 52px;
	width: 52px;
}

.tbcc-player__name {
	display: flex;
	flex-direction: column;
	font-weight: 600;
	line-height: 1.25;
}

.tbcc-player__alt {
	color: var(--tbcc-muted);
	font-size: 11px;
	font-weight: 400;
}

/* Progress + points ------------------------------------------------------ */

.tbcc-progress {
	background: var(--tbcc-bg-alt);
	border-radius: 999px;
	height: 5px;
	margin: 0 0 4px auto;
	max-width: 120px;
	min-width: 60px;
	overflow: hidden;
}

.tbcc-progress > span {
	background: var(--tbcc-accent);
	display: block;
	height: 100%;
}

.tbcc-points {
	font-weight: 700;
}

/* Pills ------------------------------------------------------------------ */

.tbcc-pill {
	border-radius: 999px;
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 3px 9px;
	white-space: nowrap;
}

.tbcc-pill--ok {
	background: var(--tbcc-ok-bg);
	color: var(--tbcc-ok);
}

.tbcc-pill--off {
	background: var(--tbcc-bg-alt);
	color: var(--tbcc-muted);
}

.tbcc-pill--bad {
	background: var(--tbcc-bad-bg);
	color: var(--tbcc-bad);
	margin-left: 4px;
}

.tbcc-pill--epic {
	background: var(--tbcc-bg-alt);
	background: color-mix(in srgb, var(--tbcc-accent) 22%, transparent);
	color: var(--tbcc-accent);
	margin-left: 4px;
}

.tbcc-pill--vip {
	background: var(--tbcc-bg-alt);
	background: color-mix(in srgb, var(--tbcc-accent) 16%, var(--tbcc-bg-alt));
	color: var(--tbcc-text);
}

.tbcc-lvl {
	background: var(--tbcc-bg-alt);
	border: 1px solid var(--tbcc-border-soft);
	border-radius: 6px;
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	margin-left: 3px;
	padding: 2px 6px;
}

.tbcc-td--levels {
	white-space: nowrap;
}

.tbcc-muted {
	color: var(--tbcc-muted);
}

.tbcc-time {
	color: var(--tbcc-muted);
	font-size: 13px;
}

/* Pager / empty / notices ------------------------------------------------ */

.tbcc-pager {
	align-items: center;
	border-top: 1px solid var(--tbcc-border-soft);
	display: flex;
	gap: 12px;
	justify-content: center;
	padding: 12px 20px;
}

.tbcc-pager__info {
	color: var(--tbcc-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	min-width: 150px;
	text-align: center;
}

.tbcc .tbcc-empty {
	color: var(--tbcc-muted);
	margin: 0;
	padding: 28px 20px;
	text-align: center;
}

.tbcc-notice {
	border-left: 3px solid var(--tbcc-info);
	border-radius: 8px;
	font-size: 13.5px;
	margin: 16px 20px 0;
	padding: 11px 14px;
}

.tbcc-widget > .tbcc-notice:first-child {
	margin-top: 20px;
}

.tbcc-notice--error {
	background: var(--tbcc-bad-bg);
	border-left-color: var(--tbcc-bad);
}

.tbcc-notice--warning {
	background: var(--tbcc-warn-bg);
	border-left-color: var(--tbcc-warn);
}

.tbcc-notice--info {
	background: var(--tbcc-bg-alt);
	border-left-color: var(--tbcc-info);
}

.tbcc-credit {
	border-top: 1px solid var(--tbcc-border-soft);
	color: var(--tbcc-muted);
	font-size: 11px;
	letter-spacing: 0.04em;
	padding: 9px 20px;
	text-align: right;
	text-transform: uppercase;
}

/* Tabs ------------------------------------------------------------------- */

.tbcc-dashboard {
	background: transparent;
	border: 0;
	box-shadow: none;
}

.tbcc-dashboard::before {
	display: none;
}

.tbcc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}

.tbcc .tbcc-tab {
	background: var(--tbcc-bg-alt);
	border: 1px solid var(--tbcc-border);
	border-radius: 999px;
	color: var(--tbcc-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1;
	padding: 10px 18px;
	transition: all 0.15s ease;
}

.tbcc .tbcc-tab:hover {
	color: var(--tbcc-text);
}

.tbcc .tbcc-tab.is-active {
	background: var(--tbcc-accent);
	border-color: var(--tbcc-accent);
	color: #1a1204;
}

.tbcc-panel > .tbcc-widget {
	margin-bottom: 0;
}

/* Player card ------------------------------------------------------------ */

.tbcc-pc {
	padding: 20px 0 4px;
}

.tbcc-pc__id {
	align-items: center;
	display: flex;
	gap: 14px;
	padding: 0 20px 12px;
}

/* Summary ---------------------------------------------------------------- */

.tbcc-summary .tbcc-stats {
	padding: 18px 20px;
}

.tbcc-summary .tbcc-head + .tbcc-stats {
	padding-top: 6px;
}

/* ==========================================================================
   Dashboard views: Crypt Dashboard + Crypting Details
   ========================================================================== */

/* Controls row ----------------------------------------------------------- */

.tbcc-controls {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	padding: 4px 20px 12px;
}

.tbcc-cycleform {
	align-items: center;
	display: flex;
	gap: 8px;
	margin: 0;
}

.tbcc-cycleform .tbcc-field--select {
	min-width: 260px;
}

.tbcc .tbcc-check {
	align-items: center;
	box-shadow: none;
	color: var(--tbcc-muted);
	cursor: pointer;
	display: inline-flex;
	font-size: 13.5px;
	gap: 8px;
	text-decoration: none;
}

.tbcc .tbcc-check:hover {
	color: var(--tbcc-text);
}

.tbcc-check__box {
	background: var(--tbcc-bg);
	border: 1.5px solid var(--tbcc-border);
	border-radius: 4px;
	flex: none;
	height: 16px;
	position: relative;
	width: 16px;
}

.tbcc-check.is-on {
	color: var(--tbcc-text);
}

.tbcc-check.is-on .tbcc-check__box {
	background: var(--tbcc-accent);
	border-color: var(--tbcc-accent);
}

.tbcc-check.is-on .tbcc-check__box::after {
	border: solid #1a1204;
	border-width: 0 2px 2px 0;
	content: "";
	height: 8px;
	left: 4px;
	position: absolute;
	top: 1px;
	transform: rotate(45deg);
	width: 4px;
}

/* Period bar ------------------------------------------------------------- */

.tbcc-periodbar {
	align-items: center;
	background: var(--tbcc-bg-soft);
	border-bottom: 1px solid var(--tbcc-border-soft);
	border-top: 1px solid var(--tbcc-border-soft);
	display: flex;
	flex-wrap: wrap;
	font-size: 13.5px;
	gap: 8px;
	margin: 0 0 4px;
	padding: 11px 20px;
}

.tbcc-periodbar strong {
	color: var(--tbcc-muted);
	font-weight: 600;
}

/* KPI tiles -------------------------------------------------------------- */

.tbcc-kpis {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	padding: 16px 20px;
}

.tbcc-kpi {
	border-radius: 10px;
	color: #fff;
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-height: 104px;
	padding: 14px 16px;
}

.tbcc-kpi__label {
	align-items: center;
	display: flex;
	font-size: 13px;
	font-weight: 600;
	gap: 6px;
	justify-content: space-between;
	opacity: 0.95;
}

.tbcc-kpi__note {
	background: rgba(0, 0, 0, 0.18);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 7px;
	white-space: nowrap;
}

.tbcc-kpi__value {
	font-size: 32px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
	margin-top: auto;
}

.tbcc-kpi__hint {
	font-size: 12.5px;
	opacity: 0.9;
}

.tbcc-kpi--totals      { background: linear-gradient(135deg, #22bd79, #179961); }
.tbcc-kpi--crypts      { background: linear-gradient(135deg, #4b8bf5, #2f6ddb); }
.tbcc-kpi--citadels    { background: linear-gradient(135deg, #8b5cf6, #6d3fe0); }
.tbcc-kpi--ancients    { background: linear-gradient(135deg, #f0ad3e, #d68a19); }
.tbcc-kpi--epics       { background: linear-gradient(135deg, #ef6259, #d8433a); }
.tbcc-kpi--green       { background: linear-gradient(135deg, #22bd79, #179961); }
.tbcc-kpi--contributed { background: linear-gradient(135deg, #4b8bf5, #2f6ddb); }
.tbcc-kpi--points      { background: #e05c54; }
.tbcc-kpi--completed   { background: #45b07c; }
.tbcc-kpi--ontrack     { background: #eda93b; }
.tbcc-kpi--behind      { background: #e05c54; }

.tbcc-kpi__info {
	align-items: center;
	background: rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	cursor: help;
	display: inline-flex;
	flex: none;
	font-size: 10px;
	font-style: italic;
	font-weight: 700;
	height: 15px;
	justify-content: center;
	width: 15px;
}

/* Clan chest points progress -------------------------------------------- */

.tbcc-goal {
	border: 2px solid var(--tbcc-accent);
	border-radius: 12px;
	margin: 4px 20px 16px;
	padding: 16px 18px;
}

.tbcc-goal__top {
	align-items: flex-start;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
}

.tbcc-goal__label {
	color: var(--tbcc-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.tbcc .tbcc-goal__numbers {
	font-size: 19px;
	font-variant-numeric: tabular-nums;
	margin: 4px 0 0;
	padding: 0;
}

.tbcc-goal__numbers strong {
	font-size: 26px;
}

.tbcc-goal__pct {
	display: flex;
	flex-direction: column;
	text-align: right;
}

.tbcc-goal__pct strong {
	color: var(--tbcc-accent);
	font-size: 34px;
	line-height: 1.05;
}

.tbcc-goal__pct span {
	font-size: 12px;
}

.tbcc-goal__bar {
	background: var(--tbcc-bg-alt);
	border-radius: 999px;
	height: 12px;
	margin-top: 14px;
	overflow: hidden;
}

.tbcc-goal__bar > span {
	background: var(--tbcc-accent);
	border-radius: 999px;
	display: block;
	height: 100%;
}

/* Completed & On Track / At-Risk panels ---------------------------------- */

.tbcc-count {
	color: var(--tbcc-muted);
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.tbcc .tbcc-statuslist {
	list-style: none;
	margin: 0;
	max-height: 430px;
	overflow-y: auto;
	padding: 0;
}

.tbcc-statusrow {
	border-bottom: 1px solid var(--tbcc-border-soft);
	margin: 0;
	padding: 12px 16px;
}

.tbcc-statusrow:last-child {
	border-bottom: 0;
}

.tbcc-statusrow__top {
	align-items: baseline;
	display: flex;
	gap: 8px;
	margin-bottom: 7px;
}

.tbcc-statusrow__icon {
	flex: none;
}

.tbcc-statusrow__name {
	flex: 1 1 auto;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tbcc-statusrow__totals {
	color: var(--tbcc-muted);
	flex: none;
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
}

.tbcc-statusrow__foot {
	display: flex;
	gap: 8px;
	justify-content: space-between;
	margin-top: 6px;
}

.tbcc-statusrow__pct {
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.tbcc-statuspanel--risk .tbcc-statusrow__pct {
	color: var(--tbcc-bad);
}

.tbcc-statuspanel--good .tbcc-statusrow__pct {
	color: var(--tbcc-ok);
}

.tbcc-statusrow__detail {
	color: var(--tbcc-muted);
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
}

.tbcc-loadmore {
	margin: 0;
	padding: 0;
	position: sticky;
	bottom: 0;
}

.tbcc .tbcc-more {
	background: var(--tbcc-bg-soft);
	border: 0;
	border-top: 1px solid var(--tbcc-border-soft);
	color: var(--tbcc-accent);
	cursor: pointer;
	display: block;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	margin: 0;
	padding: 11px 16px;
	text-align: center;
	width: 100%;
}

.tbcc .tbcc-more:hover {
	background: var(--tbcc-bg-alt);
	color: var(--tbcc-text);
}

/* Chest Statistics table ------------------------------------------------- */

.tbcc-banner {
	background: linear-gradient(100deg, #2563eb, #1e40af);
	border-radius: 10px;
	color: #fff;
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin: 4px 20px 12px;
	padding: 14px 18px;
}

.tbcc-banner span {
	font-size: 13px;
	opacity: 0.9;
}

.tbcc .tbcc-table--stats thead th small {
	color: var(--tbcc-muted);
	display: block;
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
}

.tbcc-row--totals td {
	background: color-mix(in srgb, var(--tbcc-accent) 12%, var(--tbcc-bg-soft));
	border-bottom: 2px solid var(--tbcc-border);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	text-align: right;
}

.tbcc-row--totals .tbcc-td--player {
	font-weight: 700;
	text-align: left;
}

.tbcc-row--podium td:first-child {
	box-shadow: inset 3px 0 0 var(--tbcc-accent);
}

.tbcc-trophy {
	flex: none;
	font-size: 15px;
}

/* Area chart ------------------------------------------------------------- */

.tbcc-chart--area {
	max-height: 340px;
}

.tbcc-chart__area {
	fill: #21b573;
	opacity: 0.14;
}

.tbcc-chart__line {
	stroke: #21b573;
	stroke-linejoin: round;
	stroke-width: 2;
}

.tbcc-cols--single {
	grid-template-columns: 1fr;
}

/* Panel cards + columns -------------------------------------------------- */

.tbcc-cols {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	padding: 4px 20px 16px;
}

.tbcc-panelcard {
	background: var(--tbcc-bg);
	border: 1px solid var(--tbcc-border);
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.tbcc-panelcard--flush {
	margin: 0 20px 16px;
}

.tbcc-panelcard__head {
	align-items: center;
	border-bottom: 1px solid var(--tbcc-border-soft);
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: space-between;
	padding: 13px 16px;
}

.tbcc .tbcc-panelcard__head h4 {
	font-size: 15.5px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
	padding: 0;
}

/* Chests / Points toggle ------------------------------------------------- */

.tbcc-toggle {
	background: var(--tbcc-bg-alt);
	border: 1px solid var(--tbcc-border);
	border-radius: 999px;
	display: inline-flex;
	gap: 2px;
	padding: 2px;
}

.tbcc .tbcc-toggle__btn {
	background: transparent;
	border: 1px solid transparent;
	border-radius: 999px;
	color: var(--tbcc-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1;
	padding: 7px 15px;
}

.tbcc .tbcc-toggle__btn.is-active {
	background: var(--tbcc-bg);
	border-color: var(--tbcc-border);
	color: var(--tbcc-text);
}

/* Grid rows stretch the cards to equal height; centring keeps the shorter
   chart from leaving a gap at the bottom of its card. */
.tbcc-metric {
	align-items: center;
	display: flex;
	flex: 1 1 auto;
	justify-content: center;
	padding: 14px 16px 16px;
}

.tbcc-metric[hidden] {
	display: none !important;
}

.tbcc-metric > * {
	width: 100%;
}

/* Charts ----------------------------------------------------------------- */

/* height:auto keeps the viewBox ratio, so nothing inside the SVG distorts. */
.tbcc-chart {
	display: block;
	height: auto;
	max-height: 300px;
	width: 100%;
}

.tbcc-chart__grid {
	stroke: var(--tbcc-border-soft);
	stroke-width: 1;
}

.tbcc-chart__axis {
	fill: var(--tbcc-muted);
	font-size: 11px;
}

.tbcc-chart__bar {
	fill: #6c63e8;
}

.tbcc-donutwrap {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	justify-content: center;
}

.tbcc-donut {
	flex: none;
	height: 200px;
	width: 200px;
}

.tbcc-donut__total {
	fill: var(--tbcc-text);
	font-size: 24px;
	font-weight: 700;
}

.tbcc .tbcc-legend {
	display: flex;
	flex: 1 1 210px;
	flex-direction: column;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tbcc-legend__item {
	align-items: center;
	display: flex;
	font-size: 12.5px;
	gap: 8px;
	margin: 0;
}

.tbcc-legend__dot {
	border-radius: 3px;
	flex: none;
	height: 11px;
	width: 11px;
}

.tbcc-legend__label {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tbcc-legend__value {
	color: var(--tbcc-muted);
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

/* Top lists -------------------------------------------------------------- */

.tbcc .tbcc-toplist {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}

.tbcc-toplist__row {
	align-items: center;
	display: flex;
	gap: 12px;
	margin: 0;
	padding: 11px 16px;
}

.tbcc-toplist__row + .tbcc-toplist__row {
	border-top: 1px solid var(--tbcc-border-soft);
}

.tbcc-toplist__rank {
	color: var(--tbcc-muted);
	flex: none;
	font-size: 17px;
	font-weight: 700;
	text-align: center;
	width: 26px;
}

.tbcc-toplist__name {
	flex: 1 1 auto;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tbcc-toplist__value {
	font-size: 16px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* Filters ---------------------------------------------------------------- */

.tbcc-filters {
	align-items: center;
	border-bottom: 1px solid var(--tbcc-border-soft);
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	padding: 13px 16px;
}

.tbcc-field--num {
	width: 118px;
}

.tbcc-field--num .tbcc-input {
	text-align: right;
}

/* Rankings table --------------------------------------------------------- */

.tbcc-table--rankings td {
	padding-bottom: 12px;
	padding-top: 12px;
}

.tbcc-td--points strong {
	display: block;
	font-size: 15px;
}

.tbcc-td--points small,
.tbcc-td--breakdown small {
	color: var(--tbcc-muted);
	display: block;
	font-size: 11.5px;
	font-weight: 400;
}

.tbcc-td--progress {
	min-width: 210px;
	text-align: left !important;
	white-space: normal;
}

.tbcc-td--progress small {
	display: block;
	font-size: 11.5px;
	margin-top: 4px;
}

.tbcc-td--breakdown {
	text-align: left !important;
	white-space: normal;
}

.tbcc-td--pct strong {
	display: block;
	font-size: 15px;
}

.tbcc-bar {
	background: var(--tbcc-bg-alt);
	border-radius: 999px;
	height: 9px;
	overflow: hidden;
	width: 100%;
}

.tbcc-bar > span {
	border-radius: 999px;
	display: block;
	height: 100%;
}

.tbcc-bar--completed > span { background: #45b07c; }
.tbcc-bar--on_track > span  { background: #4b6ef5; }
.tbcc-bar--behind > span    { background: #e05c54; }

.tbcc-pill--warn {
	background: var(--tbcc-warn-bg);
	color: var(--tbcc-warn);
}

.tbcc-trend {
	display: block;
	font-size: 11.5px;
	font-weight: 600;
}

.tbcc-trend--up   { color: var(--tbcc-ok); }
.tbcc-trend--down { color: var(--tbcc-bad); }
.tbcc-trend--flat { color: var(--tbcc-muted); }

/* Responsive ------------------------------------------------------------- */

@media (max-width: 782px) {
	.tbcc-kpis {
		grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
		padding: 12px 14px;
	}

	.tbcc-kpi__value {
		font-size: 25px;
	}

	.tbcc-cols {
		padding: 4px 14px 14px;
	}

	.tbcc-panelcard--flush {
		margin: 0 14px 14px;
	}

	.tbcc-controls,
	.tbcc-periodbar {
		padding-left: 14px;
		padding-right: 14px;
	}

	.tbcc-cycleform,
	.tbcc-cycleform .tbcc-field--select {
		min-width: 0;
		width: 100%;
	}

	.tbcc-donutwrap {
		flex-direction: column;
	}
}

@media (max-width: 782px) {
	.tbcc-col--wide {
		display: none;
	}

	.tbcc-stats {
		grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	}

	.tbcc-stat__value {
		font-size: 18px;
	}

	.tbcc-head,
	.tbcc-toolbar,
	.tbcc-stats,
	.tbcc-credit,
	.tbcc-notice {
		padding-left: 14px;
		padding-right: 14px;
	}

	.tbcc-notice {
		margin-left: 14px;
		margin-right: 14px;
	}

	.tbcc .tbcc-table th,
	.tbcc .tbcc-table td {
		padding: 9px 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tbcc * {
		transition: none !important;
	}
}

.tbcc-notice strong {
	font-weight: 700;
}

.tbcc .tbcc-notice a {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	white-space: nowrap;
}
