/**
 * Telemetry Schema Reference Table
 *
 * Standalone component CSS for the telemetry schema table rendered by
 * tinywag_fixed_page_render_component_telemetry_schema_table().
 * Loaded on pages that display the schema table (fixed pages, dashboards).
 *
 * @package tinywag
 */

.telemetry-schema-ref {
	margin-top: 1rem;
}

.telemetry-schema-ref .schema-version {
	color: var(--color-text-secondary, #666);
	margin-bottom: 0.5rem;
}

.telemetry-schema-ref .schema-group-title {
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
}

.telemetry-schema-ref .schema-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	margin-bottom: 1rem;
}

.telemetry-schema-ref .schema-table th,
.telemetry-schema-ref .schema-table td {
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--color-border, #e0e0e0);
	text-align: left;
	vertical-align: top;
}

.telemetry-schema-ref .schema-table th {
	background: #f5f5f5;
	font-weight: 600;
	white-space: nowrap;
}

.telemetry-schema-ref .schema-table td.center {
	text-align: center;
}

.telemetry-schema-ref .schema-table code {
	font-size: 0.8rem;
	background: #f0f0f0;
	padding: 0.1em 0.3em;
	border-radius: 3px;
}

.fixed-json-page--data-spec .telemetry-schema-ref {
	display: grid;
	gap: clamp(0.95rem, 1.7vw, 1.35rem);
	margin-top: 1.1rem;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-version {
	margin: 0;
	font-size: 0.86rem;
	line-height: 1.55;
	color: color-mix(in srgb, var(--text-primary, #0f172a) 68%, #475569);
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-version small {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.32rem 0.7rem;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 16%, var(--border, #d6d9df));
	background: color-mix(in srgb, var(--accent, #2563eb) 7%, #ffffff);
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-group-title {
	margin: 0.2rem 0 0;
	font-size: clamp(1rem, 1.35vw, 1.1rem);
	font-weight: 800;
	line-height: 1.35;
	letter-spacing: -0.01em;
	color: var(--text-primary, #0f172a);
}

.fixed-json-page--data-spec .telemetry-schema-ref .fixed-page-table-wrap {
	width: 100%;
	max-width: 100%;
	margin: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 11%, var(--border, #d6d9df));
	border-radius: 1rem;
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--accent, #2563eb) 3%, #ffffff) 0%, #ffffff 100%);
	box-shadow: 0 18px 38px rgba(15, 23, 42, 0.05);
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table {
	width: max(100%, 56rem);
	min-width: 0;
	margin: 0;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	font-size: 0.92rem;
	background: transparent;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 0.8rem 0.95rem;
	border: 0;
	border-bottom: 1px solid color-mix(in srgb, var(--accent, #2563eb) 12%, var(--border, #d6d9df));
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--accent, #2563eb) 7%, #fbfdff) 0%, #f8fbff 100%);
	font-size: 0.78rem;
	font-weight: 800;
	line-height: 1.45;
	letter-spacing: 0.05em;
	color: color-mix(in srgb, var(--accent, #2563eb) 70%, #334155);
	text-transform: uppercase;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table thead th:nth-child(1) {
	width: 26%;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table thead th:nth-child(2) {
	width: 14%;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table thead th:nth-child(3) {
	width: 12%;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table th,
.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td {
	border: 0;
	border-bottom: 1px solid color-mix(in srgb, var(--accent, #2563eb) 9%, var(--border, #d6d9df));
	border-right: 1px solid color-mix(in srgb, var(--accent, #2563eb) 8%, var(--border, #d6d9df));
	padding: 0.9rem 0.95rem;
	text-align: left;
	vertical-align: top;
	background: transparent;
	color: color-mix(in srgb, var(--text-primary, #0f172a) 80%, #334155);
	line-height: 1.65;
	overflow-wrap: anywhere;
	word-break: normal;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tr > *:last-child {
	border-right: 0;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tbody tr:last-child td {
	border-bottom: 0;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tbody tr:nth-child(even) td {
	background: color-mix(in srgb, var(--accent, #2563eb) 2.5%, #fbfdff);
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tbody tr:hover td {
	background: color-mix(in srgb, var(--accent, #2563eb) 5%, #f8fbff);
}

.fixed-json-page--data-spec .telemetry-schema-ref .fixed-json-data-table__label,
.fixed-json-page--data-spec .telemetry-schema-ref .fixed-page-data-table__label {
	display: none;
}

.fixed-json-page--data-spec .telemetry-schema-ref .fixed-json-data-table__value,
.fixed-json-page--data-spec .telemetry-schema-ref .fixed-page-data-table__value {
	display: block;
	min-width: 0;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:first-child .fixed-json-data-table__value,
.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:first-child .fixed-page-data-table__value {
	font-weight: 700;
	color: var(--text-primary, #0f172a);
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center {
	text-align: center;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-json-data-table__value,
.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-page-data-table__value {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	font-size: 0.76rem;
	font-weight: 800;
	line-height: 1.2;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-json-data-table__value:not(:empty),
.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-page-data-table__value:not(:empty) {
	background: color-mix(in srgb, var(--success, #10b981) 14%, #ffffff);
	color: color-mix(in srgb, var(--success, #10b981) 78%, #14532d);
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-json-data-table__value:empty,
.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-page-data-table__value:empty {
	background: color-mix(in srgb, var(--text-primary, #0f172a) 5%, #ffffff);
	color: color-mix(in srgb, var(--text-primary, #0f172a) 36%, #94a3b8);
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-json-data-table__value:empty::before,
.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-page-data-table__value:empty::before {
	content: "-";
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table code {
	display: inline-block;
	max-width: 100%;
	padding: 0.18rem 0.45rem;
	border-radius: 0.45rem;
	border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 10%, var(--border, #d6d9df));
	background: color-mix(in srgb, var(--accent, #2563eb) 5%, #f8fafc);
	font-size: 0.82rem;
	line-height: 1.55;
	color: color-mix(in srgb, var(--text-primary, #0f172a) 88%, #1e293b);
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:last-child .fixed-json-data-table__value,
.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:last-child .fixed-page-data-table__value {
	max-width: 56ch;
}

@media (max-width: 820px) {
	.fixed-json-page--data-spec .telemetry-schema-ref {
		gap: 0.9rem;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-group-title {
		margin-top: 0.35rem;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .fixed-page-table-wrap {
		overflow: visible;
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tbody,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tr {
		display: block;
		width: 100%;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table {
		width: 100%;
		font-size: 0.95rem;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		border: 0;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tbody {
		display: grid;
		gap: 0.75rem;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tr {
		margin: 0;
		border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 14%, var(--border, #d6d9df));
		border-radius: 1rem;
		background:
			linear-gradient(180deg, color-mix(in srgb, var(--accent, #2563eb) 4.5%, #ffffff) 0%, #ffffff 100%);
		box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
		overflow: hidden;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tbody tr:nth-child(even) td,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table tbody tr:hover td {
		background: transparent;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td {
		display: block;
		width: 100%;
		padding: 0.82rem 0.9rem;
		border-right: 0;
		border-bottom: 1px solid color-mix(in srgb, var(--accent, #2563eb) 9%, var(--border, #d6d9df));
		background: transparent;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:last-child {
		border-bottom: 0;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:first-child {
		padding-top: 0.95rem;
		background:
			linear-gradient(180deg, color-mix(in srgb, var(--accent, #2563eb) 8%, #f8fbff) 0%, transparent 100%);
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.fixed-json-data-table__cell,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.fixed-page-data-table__cell {
		display: grid;
		gap: 0.34rem;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .fixed-json-data-table__label,
	.fixed-json-page--data-spec .telemetry-schema-ref .fixed-page-data-table__label {
		display: block;
		font-size: 0.74rem;
		font-weight: 800;
		line-height: 1.4;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: color-mix(in srgb, var(--accent, #2563eb) 74%, #475569);
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .fixed-json-data-table__value,
	.fixed-json-page--data-spec .telemetry-schema-ref .fixed-page-data-table__value {
		font-size: 0.97rem;
		line-height: 1.68;
		color: color-mix(in srgb, var(--text-primary, #0f172a) 82%, #334155);
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:first-child .fixed-json-data-table__value,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:first-child .fixed-page-data-table__value {
		font-size: 1rem;
		line-height: 1.5;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:last-child .fixed-json-data-table__value,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:last-child .fixed-page-data-table__value {
		max-width: none;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center {
		text-align: left;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-json-data-table__value,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.center .fixed-page-data-table__value {
		justify-content: flex-start;
	}
}

@media (min-width: 581px) and (max-width: 820px) {
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.fixed-json-data-table__cell,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td.fixed-page-data-table__cell {
		grid-template-columns: minmax(7.25rem, 31%) minmax(0, 1fr);
		gap: 0.8rem;
		align-items: start;
	}

	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:first-child.fixed-json-data-table__cell,
	.fixed-json-page--data-spec .telemetry-schema-ref .schema-table td:first-child.fixed-page-data-table__cell {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.telemetry-schema-ref .schema-table {
		font-size: 0.75rem;
	}

	.telemetry-schema-ref .schema-table th,
	.telemetry-schema-ref .schema-table td {
		padding: 0.3rem 0.4rem;
	}
}
