/* Styles added by the theme on top of the prototype stylesheet.
   main.css stays a verbatim copy of the design, so anything new lives here. */

/* Copy-link control in the article share row — styled to read as a link. */
.share .le-copy-link {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
}
.share .le-copy-link:hover { color: var(--blue); }

/* ---- article: date and share row under the cover --------------------------
   The design closes the article with the share row; it now sits under the
   cover with the publication date in front, so it loses its top rule and
   spacing and takes a rule underneath instead. */
.art-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 18px;
	margin-top: 18px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--line);
	font-size: 14.5px;
	color: var(--muted);
}

.art-meta .share {
	flex-wrap: wrap;
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

/* Without a table of contents the design still reserved its 300px column,
   which left the article hugging the left edge beside empty space. It is
   one centred column instead; the breadcrumbs above keep the page's edge. */
.art-wrap--solo {
	grid-template-columns: minmax(0, 1fr);
	max-width: calc(820px + 2 * var(--pad));
}

/* The text comes from a "Текст" section after the header (single.php marks
   the header .le-art-bare). Without this the two sections' paddings stacked
   into ~170px of air under the share row, and the text was wider than the
   article above it. It takes the same centred column. */
.le-art-bare { padding-bottom: 0; }
.le-art-bare + section { padding-top: 10px; }
.le-art-bare + section[data-block="prose"] > .wrap { max-width: calc(820px + 2 * var(--pad)); }

/* Links in running text: brand blue with a light-blue underline, so a source
   or a reference reads as clickable. Buttons keep their own look. */
.prose a:not(.btn) {
	color: var(--blue);
	text-decoration: underline;
	text-decoration-color: var(--sky);
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
	transition: color .15s, text-decoration-color .15s;
}

.prose a:not(.btn):hover {
	color: var(--navy);
	text-decoration-color: currentColor;
}

/* ---- price catalogue rows -------------------------------------------------
   Each group opens onto a plain table: article, name, price. The prototype's
   expandable row (term, biomaterial, preparation) is gone — the list only
   carries what the lab supplies. Fixed side columns keep every article and
   every price on one vertical edge down the whole list. */

.ptbl {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
}

.ptbl th {
	padding: 11px 22px;
	font-size: 13px;
	font-weight: 400;
	text-align: left;
	color: var(--muted);
	background: var(--pale);
	border-bottom: 1px solid var(--line);
}

.ptbl td {
	padding: 14px 22px;
	vertical-align: baseline;
	border-bottom: 1px solid var(--line);
}

.ptbl tbody tr:last-child td { border-bottom: 0; }
.ptbl tbody tr { transition: background .15s; }
.ptbl tbody tr:hover { background: var(--pale); }

.ptbl .pc-code {
	width: 112px;
	padding-right: 0;
	white-space: nowrap;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.ptbl .pc-price {
	width: 128px;
	text-align: right;
	white-space: nowrap;
}

.ptbl td.pc-price {
	font-weight: 600;
	color: var(--navy);
}

/* No price yet: a quiet dash rather than a bold one. */
.ptbl td.pc-price.is-none {
	font-weight: 400;
	color: var(--muted);
}

/* On a phone three columns leave the name about 170px and every test wraps to
   four lines. Each row becomes a two-column grid instead: the article as a
   small line above the name, the price on the right. */
@media (max-width: 620px) {
	.ptbl { font-size: 15px; }

	.ptbl tr {
		display: grid;
		grid-template-columns: 1fr auto;
		column-gap: 16px;
		padding: 12px 14px;
		border-bottom: 1px solid var(--line);
	}

	.ptbl thead tr { background: var(--pale); }
	.ptbl tbody tr:last-child { border-bottom: 0; }

	.ptbl th,
	.ptbl td {
		display: block;
		width: auto;
		padding: 0;
		border: 0;
		background: none;
	}

	.ptbl .pc-code,
	.ptbl .pc-name { grid-column: 1; }
	.ptbl .pc-price { grid-column: 2; grid-row: 1 / span 2; width: auto; }
	.ptbl .pc-code { width: auto; font-size: 13px; }
	.ptbl th.pc-code,
	.ptbl td.pc-code:empty { display: none; }
}

/* ---- illustrations in frames ----------------------------------------------
   The scene symbols' backdrops run past their drawing (see svg-sprite.php),
   so the <svg> lets them out; the frame clips them to its rounded corners. */
.pic svg,
.art-cover svg,
.author-ph svg { overflow: visible; }

/* ---- hero glow ------------------------------------------------------------
   The design draws the glow as a circle under filter:blur(76px). On iOS a
   filtered child gets its own layer that the parent's overflow:hidden clips to
   a rectangle, ignoring the border-radius, so the glow showed as pale squares
   outside the rounded corners of the hero.

   The same glow as a plain gradient paints into the parent and is clipped like
   anything else. The stops are the blurred circle worked out numerically
   (radius 230px, sigma 76px, which reaches 458px, at the design's .45 opacity),
   so the look does not change. Colour per slide comes from le_blob_style(). */

.blob {
	--blob: 47 122 212;
	background: none;
	filter: none;
	opacity: 1;
}

.blob::before {
	content: "";
	position: absolute;
	inset: -228px;
	background: radial-gradient(
		closest-side,
		rgb(var(--blob) / .445) 0%,
		rgb(var(--blob) / .423) 20%,
		rgb(var(--blob) / .379) 30%,
		rgb(var(--blob) / .299) 40%,
		rgb(var(--blob) / .197) 50%,
		rgb(var(--blob) / .103) 60%,
		rgb(var(--blob) / .041) 70%,
		rgb(var(--blob) / .012) 80%,
		rgb(var(--blob) / .003) 90%,
		rgb(var(--blob) / 0) 100%
	);
}

/* Keeps the clip above whole on iOS even if something else in the hero ever
   gets a layer of its own. */
.slides,
.phero { isolation: isolate; }

/* ---- sliders --------------------------------------------------------------
   The prototype scrolls these rails natively, which leaves a raw scrollbar
   under the cards. Swiper drives them instead; the card markup and its classes
   are untouched, so the design still comes from main.css. */

.le-slider { margin-top: 36px; overflow: hidden; }
.le-slider .swiper-wrapper { align-items: stretch; }
.le-slider .swiper-slide { height: auto; display: flex; }
.le-slider .swiper-slide > * { width: 100%; }

.le-slider--reviews .swiper-slide { width: min(420px, 82vw); }
.le-slider--team .swiper-slide { width: clamp(230px, 25vw, 270px); }

/* Arrows and dots sit under the rail, aligned with the content edge. */
.le-slider-nav {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 26px;
}

.le-slider-btn {
	width: 44px;
	height: 44px;
	flex: none;
	display: grid;
	place-items: center;
	padding: 0;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-pill);
	cursor: pointer;
	transition: .2s;
}
.le-slider-btn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--navy);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.le-slider-btn:hover { border-color: var(--navy); background: var(--pale); }
.le-slider-btn:disabled { opacity: .35; cursor: default; }
.le-slider-btn:disabled:hover { border-color: var(--line); background: #fff; }

/* Swiper positions its pagination absolutely and stretches it to full width via
   .swiper-pagination-bullets.swiper-pagination-horizontal (0,2,0). Its
   stylesheet loads after this one, so a tie would go to Swiper — hence three
   classes here. Note it never adds a bare .swiper-pagination class, only the
   modifiers, so that cannot be used as a hook. */
.le-slider .le-slider-nav .le-slider-dots {
	position: static;
	width: auto;
	display: flex;
	align-items: center;
	gap: 8px;
}
/* The dots are rendered by the slider module as real buttons, so they need the
   usual button reset on top of the bullet look. */
.le-slider-dots .swiper-pagination-bullet {
	width: 9px;
	height: 9px;
	margin: 0;
	padding: 0;
	border: 0;
	-webkit-appearance: none;
	appearance: none;
	flex: none;
	cursor: pointer;
	background: var(--line);
	border-radius: 50%;
	opacity: 1;
	transition: .25s;
}
.le-slider-dots .swiper-pagination-bullet-active {
	width: 28px;
	border-radius: var(--r-pill);
	background: var(--navy);
}

/* On the pale band the cards are white already; keep the controls readable. */
.soft .le-slider-btn { background: #fff; }

/* ---- footer ---------------------------------------------------------------
   The social row sat tight under the contact lines; give it room to read as a
   separate group. */
.ftr .soc { margin-top: 26px; }

/* Legal details (company, ЄДРПОУ, licence): small print above the bottom
   bar, one line each, a step quieter than the footer's own text. */
.ftr-legal {
	display: grid;
	gap: 3px;
	max-width: 92ch;
	margin-top: 36px;
	font-size: 12.5px;
	line-height: 1.5;
	color: rgba(180, 200, 226, .7);
}

.ftr-legal + .ftr-b { margin-top: 24px; }

/* ---- vertical rhythm ------------------------------------------------------
   The prototype sets section padding to clamp(54px,6.5vw,96px), so two
   neighbours put 192px between their content on a desktop. That reads as a
   hole between blocks; the scale below keeps the same proportions but tightens
   it. One place to change if it ever needs to go back. */
section { padding: clamp(38px, 4.2vw, 62px) 0; }

/* The footer carried its own 20px margin on top of whatever the last section
   asked for, so the gap above a closing block never matched the gap below it. */
.ftr { margin-top: 0; }

/* The prototype styles the FAQ with a bare `details` selector:
     details        { background:#fff; border:1px solid var(--line);
                      border-radius:var(--r-s); padding:0 24px }
     details[open]  { border-color: var(--sky) }
   The price catalogue groups are <details> too, so they picked up that card
   treatment: a sky-blue outline when open, and 24px of side padding that
   stopped the row hover short of the card edges. */

.pcat {
	padding: 0;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r);
}

/* Two classes, to outrank details[open]. */
.pcat[open] { border-color: var(--line); }

/* The SEO spoiler sets its title in 21–26px type with 24px padding but keeps
   the plus pinned at top:20px, so it sat ~6px above the line of text. Centre
   it on the summary instead, which holds at every size of the title. */
.seo-sp summary::after {
	top: 50%;
	transform: translateY(-50%);
	line-height: 1;
}

/* The spoiler's text runs the full width of its box; the design capped each
   paragraph at 92ch, which left a ragged empty strip on the right. */
.seo-sp .seo-body p { max-width: none; }

/* The light page heading ends without bottom padding: the design expects a
   white section next, whose own top padding makes the gap. A tinted band
   right under it (e.g. Contacts once the department cards are hidden) would
   touch the heading, so it is held off by a white margin. */
section[data-block="page_hero"] + section.soft { margin-top: clamp(28px, 3.5vw, 48px); }

/* ---- contact cards --------------------------------------------------------
   The department cards stack icon, title, blurb, phone and e-mail/hours. The
   blurbs run to different lengths, so each phone landed on its own line.
   Subgrid shares the rows across cards in a line of the grid: every phone sits
   on one level and every e-mail or hours line on the next. Rows are pinned so
   a card with an empty field keeps the others in place. */

.ccard {
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 5;
	row-gap: 0;
	align-content: start;
}
.ccard > .ic { grid-row: 1; justify-self: start; }
.ccard > h3 { grid-row: 2; }
.ccard > p { grid-row: 3; }
.ccard > a.l[href^="tel:"] { grid-row: 4; }

/* As an inline span its 4px top margin never applied; as a grid item it
   would, and push the hours below the e-mails in the neighbouring cards. */
.ccard > .sec { margin-top: 0; }

/* The design's .map is a striped placeholder. Once a Google embed is set in
   the theme options, the iframe fills the box and is clipped to its corners;
   the stripes stay underneath as the loading state. The design's 220px is too
   short for Google: below ~300px it folds the business card (name, rating,
   reviews) into a bare "Відкрити на Картах" link. */
.map { height: 320px; overflow: hidden; }
.map iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---- reveal on scroll -----------------------------------------------------
   Styled after exp-car.com: once a section reaches 80% of the viewport its
   items come in one after another over 0.9s on a soft ease-out — text rises
   28px, cards and slides in a row slide in from the left, pictures grow in
   from 90%. main.js picks the movement and removes these classes once an
   item has settled.

   The starting state is only applied to elements JS has marked, so with
   scripting off nothing is ever left invisible. */

@media (prefers-reduced-motion: no-preference) {
	.le-reveal-item {
		opacity: 0;
		transform: translateY(28px);
		transition: opacity .9s cubic-bezier(.22, .61, .36, 1), transform .9s cubic-bezier(.22, .61, .36, 1);
	}

	.le-reveal-item.le-reveal--side { transform: translateX(-40px); }
	.le-reveal-item.le-reveal--zoom { transform: scale(.9); }

	.le-reveal-item.is-in {
		opacity: 1;
		transform: none;
	}

	/* The header arrives with the page: the logo slides in from the left, the
	   menu items and the button follow one by one. */
	.le-anim .hdr-in .logo { animation: le-from-left .8s cubic-bezier(.22, .61, .36, 1) both; }
	.le-anim .hdr-in .nav a,
	.le-anim .hdr-act > * { animation: le-rise .6s cubic-bezier(.22, .61, .36, 1) both; }
	.le-anim .hdr-in .nav a:nth-child(1) { animation-delay: .15s; }
	.le-anim .hdr-in .nav a:nth-child(2) { animation-delay: .22s; }
	.le-anim .hdr-in .nav a:nth-child(3) { animation-delay: .29s; }
	.le-anim .hdr-in .nav a:nth-child(4) { animation-delay: .36s; }
	.le-anim .hdr-in .nav a:nth-child(5) { animation-delay: .43s; }
	.le-anim .hdr-in .nav a:nth-child(n+6) { animation-delay: .5s; }
	.le-anim .hdr-act > * { animation-delay: .55s; }
}

@keyframes le-from-left {
	from { opacity: 0; transform: translateX(-24px); }
}

@keyframes le-rise {
	from { opacity: 0; transform: translateY(10px); }
}

/* The header gains a shadow once the page has moved, so it separates from the
   content it now overlaps. */
.hdr { transition: box-shadow .25s ease; }
.hdr.is-scrolled { box-shadow: 0 10px 24px -18px rgba(14, 42, 85, .55); }

/* ---- search form ----------------------------------------------------------
   Reuses the price-catalogue field so the site has one search control. The
   button sits beside it on desktop and under it on narrow screens. */
.le-search {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	background: none;
	border: 0;
	padding: 0;
}

.le-search .btn { margin-top: 0; }

@media (max-width: 560px) {
	.le-search { grid-template-columns: 1fr; }
	.le-search .btn { width: 100%; }
}

/* WordPress markup — pagination headings, form labels — assumes core styles
   for this class, and those are dequeued in inc/optimization-security.php. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---- anchors under the sticky header --------------------------------------
   The header stays on screen, so a fragment link parks its target underneath
   it. --le-header is written by main.js from the header's real height, which
   changes with the top bar and at mobile widths; the fallback keeps this
   working before the script runs. */
section[id],
[data-block][id],
.hero[id],
.prose [id],
.art-wrap [id],
:target {
	scroll-margin-top: calc(var(--le-header, 118px) + 16px);
}

/* The prototype turns smooth scrolling on for everyone; leave it off for
   people who asked the system for less motion. */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* ---- 404 ------------------------------------------------------------------
   The numeral sits where a hero illustration normally goes, so the page names
   itself before anyone reads a word. Everything else on the panel is the
   design's own .phero styling. */
.le-404-code {
	font-family: "Manrope", sans-serif;
	font-weight: 200;
	font-size: clamp(110px, 15vw, 240px);
	line-height: .86;
	letter-spacing: -.05em;
	color: var(--sky);
}

/* Below 1000px the design hides .phero .art — right for a decorative
   illustration, wrong here, where that column holds the message. Bring it back
   above the heading instead of dropping it. */
@media (max-width: 1000px) {
	.phero.le-404 .art {
		display: block;
		order: -1;
		height: auto;
		padding: clamp(26px, 5vw, 40px) clamp(32px, 4vw, 56px) 0;
	}

	.le-404-code {
		font-size: clamp(84px, 24vw, 150px);
		line-height: .9;
	}
}

/* ---- form result dialog ---------------------------------------------------
   Forms report here instead of growing a message under themselves. Native
   <dialog>, so the backdrop, Esc and focus handling come from the browser. */
.le-modal {
	width: min(430px, calc(100vw - 32px));
	padding: 0;
	border: 0;
	border-radius: var(--r);
	background: #fff;
	color: var(--ink);
	box-shadow: 0 30px 60px -20px rgba(14, 42, 85, .45);
}

.le-modal::backdrop {
	background: rgba(7, 22, 48, .55);
	backdrop-filter: blur(3px);
}

.le-modal-card {
	padding: clamp(28px, 4vw, 38px);
	text-align: center;
}

.le-modal-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--pale);
}

