/**
 * SBC Quick Code Reference — front-end styles.
 *
 * Fully self-contained: no Bootstrap, no framework, no web fonts, no CDN.
 * Everything is scoped under .sbc-cr so it cannot collide with a theme, and
 * it survives a theme change.
 */

.sbc-cr {
	--sbc-cr-head: #074a53;
	--sbc-cr-topic: #0e8b98;
	--sbc-cr-line: #d5dde0;
	--sbc-cr-stripe: #f4f8f9;
	--sbc-cr-text: #16242a;
	--sbc-cr-muted: #5d7076;
	--sbc-cr-draft: #b4530a;
	--sbc-cr-draft-bg: #fff8f0;
	--sbc-cr-focus: #0e8b98;

	box-sizing: border-box;
	color: var(--sbc-cr-text);
	font-size: 15px;
	line-height: 1.45;
	margin: 0 0 2rem;
}

.sbc-cr *,
.sbc-cr *::before,
.sbc-cr *::after {
	box-sizing: inherit;
}

.sbc-cr__title {
	font-size: 1.6rem;
	line-height: 1.25;
	margin: 0 0 0.75rem;
}

.sbc-cr__intro {
	margin: 0 0 1rem;
}

.sbc-cr__intro ul {
	margin: 0;
	padding-left: 1.2em;
}

.sbc-cr__intro li {
	margin: 0.15em 0;
}

.sbc-cr__intro a,
.sbc-cr__footer a {
	color: #0a6a75;
}

/* ------------------------------------------------------------------ tools */

.sbc-cr__tools {
	align-items: flex-end;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	justify-content: space-between;
	margin: 0 0 0.75rem;
}

.sbc-cr__search {
	display: block;
	flex: 1 1 16rem;
	max-width: 26rem;
}

.sbc-cr__search-label {
	color: var(--sbc-cr-muted);
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	margin-bottom: 0.25rem;
	text-transform: uppercase;
}

.sbc-cr__search-input {
	border: 1px solid var(--sbc-cr-line);
	border-radius: 4px;
	font: inherit;
	padding: 0.45rem 0.6rem;
	width: 100%;
}

.sbc-cr__search-input:focus {
	border-color: var(--sbc-cr-focus);
	outline: 2px solid var(--sbc-cr-focus);
	outline-offset: 1px;
}

.sbc-cr__count {
	color: var(--sbc-cr-muted);
	font-size: 0.85rem;
	margin: 0;
}

.sbc-cr__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.sbc-cr__button {
	background: #fff;
	border: 1px solid var(--sbc-cr-head);
	border-radius: 4px;
	color: var(--sbc-cr-head);
	cursor: pointer;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	padding: 0.45rem 0.8rem;
}

.sbc-cr__button:hover,
.sbc-cr__button:focus {
	background: var(--sbc-cr-head);
	color: #fff;
}

.sbc-cr__button--primary {
	background: var(--sbc-cr-head);
	color: #fff;
}

.sbc-cr__button--primary:hover,
.sbc-cr__button--primary:focus {
	background: #05343a;
}

/* --------------------------------------------------------------- toggles */

.sbc-cr__toggles {
	border: 1px solid var(--sbc-cr-line);
	border-radius: 4px;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
	margin: 0 0 0.5rem;
	padding: 0.5rem 0.75rem;
}

