/*
 * «Вибіркові дисципліни» (templates/pages/education/page-elective-courses.php).
 *
 * Laid out as the programmes' catalog (page-programs.css) in its list view,
 * with its measures: the site's page header with the search, the dropdowns
 * and the count under it and one grey line below them all; then each list as
 * a table with a navy header row and a light frame. The paper is the
 * semantic tokens, so the dark theme comes by itself; the lines and the blue
 * of words are local properties with their dark values.
 */

.elc {
	--elc-line: var(--color-border);
	--elc-rule: var(--color-grey-200);
	--elc-accent: var(--color-blue-100);
	--elc-open: rgba(var(--color-tint--rgb), 0.05);
}

html[data-theme="dark"] .elc {
	--elc-rule: var(--color-border-strong);
	--elc-accent: var(--color-blue-030);
}

/* ---------------------------------------------------------------- header */

/* The site places the first section under its fixed header and keeps 1.25rem
   between the header's parts (css-blocks/header/page-header.css). */
.elc-header {
	padding: 0 var(--wrap);
}

.elc-header__inner {
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--elc-rule);
}

/* --------------------------------------------------------------- filters */

.elc-filters[hidden] {
	display: none;
}

.elc-filters {
	display: grid;
	gap: 1rem;
}

.elc-filters__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
}

.elc-filters__field {
	flex: 1 1 180px;
	min-width: 0;
}

/* Two classes: the reset's input[type="search"] sets content-box and outranks one. */
.elc-filters .elc-filters__input,
.elc-filters .elc-filters__select {
	box-sizing: border-box;
	width: 100%;
	border: 1px solid var(--elc-line);
	border-radius: 0;
	background-color: var(--color-bg-primary);
	color: var(--color-text-primary);
	font: inherit;
}

/* search.css gives every input on a wide screen padding-bottom: 0.5rem !important. */
.elc-filters .elc-filters__input {
	height: 40px;
	padding: 0 12px !important;
	font-size: 0.95rem;
	line-height: normal;
}

.elc-filters .elc-filters__input::placeholder {
	color: var(--color-text-muted);
	font-size: inherit;
}

.elc-filters .elc-filters__select {
	height: 44px;
	padding: 0 34px 0 0.85rem;
	font-size: 0.85rem;
	font-weight: 500;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%2386939b'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 12px;
	cursor: pointer;
	text-overflow: ellipsis;
}

.elc-filters__input:focus,
.elc-filters__select:focus {
	outline: none;
	border-color: var(--elc-accent);
}

/* The reset, as the programmes' (page-programs.css): red-tinted, with a cross. */
.elc {
	--elc-reset: #dc2626;
	--elc-reset-bg: #fef2f2;
	--elc-reset-bg-hover: #fee2e2;
	--elc-reset-border: #fca5a5;
	--elc-reset-border-hover: #f87171;
}

html[data-theme="dark"] .elc {
	--elc-reset: #f87171;
	--elc-reset-bg: rgba(248, 113, 113, 0.12);
	--elc-reset-bg-hover: rgba(248, 113, 113, 0.2);
	--elc-reset-border: rgba(248, 113, 113, 0.4);
	--elc-reset-border-hover: #f87171;
}