.le-modal-icon svg {
	width: 30px;
	height: 30px;
	fill: none;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Which glyph shows is decided by the state class on the dialog. */
.le-modal-check,
.le-modal-cross { display: none; }
.le-modal.is-ok .le-modal-check { display: block; stroke: #2E9E6B; }
.le-modal.is-error .le-modal-cross { display: block; stroke: #D0555B; }
.le-modal.is-ok .le-modal-icon { background: #EAF7F0; }
.le-modal.is-error .le-modal-icon { background: #FDF1F1; }

.le-modal-title {
	font-family: "Manrope", sans-serif;
	font-weight: 400;
	font-size: 22px;
	margin: 0;
}

.le-modal-text {
	color: var(--muted);
	font-size: 15.5px;
	margin: 10px 0 0;
}

.le-modal .btn { margin-top: 24px; width: 100%; }


/* ==========================================================================
   Mobile corrections
   ========================================================================== */

/*
 * The process strip takes its column count from the number of steps, passed in
 * as --le-flow-cols by the template. The design's own breakpoints are restated
 * here because they have to come after the rule that reads the property.
 */
.flow { grid-template-columns: repeat(var(--le-flow-cols, 4), 1fr); }

@media (max-width: 1000px) {
	.flow { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
	.flow { grid-template-columns: 1fr; }
}

/*
 * `.nav` carried the margin-left:auto that pushed the actions to the right
 * edge, and it is display:none below 1080px — so the burger collapsed against
 * the logo with the rest of the bar left empty. The actions keep their own
 * right alignment once the nav stops providing it.
 */
@media (max-width: 1080px) {
	.hdr-in .hdr-act { margin-left: auto; }
}

/*
 * Below 520px the logo, the CTA and the burger share one narrow line, so each
 * gives up a little and the button stays in the bar ahead of the burger.
 */
@media (max-width: 520px) {
	.hdr-in { gap: 10px; }
	.hdr-in .logo img { height: 32px; }
	/* A flex item's automatic minimum is min-content, so the actions box has
	   to opt out too — otherwise the button inside it never gets to shrink. */
	.hdr-in .hdr-act { gap: 8px; min-width: 0; }
	.hdr-in .burger { flex: none; width: 40px; height: 40px; font-size: 17px; }

	.hdr-in .hdr-act .btn {
		min-width: 0;
		padding: 9px 14px;
		font-size: 13px;
		line-height: 1.25;
		text-align: center;
	}
}

/*
 * At 375px the label needs about 25px more than the bar has, so the logo, the
 * gaps and the button padding each give a little to keep it on one line.
 */
@media (max-width: 420px) {
	.hdr-in { gap: 8px; }
	.hdr-in .logo img { height: 26px; }
	.hdr-in .hdr-act { gap: 6px; }
	.hdr-in .hdr-act .btn { padding: 9px 12px; font-size: 12.5px; }
}

/*
 * Under ~340px one line stops being possible at a readable size. The label is
 * editable in the options, so it wraps rather than being cut off.
 */
@media (max-width: 344px) {
	.hdr-in .hdr-act .btn {
		white-space: normal;
		overflow-wrap: anywhere;
	}
}

/*
 * Two grid columns collapse to one at 1000px, but as a bare `1fr` — and a grid
 * item's automatic minimum is min-content, so one wide table was holding the
 * article column at 439px inside a 390px viewport. minmax(0,1fr) lets it
 * shrink; the table then scrolls on its own rather than the page.
 */
@media (max-width: 1000px) {
	.art-wrap { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
	.prose table {
		display: block;
		width: auto;
		min-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}

/*
 * The byline is one non-wrapping flex row — photo, name, then a nowrap date
 * pushed right by margin-left:auto. On a phone the three no longer share a
 * line, so the date drops under the name instead of pushing the page sideways.
 */
@media (max-width: 620px) {
	.author { flex-wrap: wrap; }

	.author .dates {
		margin-left: 0;
		width: 100%;
		text-align: left;
		white-space: normal;
	}
}

/* The share row is a flex line of links; it has to be allowed to wrap. */
@media (max-width: 620px) {
	.share { flex-wrap: wrap; }
}

/*
 * The topbar puts the phone and the cabinet link on one line, both nowrap.
 * Below ~360px they stop fitting and the cabinet link pushed the page sideways
 * — it wraps to a second line instead of being cut or hidden.
 */
@media (max-width: 400px) {
	.topbar-in .tb-r {
		flex-wrap: wrap;
		gap: 4px 12px;
	}
}

/*
 * On a phone the rail is clipped at the container's padding edge, so the card
 * peeking on the right was cut with a strip of empty page beside it. The rail
 * bleeds to the screen edge and carries the padding itself: the first card and
 * the arrows still line up with the heading, but the cut now lands on the edge.
 */
@media (max-width: 620px) {
	/* Swiper's own `.swiper { margin-left: auto; margin-right: auto }` loads
	   after this file, so a one-class selector would lose the tie. */
	.swiper.le-slider {
		margin-left: calc(var(--pad) * -1);
		margin-right: calc(var(--pad) * -1);
		padding-left: var(--pad);
		padding-right: var(--pad);
	}
}

/* ==========================================================================
   Licences and certificates: grid on desktop, rail on a phone
   ========================================================================== */

/*
 * The cards always ship inside slider markup, but Swiper is only started below
 * 620px. Above it the wrapper has to be styled back into the design's grid —
 * Swiper's own `.swiper-wrapper { display: flex }` is a single class and its
 * stylesheet loads after this one, so these rules use two.
 */
.le-slider--docs { margin-top: 38px; }

.le-slider--docs .swiper-wrapper {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 18px;
}

.le-slider--docs .swiper-slide { width: auto; height: auto; display: flex; }
.le-slider--docs .swiper-slide > * { width: 100%; }

/* The arrows belong to the rail, so they stay out of the way of the grid. */
.le-slider--docs .le-slider-nav { display: none; }

/* A scanned document shows the whole page instead of the placeholder glyph.
   The design's 3:4 card in a five-column row squeezed an A4 scan to ~180px
   and cut off its foot, so the text blurred into grey. A card with a scan
   drops the fixed ratio and takes its height from the page itself, and the
   row is four columns, so the sheet is wide enough to make out. */
@media (min-width: 1001px) {
	.le-slider--docs .swiper-wrapper:has(.has-preview) { grid-template-columns: repeat(4, 1fr); }
}

.doc:has(.has-preview) { aspect-ratio: auto; }

.doc .sheet.has-preview {
	flex: none;
	overflow: hidden;
	background: #fff;
}

.doc .sheet.has-preview img {
	display: block;
	width: 100%;
	height: auto;
}

/* The scan opened over the page (main.js builds the dialog). It is sized to
   the viewport so a whole A4 sheet is readable without scrolling. */
.le-lightbox {
	max-width: none;
	max-height: none;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.le-lightbox::backdrop {
	background: rgba(7, 22, 48, .82);
	backdrop-filter: blur(3px);
}

.le-lightbox figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.le-lightbox img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(92vw, 960px);
	max-height: calc(100vh - 96px);
	border-radius: var(--r-s);
	background: #fff;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
}

.le-lightbox figcaption {
	color: #fff;
	font-size: 14px;
}

.le-lightbox-close {
	position: fixed;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	cursor: pointer;
	transition: background .15s;
}

.le-lightbox-close:hover { background: rgba(255, 255, 255, .26); }

.le-lightbox-close svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

/* The page behind stays put while a document is open. */
html:has(.le-lightbox[open]) { overflow: hidden; }

@media (max-width: 1000px) {
	.le-slider--docs .swiper-wrapper { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
	/* Swiper takes over here: it transforms the wrapper and spaces the slides
	   itself, so the grid gap has to go or every card gains 18px of its own. */
	.le-slider--docs .swiper-wrapper { display: flex; gap: 0; }
	.le-slider--docs .swiper-slide { width: min(210px, 56vw); }
	.le-slider--docs .le-slider-nav { display: flex; }
}

/*
 * `nav.hidden` is how the slider module hides dead controls, but every
 * `.le-slider-nav` rule above sets `display`, and an author display beats the
 * UA rule behind [hidden]. Two classes plus the attribute settle it.
 */
.le-slider .le-slider-nav[hidden] { display: none; }

/*
 * Between 761px and the desktop the topbar still shows the address and the
 * schedule next to the phone and the cabinet link — the design only drops
 * those at 760 — and the four together ran about 50px past the viewport.
 * Letting the row wrap costs a line only on the widths where it does not fit.
 * The design fixes the bar at 42px, so a wrapped second line spilled over the
 * header; the height becomes a minimum and the bar grows with its content.
 * A single line still renders at exactly 42px.
 */
.topbar .topbar-in {
	flex-wrap: wrap;
	height: auto;
	min-height: 42px;
	padding-block: 6px;
	row-gap: 2px;
}

/*
 * "Нам довіряють": the wall shows six logos and opens on request. `.lg` is a
 * grid item with its own `display`, and an author display beats the UA rule
 * behind [hidden] — so hiding a logo has to be said explicitly.
 */
.logos .lg[hidden] { display: none; }

.trust-more {
	display: flex;
	justify-content: center;
	margin-top: 22px;
}

/* ==========================================================================
   Filling the price catalogue in from the page (admins only)
   ========================================================================== */

/*
 * The catalogue has no prices yet and most tests have no article, so the empty
 * cells are shown as targets rather than as blank space. These rules only ever
 * apply on a page carrying the .le-price-edit body class, which
 * inc/price-inline.php adds for users who may edit it.
 */
/* No outline on every row — nine framed boxes in a column read as clutter.
   A cell is plain text until pointed at, then a soft pill. Its padding is
   pulled back with a negative margin so the text itself lines up with the
   column heading and with the plain cells above and below. */
.le-cell {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: max-content;
	padding: 4px 10px;
	border-radius: var(--r-pill);
	cursor: pointer;
	white-space: nowrap;
	transition: background .15s, box-shadow .15s, color .15s;
}

.ptbl .pc-price .le-cell { margin-right: -10px; }
.ptbl .pc-code .le-cell { margin-left: -10px; }

/* "✎ Вказати" is wider than a price; give the column room while editing.
   On a phone the price already sizes itself beside the name. */
@media (min-width: 621px) {
	.le-price-edit .ptbl .pc-price { width: 150px; }
}

/* The row under the pointer turns pale already, so the cell lifts in white. */
.le-cell:hover {
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--sky);
}

.le-cell:focus-visible {
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--blue);
	outline: none;
}

/* The pencil says "edit": faint beside a value, full on hover and on an empty
   cell, where it leads a "Вказати" written in the link colour. */
.le-cell-pen {
	display: inline-flex;
	flex: none;
	opacity: .45;
	transition: opacity .15s;
}

.le-cell-pen svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.le-cell:hover .le-cell-pen,
.le-cell:focus-visible .le-cell-pen,
.le-cell.is-empty .le-cell-pen { opacity: 1; }

.le-cell.is-empty {
	font-size: 14px;
	font-weight: 500;
	color: var(--blue);
}

.le-cell.is-editing {
	padding: 0;
	box-shadow: none;
	background: none;
}

.le-cell-input {
	width: 92px;
	max-width: 100%;
	height: 30px;
	padding: 0 8px;
	font: inherit;
	font-size: 14px;
	color: var(--ink);
	background: #fff;
	border: 1px solid var(--navy);
	border-radius: var(--r-s);
}

.le-cell-input:focus { outline: none; }

/* Save states: quiet on success, insistent on failure. */
.le-cell.is-saving { opacity: .55; }
.le-cell.is-saved { box-shadow: inset 0 0 0 1px #2E9E6B; }
.le-cell.is-failed {
	box-shadow: inset 0 0 0 1px #D0555B;
	background: #FDF1F1;
}