.sbc-cr__toggles-legend {
	color: var(--sbc-cr-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	padding: 0 0.35rem;
	text-transform: uppercase;
}

.sbc-cr__toggle {
	align-items: center;
	display: inline-flex;
	font-size: 0.85rem;
	gap: 0.3rem;
}

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

.sbc-cr__table-wrap {
	margin: 0 0 2rem;
}

.sbc-cr__table-heading {
	font-size: 1.15rem;
	margin: 0 0 0.5rem;
}

.sbc-cr__tabs {
	display: flex;
	gap: 0.25rem;
	margin: 1.25rem 0 0;
}

.sbc-cr__tab {
	background: #e4edef;
	border: 1px solid var(--sbc-cr-line);
	border-bottom: 0;
	border-radius: 6px 6px 0 0;
	color: var(--sbc-cr-head);
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	padding: 0.55rem 1.4rem;
}

.sbc-cr__tab:hover {
	background: #d5e4e7;
}

.sbc-cr__tab:focus-visible {
	outline: 2px solid var(--sbc-cr-focus);
	outline-offset: -2px;
}

.sbc-cr__tab.is-active {
	background: var(--sbc-cr-head);
	border-color: var(--sbc-cr-head);
	color: #fff;
}

.sbc-cr__table-wrap.is-hidden {
	display: none;
}

.sbc-cr__tabs + .sbc-cr__table-wrap .sbc-cr__scroll,
.sbc-cr__tabs ~ .sbc-cr__table-wrap .sbc-cr__scroll {
	border-top-left-radius: 0;
}

.sbc-cr__scroll {
	border: 1px solid var(--sbc-cr-line);
	border-radius: 4px;
	overflow: visible;
	position: relative;
}

.sbc-cr__scroll:focus-visible {
	outline: 2px solid var(--sbc-cr-focus);
	outline-offset: 2px;
}

.sbc-cr__table {
	border-collapse: separate;
	border-spacing: 0;
	margin: 0;
	width: 100%;
}

.sbc-cr__table th,
.sbc-cr__table td {
	border-bottom: 1px solid var(--sbc-cr-line);
	border-right: 1px solid var(--sbc-cr-line);
	font-size: 0.88rem;
	padding: 0.5rem 0.65rem;
	text-align: left;
	vertical-align: top;
}

.sbc-cr__table th:last-child,
.sbc-cr__table td:last-child {
	border-right: 0;
}

.sbc-cr__th {
	background: var(--sbc-cr-head);
	color: #fff;
	font-weight: 700;
	min-width: 11rem;
	position: sticky;
	top: var(--sbc-cr-stick, 0px);
	z-index: 5;
}

.sbc-cr__th--topic {
	left: 0;
	min-width: 14rem;
	position: sticky;
	z-index: 7;
}

.sbc-cr__th a {
	color: #fff;
	text-decoration: underline;
}

.sbc-cr__th--draft {
	background: #0a5f57;
}

.sbc-cr__badge {
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 2px;
	display: inline-block;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	margin-top: 0.3rem;
	padding: 0.1rem 0.3rem;
	text-transform: uppercase;
	white-space: nowrap;
}

.sbc-cr__topic {
	background: var(--sbc-cr-topic);
	color: #fff;
	font-weight: 600;
	left: 0;
	position: sticky;
	z-index: 3;
}

.sbc-cr__topic a {
	color: #fff;
}

.sbc-cr__cell {
	background: #fff;
}

.sbc-cr__table tbody tr:nth-child(even) .sbc-cr__cell {
	background: var(--sbc-cr-stripe);
}

.sbc-cr__cell--draft {
	background: var(--sbc-cr-draft-bg);
	box-shadow: inset 3px 0 0 rgba(180, 83, 10, 0.35);
}

.sbc-cr__table tbody tr:nth-child(even) .sbc-cr__cell--draft {
	background: #fdf3e8;
}

.sbc-cr__section {
	background: #e4edef;
	color: var(--sbc-cr-head);
	font-size: 0.8rem !important;
	font-weight: 700;
	letter-spacing: 0.05em;
	left: 0;
	position: sticky;
	text-transform: uppercase;
}

.sbc-cr__table tbody tr:hover .sbc-cr__cell {
	background: #eef6f7;
}

.sbc-cr__row--hidden {
	display: none;
}

.sbc-cr__col--hidden {
	display: none;
}

.sbc-cr__footer {
	color: var(--sbc-cr-muted);
	font-size: 0.85rem;
	margin-top: 1rem;
}

/* ----------------------------------------------------------------- modal */

.sbc-cr__modal[hidden] {
	display: none;
}

.sbc-cr__modal {
	align-items: center;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 1rem;
	position: fixed;
	z-index: 100000;
}

.sbc-cr__modal-backdrop {
	background: rgba(7, 34, 40, 0.6);
	inset: 0;
	position: absolute;
}

.sbc-cr__modal-box {
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
	max-height: 90vh;
	max-width: 34rem;
	overflow: auto;
	padding: 1.5rem 1.5rem 1.75rem;
	position: relative;
	width: 100%;
}

.sbc-cr__modal-x {
	background: none;
	border: 0;
	color: var(--sbc-cr-muted);
	cursor: pointer;
	font-size: 1.6rem;
	line-height: 1;
	padding: 0.2rem 0.4rem;
	position: absolute;
	right: 0.5rem;
	top: 0.5rem;
}

.sbc-cr__modal-title {
	color: var(--sbc-cr-head);
	font-size: 1.3rem;
	margin: 0 1.5rem 0.5rem 0;
}

.sbc-cr__modal-body {
	color: var(--sbc-cr-muted);
	margin-bottom: 1rem;
}

.sbc-cr__modal-links {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}

.sbc-cr__modal-links li {
	margin: 0 0 0.4rem;
}

.sbc-cr__modal-link {
	background: #f2f7f8;
	border: 1px solid var(--sbc-cr-line);
	border-radius: 4px;
	color: var(--sbc-cr-head);
	display: block;
	font-weight: 600;
	padding: 0.6rem 0.75rem;
	text-decoration: none;
}

.sbc-cr__modal-link:hover,
.sbc-cr__modal-link:focus {
	background: var(--sbc-cr-head);
	border-color: var(--sbc-cr-head);
	color: #fff;
}

.sbc-cr__modal-link--button {
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	text-align: left;
	width: 100%;
}

.sbc-cr__embed-pane {
	border-top: 1px solid var(--sbc-cr-line);
	margin-top: 1rem;
	padding-top: 1rem;
}

.sbc-cr__embed-title {
	font-size: 1rem;
	margin: 0 0 0.25rem;
}

.sbc-cr__embed-help {
	color: var(--sbc-cr-muted);
	font-size: 0.85rem;
	margin: 0 0 0.5rem;
}

.sbc-cr__embed-code {
	border: 1px solid var(--sbc-cr-line);
	border-radius: 4px;
	font-family: Consolas, Monaco, "Courier New", monospace;
	font-size: 0.75rem;
	padding: 0.5rem;
	width: 100%;
}

/* ----------------------------------------------------------- embed shell */

body.sbc-cr-embed-body {
	background: #fff;
	margin: 0;
	padding: 0;
}

.sbc-cr-embed {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	padding: 1rem;
}

.sbc-cr-embed__brand {
	border-top: 1px solid var(--sbc-cr-line, #d5dde0);
	color: #5d7076;
	font-size: 0.8rem;
	margin: 1rem 0 0;
	padding-top: 0.6rem;
}

.sbc-cr-embed__brand a {
	color: #0a6a75;
	font-weight: 600;
}

/* ---------------------------------------------------------------- mobile */

@media ( max-width: 768px ) {

	/* Contain the table's width so mobile browsers keep a device-width
	   viewport; the header freeze inside the wrapper is done in JS. */
	.sbc-cr__scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Native sticky would pin against the wrapper itself and fight the
	   JS freeze — disable it here; the translate does the freezing. */
	.sbc-cr__th {
		position: relative;
		top: 0;
	}

	.sbc-cr__th--topic {
		position: sticky;
		left: 0;
		top: 0;
	}
}

@media ( max-width: 640px ) {

	.sbc-cr__th {
		min-width: 9rem;
	}

	.sbc-cr__th--topic {
		min-width: 10rem;
	}

	.sbc-cr__table th,
	.sbc-cr__table td {
		font-size: 0.82rem;
		padding: 0.4rem 0.5rem;
	}
}

/* ----------------------------------------------------------------- print */

@media print {
	.sbc-cr__tools,
	.sbc-cr__toggles,
	.sbc-cr__tabs,
	.sbc-cr__modal {
		display: none !important;
	}

	.sbc-cr__table-wrap.is-hidden {
		display: block !important;
	}

	.sbc-cr__scroll {
		border: 0;
		max-height: none;
		overflow: visible;
	}

	.sbc-cr__table {
		font-size: 8pt;
	}

	.sbc-cr__th,
	.sbc-cr__topic,
	.sbc-cr__section {
		position: static;
	}

	.sbc-cr__th {
		-webkit-print-color-adjust: exact;
		background: #074a53 !important;
		color: #fff !important;
		print-color-adjust: exact;
	}

	.sbc-cr__topic {
		-webkit-print-color-adjust: exact;
		background: #0e8b98 !important;
		color: #fff !important;
		print-color-adjust: exact;
	}

	.sbc-cr__th--draft {
		-webkit-print-color-adjust: exact;
		background: #0a5f57 !important;
		print-color-adjust: exact;
	}

	.sbc-cr__badge {
		border-color: #fff !important;
		color: #fff !important;
	}

	.sbc-cr__cell--draft {
		-webkit-print-color-adjust: exact;
		background: #fff3e4 !important;
		border-left: 2pt solid #b4530a !important;
		print-color-adjust: exact;
	}

	.sbc-cr__table thead {
		display: table-header-group;
	}

	.sbc-cr__table tr {
		break-inside: avoid;
		page-break-inside: avoid;
	}
}