.elc-filters__reset {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 0.4rem;
	box-sizing: border-box;
	height: 44px;
	padding: 0 0.85rem;
	border: 1px solid var(--elc-reset-border);
	background: var(--elc-reset-bg);
	color: var(--elc-reset);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.elc-filters__reset:hover {
	background: var(--elc-reset-bg-hover);
	border-color: var(--elc-reset-border-hover);
}

.elc-filters__reset svg {
	flex: none;
	width: 18px;
	height: 18px;
}

.elc .elc-filters__reset-text {
	font-size: inherit;
	line-height: 1;
}

.elc-filters__reset[hidden] {
	display: none;
}

/* The count, as the programmes' «Показано …». */
.elc-header__bottom {
	display: flex;
	align-items: center;
	min-height: 40px;
}

.elc .elc-count {
	margin: 0;
	color: var(--color-text-secondary);
	font-size: 0.95rem;
	font-weight: 600;
}

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

/* The site gives every section a large top margin; the lists follow the
   header, 1.25rem under its line (the header's own margin), as the programmes do. */
.elc-catalog {
	margin-top: 0 !important;
	padding: 0 var(--wrap) 5rem !important;
}

.elc .elc-empty {
	margin: 0;
	padding: 2rem 0;
	border: 1px solid var(--elc-line);
	color: var(--color-text-secondary);
	text-align: center;
}

.elc-empty[hidden] {
	display: none;
}

/* A list's heading is a bar in the table's frame, open or folded alike, so
   the lists line up whatever their state: an open one has its table right
   under the bar; folded ones in a row close up into one index. */
.elc-list + .elc-list {
	margin-top: 1.5rem;
}

.elc-list__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 24px;
	padding: 0.9rem 1.5rem;
	border: 1px solid var(--elc-line);
	border-bottom: 0;
	background: var(--color-surface-card);
}

/* The list's level and form follow its name on the same line, quieter. */
.elc .elc-list__level {
	margin-left: 0.6rem;
	padding-left: 0.6rem;
	border-left: 1px solid var(--elc-line);
	color: var(--color-text-muted);
	font-size: 0.95rem;
	font-weight: 400;
	white-space: nowrap;
}

.elc .elc-list__title {
	margin: 0;
	color: var(--color-text-heading);
	font-size: 1.25rem;
	font-weight: 500;
	line-height: 1.3;
}

.elc .elc-list__title a {
	color: inherit;
	text-decoration: none;
}

.elc .elc-list__title a:hover {
	color: var(--elc-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.elc .elc-list__choose {
	margin: 0;
	color: var(--color-text-secondary);
	font-size: 0.95rem;
}

.elc-list__choose strong {
	color: var(--color-text-heading);
}

.elc .elc-list__note {
	margin: 0;
	padding: 0 1.5rem 0.9rem;
	border: 1px solid var(--elc-line);
	border-top: 0;
	border-bottom: 0;
	background: var(--color-surface-card);
	color: var(--color-text-secondary);
	font-size: 0.95rem;
}

/* The table, as the programmes' list view: a navy header row with white
   words, the rows in a light frame and parted by it, 1rem between columns,
   1.5rem from the frame. */
.elc-t {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: 0.9rem;
	line-height: 1.45;
}

.elc-t th,
.elc-t td {
	padding: 1rem 0.5rem;
	border: 0;
	color: var(--color-text-primary);
	text-align: left;
	vertical-align: middle;
	font-weight: 400;
	overflow-wrap: anywhere;
}

.elc-t thead th {
	background: var(--color-blue-200);
	color: var(--color-white);
	font-weight: 600;
}

.elc-t th:first-child,
.elc-t td:first-child {
	padding-left: 1.5rem;
}

.elc-t th:last-child,
.elc-t td:last-child {
	padding-right: 1.5rem;
}

.elc-t tbody tr {
	border-bottom: 1px solid var(--elc-line);
}

.elc-t tbody td:first-child {
	border-left: 1px solid var(--elc-line);
}

.elc-t tbody td:last-child {
	border-right: 1px solid var(--elc-line);
}

/* Widths: the name takes what is left. */
.elc-t__n {
	width: 4.5rem;
}

.elc-t__dept {
	width: 26%;
}

.elc-t__num {
	width: 7.5rem;
}

.elc-t__sem {
	width: 7.5rem;
}

.elc-t__ctl {
	width: 10rem;
}

.elc-t tbody .elc-t__n {
	color: var(--color-text-muted);
}

.elc-t__row {
	cursor: pointer;
}

.elc-t__row:hover > *,
.elc-t__row.is-open > * {
	background: var(--elc-open);
}

/* The name is the row's button: it says the row opens, to a keyboard too. */
.elc-t__toggle {
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-text-heading);
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.elc-t__toggle:hover,
.elc-t__row.is-open .elc-t__toggle {
	color: var(--elc-accent);
}

.elc-t__toggle:focus-visible {
	outline: 2px solid var(--elc-accent);
	outline-offset: 2px;
}

/* A department in a row is a link to its page. */
.elc .elc-t__link {
	color: inherit;
	text-decoration: none;
}

.elc .elc-t__link:hover {
	color: var(--elc-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* The opened row: under the name, from the line above it by the row's own
   padding. The cells have none above and below: the box inside keeps it, so
   that the height of .elc-more alone carries the row open and shut. */
.elc-t .elc-t__more > td {
	padding-top: 0;
	padding-bottom: 0;
	background: var(--elc-open);
}

/* Opened: the annotation across, the facts under it in one strip. */
.elc-more__in {
	display: flow-root;
	padding: 1rem 0 1.25rem;
}

/* The facts: equal cells parted by the table's hairlines (the strip's
   background shows through a 1px gap), a small label over each value. */
.elc-facts {
	display: inline-grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(7.5rem, max-content);
	gap: 1px;
	max-width: 100%;
	margin: 0.9rem 0 0;
	border: 1px solid var(--elc-line);
	background: var(--elc-line);
}

.elc-facts__cell {
	margin: 0;
	padding: 0.55rem 0.8rem;
	background: var(--color-surface-card);
}

.elc-facts__cell--wide {
	min-width: 12rem;
}

.elc-facts__cell--total {
	background: rgba(var(--color-tint--rgb), 0.06);
	background-color: color-mix(in srgb, var(--color-surface-card) 94%, var(--color-text-heading));
}

.elc-facts dt {
	margin: 0 0 2px;
	color: var(--color-text-secondary);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
}

.elc-facts dd {
	margin: 0;
	color: var(--color-text-heading);
	font-size: 0.95rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.elc-facts__cell--wide dd {
	font-weight: 400;
}

.elc-facts__sep {
	color: var(--color-text-muted);
}

/* The annotation comes from an editor: paragraphs, lists, links. */
.elc .elc-more__text {
	max-width: 80ch;
	margin: 0 0 0.75rem;
	color: var(--color-text-primary);
}

.elc .elc-more__text > :first-child {
	margin-top: 0;
}

.elc .elc-more__text > :last-child {
	margin-bottom: 0;
}

.elc .elc-more__text p,
.elc .elc-more__text ul,
.elc .elc-more__text ol {
	margin: 0 0 0.6em;
}

.elc .elc-more__text ul,
.elc .elc-more__text ol {
	padding-left: 1.25em;
}

.elc .elc-more__text a {
	color: var(--elc-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* A name with an address of its own: the link, in the name's own look. */
.elc .elc-t__title {
	color: var(--color-text-heading);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--elc-line);
	text-underline-offset: 4px;
}

.elc .elc-t__title:hover {
	color: var(--elc-accent);
	text-decoration-color: currentColor;
}

.elc .elc-more__text--none {
	color: var(--color-text-muted);
	font-style: italic;
}

/* «Анотацію ще не додано», said once on .elc-catalog. */
.elc-more__text--none::before {
	content: var(--elc-l-none);
}

.elc .elc-link {
	color: var(--elc-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.elc .elc-link:hover {
	text-decoration-thickness: 2px;
}

/* A discipline opened from its link stops below the site's fixed header. */
.elc-t__row {
	scroll-margin-top: calc(var(--header-height-1px, 120px) + 24px);
}

/* ---------------------------------------------------------------- narrow */

/*
 * On a phone a row is a block in the frame: the name, then its cells as
 * «label: value»; the header row goes, its words come from data-label.
 */
@media (max-width: 767px) {
	.elc-t,
	.elc-t tbody,
	.elc-t tr,
	.elc-t th,
	.elc-t td {
		display: block;
		width: auto;
	}

	.elc-t thead {
		display: none;
	}

	.elc-t tbody {
		border: 1px solid var(--elc-line);
		border-bottom: 0;
	}

	.elc-t__row {
		padding: 12px 16px;
	}

	.elc-t .elc-t__row > *,
	.elc-t .elc-t__more > td {
		padding: 0;
		border: 0 !important;
		background: none !important;
	}

	.elc-t__n {
		display: none !important;
	}

	.elc-t__name {
		margin-bottom: 4px;
	}

	.elc-t__row td {
		display: flex;
		gap: 8px;
		font-size: 0.875rem;
	}

	.elc-t__row td:empty {
		display: none !important;
	}

	/* The numbers side by side: «Кредити: 3  Години: 90  Семестр: 5». */
	.elc-t__row td.elc-t__num,
	.elc-t__row td.elc-t__sem,
	.elc-t__row td.elc-t__ctl {
		display: inline-flex;
		gap: 6px;
		margin: 2px 16px 0 0;
	}

	/* The labels are said once, on .elc-catalog (--elc-l-*), not in every row. */
	.elc-t__row td::before {
		content: var(--elc-l-dept) ":";
		flex: 0 0 6.5em;
		color: var(--color-text-secondary);
		font-weight: 600;
	}

	.elc-t__row td.elc-t__num::before,
	.elc-t__row td.elc-t__sem::before,
	.elc-t__row td.elc-t__ctl::before {
		flex: none;
	}

	.elc-t__row td:nth-child(4)::before {
		content: var(--elc-l-cr) ":";
	}

	.elc-t__row td:nth-child(5)::before {
		content: var(--elc-l-h) ":";
	}

	.elc-t__row td.elc-t__sem::before {
		content: var(--elc-l-sem) ":";
	}

	.elc-t__row td.elc-t__ctl::before {
		content: var(--elc-l-ctl) ":";
	}

	.elc-t .elc-t__more > td {
		padding: 0 16px 14px !important;
	}

	.elc-filters__field {
		flex-basis: calc(50% - 0.5rem);
	}

	.elc-list__head {
		display: block;
	}

	.elc .elc-list__choose {
		margin-top: 4px;
	}
}

/* ------------------------------------------------------------------ tabs */

/* A tab is a link to an address of its own (?kind=…). */
.elc-tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--elc-line);
}

.elc-tabs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.elc-tabs__list li {
	margin: 0;
	padding: 0;
}

.elc .elc-tabs__tab {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	padding: 0.75rem 0;
	margin-bottom: -1px;
	border-bottom: 3px solid transparent;
	color: var(--color-text-secondary);
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.elc .elc-tabs__tab:hover {
	color: var(--color-text-heading);
}

.elc .elc-tabs__tab[aria-current="page"] {
	border-bottom-color: var(--color-blue-200);
	color: var(--color-text-heading);
	font-weight: 600;
}

html[data-theme="dark"] .elc .elc-tabs__tab[aria-current="page"] {
	border-bottom-color: var(--elc-accent);
}

.elc .elc-tabs__tab.is-empty {
	opacity: 0.5;
}

.elc-tabs__count {
	color: var(--color-text-muted);
	font-size: 0.85rem;
	font-weight: 400;
}

.elc-tabs__all {
	margin-bottom: 0.6rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-link);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
}

.elc-tabs__all:hover {
	text-decoration: underline;
}

.elc-tabs__all[hidden] {
	display: none;
}

/* --------------------------------------------------------------- folding */

.elc-list[hidden],
.elc-t tr[hidden] {
	display: none;
}

.elc-list__side {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 1.25rem;
}

.elc-list__fold {
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-link);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
}

.elc-list__fold:hover {
	text-decoration: underline;
}

.elc-list__fold[hidden] {
	display: none;
}

.elc-js .elc-list__head {
	cursor: pointer;
}

/* A folded list is a closed table: its heading in the table's frame, the
   folded lists stacked one on another like the rows of an index. */
.elc-list.is-folded .elc-list__body:not(.is-moving) {
	display: none;
}

.elc-list.is-folded .elc-list__head {
	border-bottom: 1px solid var(--elc-line);
}

.elc-js .elc-list__head:hover {
	background: var(--elc-open);
}

.elc-list.is-folded + .elc-list.is-folded {
	margin-top: 0;
}

.elc-list.is-folded + .elc-list.is-folded .elc-list__head {
	border-top: 0;
}

.elc-js .elc-list__head:hover .elc-list__title {
	color: var(--elc-accent);
}

/* A row's annotation shows when the row is opened; without the script, always. */
.elc-js .elc-t__more:not(.is-shown) {
	display: none;
}

.elc-js .elc-t__row.is-open > * {
	background: var(--elc-open);
}

/* ---------------------------------------------------------------- motion */

/* A list or a row folding: the script carries the box's height (and a fade)
   on a spring; meanwhile the box clips what is past its edge. Only the
   height clips: sideways the table's borders, drawn half outside it, stay. */
.elc-list__body.is-moving,
.elc-more.is-moving {
	overflow: hidden;
}

@supports (overflow: clip) {
	.elc-list__body.is-moving,
	.elc-more.is-moving {
		overflow: visible;
		overflow-y: clip;
	}
}

/* Two folded lists close up to one index; the gap closes with the fold
   between them rather than at once. */
.elc-list {
	transition: margin-top 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.elc-js .elc-t__row > * {
	transition: background-color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
	.elc-list,
	.elc-js .elc-t__row > * {
		transition: none;
	}
}

/* ------------------------------------------------------------- dropdowns */

/* The programmes' dropdowns (page-programs.css, .custom-dropdown), drawn by
   the script over the real <select>, which stays for the value. */
.elc-dd {
	position: relative;
	width: 100%;
}

.elc-js .elc-dd__native {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.elc-dd__button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	width: 100%;
	height: 44px;
	padding: 0 0.85rem;
	border: 1px solid var(--elc-line);
	border-radius: 0;
	background: var(--color-surface-card);
	color: var(--color-text-primary);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.elc-dd__button:hover {
	border-color: var(--color-text-muted);
}

.elc-dd__button:focus-visible {
	outline: none;
	border-color: var(--elc-accent);
}

.elc-dd.is-open .elc-dd__button {
	box-shadow: 0 0 0 3px rgba(var(--color-blue-200--rgb), 0.05);
}

.elc-dd.has-value .elc-dd__button {
	color: var(--color-text-heading);
}

.elc-dd__value {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.elc-dd__arrow {
	flex-shrink: 0;
	margin-left: 10px;
	color: var(--color-text-secondary);
	font-size: 0.8rem;
	transition: transform 0.3s ease;
}

.elc-dd.is-open .elc-dd__arrow {
	transform: rotate(180deg);
	color: var(--color-text-heading);
}

.elc-dd__list {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 50;
	box-sizing: border-box;
	max-height: 300px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	border: 1px solid var(--elc-line);
	border-top: 0;
	background: var(--color-surface-card);
	box-shadow: 0 10px 25px rgba(var(--color-blue-200--rgb), 0.08);
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-5px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.elc-dd.is-open .elc-dd__list {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.elc-dd__list::-webkit-scrollbar {
	width: 6px;
}

.elc-dd__list::-webkit-scrollbar-thumb {
	background-color: var(--color-border);
}

.elc-dd__item {
	margin: 0;
	padding: 10px 16px;
	border-bottom: 1px solid var(--color-bg-secondary);
	color: var(--color-text-primary);
	font-size: 0.85rem;
	line-height: 1.4;
	cursor: pointer;
}

.elc-dd__item:last-child {
	border-bottom: 0;
}

.elc-dd__item:hover,
.elc-dd__item.is-active {
	background: var(--color-bg-secondary);
	color: var(--color-text-heading);
}

.elc-dd__item[aria-selected="true"] {
	font-weight: 600;
	color: var(--color-text-heading);
}

/* ------------------------------------------------------------ tab switch */

/* One line slides to the current tab (the script places it); the tab's own
   underline stays for a page without the script. */
.elc-tabs__list {
	position: relative;
}

.elc-tabs.has-ink .elc-tabs__tab[aria-current="page"] {
	border-bottom-color: transparent !important;
}

.elc-tabs__ink {
	position: absolute;
	left: 0;
	bottom: -1px;
	height: 3px;
	background: var(--color-blue-200);
	pointer-events: none;
	transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html[data-theme="dark"] .elc-tabs__ink {
	background: var(--elc-accent);
}

.elc .elc-tabs__tab {
	transition: color 0.2s ease;
}

/* A tab still on its way: the old one fades a little until it is swapped. */
.elc-panel {
	transition: opacity 0.15s ease;
}

.elc-panel.is-loading {
	opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
	.elc-tabs__ink,
	.elc-panel,
	.elc-dd__list,
	.elc-dd__arrow {
		transition: none;
	}
}

/* The site sizes a <span> inside a button down to 10px; here it is the button's text. */
.elc-dd .elc-dd__value,
.elc-dd .elc-dd__arrow {
	font-size: inherit;
	line-height: 1.4;
}

.elc-dd .elc-dd__arrow {
	font-size: 0.8em;
}

/* On a phone the tabs are one row that scrolls sideways, so the line under
   the current one stays under it. */
@media (max-width: 767px) {
	.elc-tabs {
		display: block;
	}

	.elc-tabs__list {
		flex-wrap: nowrap;
		gap: 0 1.25rem;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.elc-tabs__list::-webkit-scrollbar {
		display: none;
	}

	.elc-tabs__all {
		margin: 0.5rem 0 0.6rem;
	}
}

/* ---------------------------------------------------------- more filters */

.elc-filters__more-toggle {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 0.4rem;
	box-sizing: border-box;
	height: 44px;
	padding: 0 0.85rem;
	border: 1px solid var(--elc-line);
	background: var(--color-surface-card);
	color: var(--color-text-primary);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
}

.elc-filters__more-toggle:hover,
.elc-filters__more-toggle.is-open {
	border-color: var(--color-text-muted);
	color: var(--color-text-heading);
}

.elc-filters__more-toggle::after {
	content: "▾";
	font-size: 0.8em;
	color: var(--color-text-secondary);
	transition: transform 0.3s ease;
}

.elc-filters__more-toggle.is-open::after {
	transform: rotate(180deg);
}

.elc .elc-filters__more-count {
	min-width: 1.25rem;
	padding: 0 0.3rem;
	background: var(--color-blue-200);
	color: var(--color-white);
	font-size: 0.75rem;
	line-height: 1.25rem;
	text-align: center;
}

.elc-filters__more-count[hidden],
.elc-filters__more[hidden] {
	display: none;
}

/* ---------------------------------------------------------------- sorting */

/* The heading of a column is its button; the triangles as the programmes'
   list view draws them: a faint one up, the chosen one bright and turned. */
/* The whole cell is the button, as the programmes' headings are; the
   triangle follows the words, so it is clearly this column's. */
.elc-t__sort {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.elc-t__sort::after {
	content: "";
	display: inline-block;
	margin: 0 0 3px 6px;
	vertical-align: middle;
	border: 5px solid transparent;
	border-bottom-color: currentColor;
	opacity: 0.4;
}

.elc-t__n .elc-t__sort::after {
	display: none;
}

th.is-sorted .elc-t__sort::after {
	opacity: 1;
}

th.is-sorted.is-desc .elc-t__sort::after {
	margin-bottom: -5px;
	border-bottom-color: transparent;
	border-top-color: currentColor;
}

.elc-t__sort:focus-visible {
	outline: 2px solid var(--color-white);
	outline-offset: 2px;
}

/* ----------------------------------------------------------- section bar */

/* A list reached from the bar stops below the header and the bar
   (section-subnav.js measures both). */
.elc-list,
.elc-t__row {
	scroll-margin-top: calc(var(--dept-header-h, var(--header-height-1px, 120px)) + var(--dept-subnav-h, 0px) + 16px);
}

@media (max-width: 767px) {
	.elc .elc-list__level {
		display: block;
		margin: 2px 0 0;
		padding: 0;
		border: 0;
		font-size: 0.875rem;
	}

	.elc-filters__more-toggle,
	.elc-filters__reset {
		flex: 1 1 calc(50% - 0.5rem);
		justify-content: center;
	}
}

@media (max-width: 767px) {
	.elc-list__head {
		padding: 0.75rem 1rem;
	}

	.elc .elc-list__note {
		padding: 0 1rem 0.75rem;
	}
}

/* ----------------------------------------------------------- performance */

/* A tab of 800 rows: the lists off screen are not laid out or painted until
   they come near; their size is remembered once seen, so the scrollbar and
   the links to them stay where they are. Find in page still finds them. */
.elc-list {
	content-visibility: auto;
	contain-intrinsic-size: auto 600px;
}

/* A folded list is one line: nothing to save, and the skipping clips the
   line it shares with its neighbour in the index. */
.elc-list.is-folded {
	content-visibility: visible;
}

@media (max-width: 767px) {
	.elc-facts {
		display: grid;
		grid-auto-flow: row;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.elc-facts__cell--wide {
		grid-column: 1 / -1;
		min-width: 0;
	}
}

/* ----------------------------------------------------------------- phone */

/* The search and, on a phone, the button that opens the filters beside it. */
.elc-filters__top {
	display: flex;
	gap: 0.75rem;
}

.elc-filters__top .elc-filters__search {
	flex: 1 1 auto;
}

.elc-filters__panel {
	display: grid;
	gap: 1rem;
}

.elc-filters__toggle {
	display: none;
	flex: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--elc-line);
	border-radius: 0;
	background: var(--color-surface-card);
	color: var(--color-text-secondary);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.elc-filters__toggle[aria-expanded="true"] {
	border-color: var(--color-blue-200);
	background: var(--color-blue-200);
	color: var(--color-white);
}

.elc .elc-filters__toggle-count {
	min-width: 1.25rem;
	padding: 0 0.3rem;
	background: var(--color-blue-200);
	color: var(--color-white);
	font-size: 0.75rem;
	line-height: 1.25rem;
	text-align: center;
}

.elc-filters__toggle[aria-expanded="true"] .elc-filters__toggle-count {
	background: var(--color-white);
	color: var(--color-blue-200);
}

.elc-filters__toggle-count[hidden] {
	display: none;
}

@media (max-width: 767px) {
	.elc-filters__toggle {
		display: inline-flex;
	}

	/* The filters wait behind the button, as on the programmes' page. */
	.elc-js .elc-filters:not(.is-open) .elc-filters__panel {
		display: none;
	}

	.elc-filters .elc-filters__field {
		flex-basis: 100%;
	}

	/* A discipline is a compact card: its name, its department in grey, then
	   the numbers as small framed words — «3 кред.», «90 год.», «сем. 5». */
	.elc-t__row {
		padding: 12px 16px;
	}

	.elc-t__row td::before {
		content: none !important;
	}

	.elc-t__row td.elc-t__dept {
		display: block;
		margin: 3px 0 8px;
		color: var(--color-text-secondary);
		font-size: 0.85rem;
	}

	.elc-t__row td.elc-t__num,
	.elc-t__row td.elc-t__sem,
	.elc-t__row td.elc-t__ctl {
		display: inline-flex;
		gap: 0;
		margin: 0 6px 4px 0;
		padding: 1px 7px !important;
		border: 1px solid var(--elc-line) !important;
		background: var(--color-surface-card) !important;
		color: var(--color-text-secondary);
		font-size: 0.8rem;
		line-height: 1.5;
	}

	.elc-t__row td:nth-child(4)::after {
		content: "\00a0" var(--elc-s-cr);
	}

	.elc-t__row td:nth-child(5)::after {
		content: "\00a0" var(--elc-s-h);
	}

	.elc-t__row td.elc-t__sem::before {
		content: var(--elc-s-sem) "\00a0" !important;
		flex: none;
		color: inherit;
		font-weight: 400;
	}

	.elc-t__row.is-open {
		background: var(--elc-open);
	}

	.elc-list__head .elc-list__side {
		margin-top: 6px;
	}
}

/* The site sizes a <span> inside a button down to 10px; these are the buttons' words. */
.elc-filters__toggle span:not(.elc-filters__toggle-count),
.elc-filters__more-toggle > span:not(.elc-filters__more-count) {
	font-size: inherit;
	line-height: 1.2;
}

.elc .elc-filters__toggle-count,
.elc .elc-filters__more-count {
	font-size: 0.75rem;
}

/* ------------------------------------------------- phone: lists and tabs */

@media (max-width: 767px) {
	/* A list's heading is a navy band, as the table's head is on a wide
	   screen: it reads as a heading, its disciplines as the rows under it. */
	.elc-list__head,
	.elc-js .elc-list__head:hover {
		padding: 12px 14px;
		border-color: var(--color-blue-200);
		background: var(--color-blue-200);
	}

	.elc .elc-list__title,
	.elc .elc-list__title a,
	.elc-js .elc-list__head:hover .elc-list__title {
		color: var(--color-white);
	}

	.elc .elc-list__level {
		color: rgba(255, 255, 255, 0.7);
	}

	.elc .elc-list__choose {
		color: rgba(255, 255, 255, 0.85);
	}

	.elc-list__choose strong {
		color: var(--color-white);
	}

	.elc .elc-list__fold {
		color: var(--color-white);
		text-decoration: underline;
		text-underline-offset: 3px;
	}

	.elc .elc-list__note {
		padding: 10px 0;
		border: 0;
		background: none;
	}

	/* Folded, the bands stack into one index. */
	.elc-list.is-folded .elc-list__head {
		border-bottom-color: var(--color-blue-200);
	}

	.elc-list.is-folded + .elc-list.is-folded .elc-list__head {
		border-top: 1px solid rgba(255, 255, 255, 0.18);
	}

	/* The rows start where the search and the filters above start. */
	.elc-t tbody {
		border-right: 0;
		border-left: 0;
	}

	.elc-t__row {
		padding: 12px 0;
	}

	.elc-t .elc-t__more > td {
		padding: 0 !important;
	}

	.elc-more__in {
		padding: 0.75rem 0 14px;
	}

	/* The kinds of lists scroll sideways: the edge that has more fades out. */
	.elc-tabs__list.has-more-right {
		-webkit-mask-image: linear-gradient(to right, #000 78%, transparent);
		mask-image: linear-gradient(to right, #000 78%, transparent);
	}

	.elc-tabs__list.has-more-left {
		-webkit-mask-image: linear-gradient(to right, transparent, #000 22%);
		mask-image: linear-gradient(to right, transparent, #000 22%);
	}

	.elc-tabs__list.has-more-left.has-more-right {
		-webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 78%, transparent);
		mask-image: linear-gradient(to right, transparent, #000 18%, #000 78%, transparent);
	}
}
