/**
 * "Listen to this blog" — audio player for blog detail pages.
 *
 * Markup: templates/parts/blog-audio-player.php   Engine: assets/js/blog-audio-player.js
 *
 * Three designs share one control contract:
 *   .sw-listen--d1  light card, featured image, "Read along"
 *   .sw-listen--d2  white card, centred logo + headphone play button
 *   .sw-listen--d3  dark header over a light body with a large waveform
 *
 * Two instances are printed per post; exactly one is visible:
 *   .sw-listen--sidebar  above 1224px — under the table of contents
 *   .sw-listen--inline   1224px and below — the TOC sidebar is display:none
 *                        there, so the player moves into the article
 *
 * @package SUPERWORK
 */

/* Hidden when the browser has no speech synthesis (class set by the inline
   probe in wp_head, so there is no layout shift on load). */
.sw-tts-unsupported .sw-listen { display: none !important; }

.sw-listen {
	--sw-blue: #1668E3;
	--sw-blue-dark: #0B57C7;
	--sw-navy: #0E1A33;
	--sw-ink: #16233D;
	--sw-muted: #6B7A93;
	--sw-line: #E3E9F2;
	font-family: var(--font-sans, inherit);
}

.sw-listen--sidebar { display: block; margin-top: 20px; }
.sw-listen--inline  { display: none; margin: 0 0 26px; }
.sw-listen--row     { display: block; height: 100%; }

@media (max-width: 1224px) {
	.sw-listen--sidebar { display: none; }
	.sw-listen--inline  { display: block; }
	.sw-listen--inline .sw-listen__card { max-width: 460px; }
}

/* ==================================================== blog tools — two slots */
/*
 *   .sw-btools--side  left sidebar, above the table of contents. Audio only.
 *   .sw-btools--top   right end of the breadcrumb line. ChatGPT, and the audio
 *                     pill again for <=1224px where the sidebar is hidden.
 */
.sw-btools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-family: var(--font-sans, inherit);
}

.sw-btools__half { min-width: 0; }

/* The breadcrumb line: crumbs left, tools hard right. */
.sw-blogtop {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.sw-blogtop .sw_breadcrumb { margin-bottom: 0; }

.sw-btools--top { justify-content: flex-end; }

/* -------------------------------------- 'meta' layout: on the post meta line */
/*
 * The tools sit to the right of the tag / reading time / publish date.
 *
 * Spacing is deliberately conserved: .date_time_data carries a 20px
 * padding-bottom that used to set the gap before the article. Wrapping it would
 * leave that padding inside a centred flex row and drag the meta text visually
 * upward, so the padding is zeroed and the exact same 20px is re-applied to the
 * wrapper. Net vertical rhythm is unchanged from before this row existed.
 */
.sw-blogmeta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 10px 16px;
	margin-bottom: 20px;
}

/*
 * One line, always.
 *
 * Tag chips vary wildly in length ("HUBSTAFF ALTERNATIVE" vs "PAYROLL SOFTWARE
 * FOR LARGE ENTERPRISE"), and the long ones pushed the tools onto a second row.
 * So the row never wraps: the tools keep their full size and the meta list is
 * the part allowed to give, with the tag truncating only in the rare case where
 * there genuinely isn't room. Losing a few characters of a decorative chip beats
 * the controls jumping to their own line on some posts and not others.
 */
.sw-blogmeta > .sw-btools { flex: 0 0 auto; }

/*
 * nowrap matters here. The theme's .date_time_data is itself flex-wrap:wrap, so
 * once it was allowed to shrink its own items (tag / reading time / date) broke
 * onto two and three lines at in-between widths instead of the tag truncating —
 * the row grew from 40px to 68px. Keeping the list on one line means the tag is
 * the only thing that ever gives.
 */
.main_details_blog .sw_left_side_data .sw-blogmeta .date_time_data {
	min-width: 0;
	flex: 0 1 auto;
	flex-wrap: nowrap;
}

.sw-blogmeta .date_time_data .tag_name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Selector deliberately matches the theme's own depth
   (.main_details_blog .sw_left_side_data .date_time_data) and adds one class,
   otherwise its padding-bottom:20px wins and stacks with the wrapper margin —
   which both pushes the article down and drops the tools below the meta text. */
.main_details_blog .sw_left_side_data .sw-blogmeta .date_time_data {
	padding-bottom: 0;
	margin-bottom: 0;
}

/* Always hard right, even when the meta list is absent (KPIs / OKR posts). */
.sw-btools--meta {
	justify-content: flex-end;
	margin-left: auto;
}

/*
 * Reserve the opened width up front.
 *
 * The pill roughly triples in width when it opens. Without this the row is laid
 * out for the closed size, so the first click either shunted the ChatGPT pill
 * along or wrapped the whole group onto a new line — the article visibly jumped.
 * Holding the opened width from the start (contents right-aligned, so the empty
 * reserve sits invisibly to the left) means opening only fills space that was
 * already there. Whether the row wraps is decided once at load, never on click.
 *
 * 148px = the card at full width: 11 + 28 + 8 + 84 + 11, plus a couple of pixels
 * of slack. Keep it in step with the pinned time width above.
 */
.sw-btools--meta .sw-btools__half:not(.sw-btools__half--gpt),
.sw-btools--top .sw-btools__half:not(.sw-btools__half--gpt) {
	display: flex;
	justify-content: flex-end;
	min-width: 148px;
}

@media (max-width: 720px) {
	/*
	 * Mobile is two bare icons sitting together at the left of the row: the play
	 * button, and the OpenAI mark with its label and frame stripped. Nothing is
	 * reserved, so the mark does slide right as the player opens — the row height
	 * and everything below it stay put, which is what actually matters.
	 */
	.sw-btools--meta .sw-btools__half:not(.sw-btools__half--gpt),
	.sw-btools--top .sw-btools__half:not(.sw-btools__half--gpt) {
		flex: 0 0 auto;
		justify-content: flex-start;
		min-width: 0;
	}

	.sw-btools--meta,
	.sw-btools--top { width: 100%; flex-wrap: nowrap; gap: 4px; }

	/*
	 * Idle, the pill has no border and no plate, so its horizontal padding is
	 * simply invisible space holding the two glyphs apart. Dropping it while
	 * collapsed lets them sit as a tight pair; it comes back with the frame.
	 */
	.sw-listen--bar:not(.is-open) .sw-listen__card { padding: 0; }

}

@media (max-width: 720px) {
	/* Narrow screens genuinely have no room for one line — wrap is correct here. */
	.sw-blogmeta {
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 12px;
		margin-bottom: 16px;
	}
	.sw-btools--meta { margin-left: 0; justify-content: flex-start; }
	/* Room is scarce here, so the meta list goes back to wrapping normally
	   and the tag shows in full rather than truncating. */
	.main_details_blog .sw_left_side_data .sw-blogmeta .date_time_data { flex-wrap: wrap; }
	.sw-blogmeta .date_time_data .tag_name { white-space: normal; overflow: visible; }
}

/* 'toc' layout: both tools sit INSIDE the table-of-contents card, above the
   list, with a rule separating them from it. Stacked rather than inline because
   the audio pill nearly doubles in width when it opens, which inside a ~406px
   card would shunt the ChatGPT pill onto a second line mid-play. */
.sw-btools--side {
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid #EEF0F5;
	order: -1;   /* see below */
}

/*
 * The theme builds the table of contents in JS and PREPENDS it into this card
 * (custom.js, "$sidebar.prepend(tocHTML)"), which lands it above our markup no
 * matter where the PHP printed it. Ordering the card with flex puts the tools
 * back on top without touching that script. Scoped with :has() so the card is
 * only made a flex container on posts that actually render the tools.
 */
.sw_position_fix:has(.sw-btools--side) {
	display: flex;
	flex-direction: column;
}

/* 'toc' layout only: the top slot is a stand-in for where the sidebar is hidden. */
.sw-btools--fallback { display: none; }

@media (max-width: 1224px) {
	.sw-btools--side { display: none; }
	.sw-btools--fallback { display: flex; }
}

@media (max-width: 720px) {
	.sw-blogtop {
		align-items: flex-start;
		gap: 10px;
	}
	.sw-btools--top { justify-content: flex-start; }
}

/* ------------------------------------------------------- slim audio track */
/*
 * Collapsed it is just a headphone icon and a play button — a small pill that
 * says "there is audio here" without spending a whole row on it. Pressing play
 * slides the track, timing and speed open to the right.
 */
/* Height, border and radius are matched to .sw-gpt so the two controls read as
   a matched pair rather than two unrelated widgets. */
.sw-listen--bar .sw-listen__card {
	position: relative;          /* anchors the bottom-edge progress line */
	display: inline-flex;
	align-items: center;
	/* No flex gap: it still applies against the zero-width collapsed body, which
	   left 8px of dead space to the right of the play button. The separation is a
	   margin on the body instead, so it appears only once the body does. */
	gap: 0;
	height: 40px;
	max-width: 100%;
	padding: 0 11px;
	/*
	 * Idle, this is just the play button — no ring, no plate. The border is kept
	 * in the box at 1px transparent rather than added on open, so the pill's
	 * geometry is identical in both states and nothing shifts when it appears.
	 */
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	overflow: hidden;            /* clips the line into the pill's curve */
	transition: border-color .25s ease, background-color .25s ease, padding .3s cubic-bezier(.22, 1, .36, 1);
}

/* The frame only earns its place once there is something inside it to frame. */
.sw-listen--bar.is-open .sw-listen__card {
	border-color: #C9CFD9;
	background: #fff;
}

/* The sliding half. max-width (not width) so it animates without measuring. */
.sw-listen--bar .sw-listen__barbody {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 0;
	margin-left: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-width .42s cubic-bezier(.22, 1, .36, 1), margin-left .42s cubic-bezier(.22, 1, .36, 1), opacity .3s ease .06s;
}

.sw-listen--bar.is-open .sw-listen__barbody {
	max-width: 140px;
	margin-left: 8px;
	opacity: 1;
}

.sw-listen__barinner {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-right: 2px;
}

/* --------------------------------------- progress along the bottom edge */
/*
 * The progress line runs along the bottom of the pill instead of through an
 * inline track. It costs no horizontal room, so the opened player stays
 * compact, and the pill's own border-radius clips the line into the shape.
 * The strip is also the seek surface — invisible, but the full width of the card.
 */
.sw-listen__edge {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 10px;
	display: none;
	cursor: pointer;
	touch-action: none;
}

.sw-listen--bar.is-open .sw-listen__edge { display: block; }

.sw-listen__edge:focus-visible {
	outline: 2px solid var(--sw-blue);
	outline-offset: -2px;
	border-radius: 999px;
}

/*
 * Inset by the corner radius. The card is overflow:hidden with a 999px radius,
 * so a line starting at left:0 spends its first ~20px inside the clipped curve —
 * early progress was drawn but invisible (at 00:06 of 15:10 it is barely 1px,
 * entirely swallowed by the corner). Sitting on the flat span fixes that, and
 * a faint rail behind it shows there is something to scrub.
 */
.sw-listen__edgerail {
	position: absolute;
	left: 18px;
	right: 18px;
	bottom: 0;
	height: 3px;
	border-radius: 2px;
	background: #E8EDF5;
}

.sw-listen__edgefill {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	/* Never thinner than a visible nub, so "playing" always reads. */
	min-width: 8px;
	height: 3px;
	border-radius: 2px;
	background: var(--sw-blue);
	transition: width .18s linear;
}

/* Elapsed reads as the live value, total as reference — same split as the
   reference design, with a hairline divider between them. */
.sw-listen__cur {
	font-size: 13px;
	font-weight: 600;
	color: var(--sw-ink);
}

.sw-listen__sep {
	display: inline-block;
	width: 1px;
	height: 11px;
	margin: 0 5px;
	vertical-align: -2px;
	background: #D3DBE7;
}

.sw-listen__tot {
	font-size: 13px;
	font-weight: 500;
	color: #9AA7BC;
}

.sw-listen--bar .sw-listen__play {
	width: 28px;
	height: 28px;
	box-shadow: 0 2px 6px rgba(22, 104, 227, .26);
}

.sw-listen--bar .sw-listen__play svg { width: 10px; height: 11px; }
.sw-listen--bar .sw-listen__ico-pause svg { width: 9px; height: 10px; }
.sw-listen--bar .sw-listen__play .sw-listen__ico-play { transform: translateX(1px); }

/* No pulse ring here — at this size it reads as visual noise. */
.sw-listen--bar.is-playing .sw-listen__play::after { display: none; }

.sw-listen--bar .sw-listen__barbody {
	flex: 1 1 auto;
	min-width: 0;
}

/* Pinned width. Minutes are zero-padded and the digits are tabular, so the
   block never changes size as the clock runs and the card never resizes. */
.sw-listen--bar .sw-listen__t {
	white-space: nowrap;
	flex: 0 0 auto;
	min-width: 84px;
	text-align: center;
	line-height: 16px;
	font-variant-numeric: tabular-nums;
}

.sw-listen--bar .sw-listen__track { height: 14px; }

.sw-listen--bar .sw-listen__rate {
	flex: 0 0 auto;
	height: 24px;
	min-width: 34px;
	padding: 0 7px;
	font-size: 11.5px;
}

.sw-listen--bar .sw-listen__note { margin: 6px 0 0; }

/* --------------------------------------------------------- open in chatgpt */
/* A plain outline pill, as in the reference — not a card. */
.sw-btools__half--gpt {
	display: flex;
	align-items: center;
}

.sw-gpt {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 14px;
	border: 1px solid #C9CFD9;
	border-radius: 999px;
	background: #fff;
	color: #1F2937;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.sw-gpt:hover {
	border-color: #10A37F;
	background: #F4FBF9;
	color: #0E8C6D;
	text-decoration: none;
}

.sw-gpt:focus-visible {
	outline: 2px solid #10A37F;
	outline-offset: 2px;
}

.sw-gpt__ico {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	color: inherit;
}

.sw-gpt__ico svg { display: block; }

@media (max-width: 480px) {
	/* Both controls step down together so they stay a matched pair. */
	.sw-listen--bar .sw-listen__card { height: 38px; padding: 0 10px; }
	.sw-gpt { height: 38px; padding: 0 15px; font-size: 13.5px; }
}

/* ------------------------------------------------------------------ print */
/* "PDF" prints the article; strip the page furniture so the output is clean. */
@media print {
	.sw-btools,
	.sw-listen,
	.sw-listen-mini,
	.sw_right_side_data,
	.sw_breadcrumb { display: none !important; }
	.sw-tts-active { background: none !important; box-shadow: none !important; }
}

.sw-listen__card {
	overflow: hidden;
	border: 1px solid var(--sw-line);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(22, 35, 61, .06);
}

/* =========================================================== shared pieces */

/* ------------------------------------------------------------- transport */
.sw-listen__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.sw-listen__play {
	position: relative;
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(180deg, #2E7BF0 0%, var(--sw-blue) 100%);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px rgba(22, 104, 227, .35);
	transition: transform .18s ease, box-shadow .18s ease;
}

.sw-listen__play:hover  { box-shadow: 0 8px 22px rgba(22, 104, 227, .5); }
.sw-listen__play:active { transform: scale(.94); }

.sw-listen__play:focus-visible,
.sw-listen__hero:focus-visible,
.sw-listen__round:focus-visible,
.sw-listen__rate:focus-visible,
.sw-listen__cta:focus-visible,
.sw-listen__track:focus-visible {
	outline: 2px solid var(--sw-blue);
	outline-offset: 3px;
}

/* Optical centring for the triangle. */
.sw-listen__play .sw-listen__ico-play { transform: translateX(2px); }

.sw-listen__ico-play,
.sw-listen__ico-pause { display: block; line-height: 0; }
.sw-listen__ico-pause { display: none; }
.sw-listen.is-playing .sw-listen__ico-play  { display: none; }
.sw-listen.is-playing .sw-listen__ico-pause { display: block; }

.sw-listen.is-playing .sw-listen__play::after,
.sw-listen.is-playing .sw-listen__hero::after {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(22, 104, 227, .35);
	animation: sw-listen-pulse 1.9s ease-out infinite;
}

@keyframes sw-listen-pulse {
	0%   { transform: scale(.9); opacity: .85; }
	100% { transform: scale(1.2); opacity: 0; }
}

.sw-listen__round {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--sw-ink);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .15s ease, color .15s ease;
}

.sw-listen__round:hover { background: #EDF3FD; color: var(--sw-blue); }
.sw-listen__round svg   { display: block; }
.sw-listen__round--sm   { width: 34px; height: 34px; }

.sw-listen__round[aria-pressed="true"] { color: var(--sw-blue); background: #EDF3FD; }

/* Volume glyph swaps its arcs for a cross when muted. */
.sw-listen__muted { display: none; }
.sw-listen__round[aria-pressed="true"] .sw-listen__wave1,
.sw-listen__round[aria-pressed="true"] .sw-listen__wave2 { display: none; }
.sw-listen__round[aria-pressed="true"] .sw-listen__muted { display: block; }

.sw-listen__rate {
	flex: 0 0 auto;
	height: 32px;
	min-width: 42px;
	padding: 0 10px;
	border: 1px solid var(--sw-line);
	border-radius: 8px;
	background: #fff;
	color: var(--sw-ink);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	font-variant-numeric: tabular-nums;
	transition: border-color .15s ease, color .15s ease;
}

.sw-listen__rate:hover { border-color: var(--sw-blue); color: var(--sw-blue); }

/* ------------------------------------------------------------- scrubber */
.sw-listen__track {
	position: relative;
	flex: 1 1 auto;
	height: 18px;
	display: flex;
	align-items: center;
	cursor: pointer;
	touch-action: none;
}

.sw-listen__rail {
	position: relative;
	display: block;
	width: 100%;
	height: 4px;
	border-radius: 999px;
	background: #DFE6F1;
}

.sw-listen__fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	border-radius: 999px;
	background: var(--sw-blue);
}

.sw-listen__knob {
	position: absolute;
	top: 50%;
	left: 0;
	width: 13px;
	height: 13px;
	margin: -6.5px 0 0 -6.5px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--sw-blue);
	box-shadow: 0 1px 4px rgba(22, 35, 61, .3);
	pointer-events: none;
}

.sw-listen__scrubrow {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sw-listen__t {
	flex: 0 0 auto;
	font-size: 12px;
	line-height: 18px;
	color: var(--sw-muted);
	font-variant-numeric: tabular-nums;
}

.sw-listen__times {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12px;
	line-height: 18px;
	color: var(--sw-muted);
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- cta */
.sw-listen__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 38px;
	padding: 0 14px;
	border: 1px solid var(--sw-line);
	border-radius: 9px;
	background: #F5F8FD;
	color: var(--sw-ink);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.sw-listen__cta:hover { border-color: var(--sw-blue); color: var(--sw-blue); }
.sw-listen__cta--block { width: 100%; height: 42px; }

.sw-listen__cta[aria-pressed="true"] {
	border-color: var(--sw-blue);
	background: #E7F0FE;
	color: var(--sw-blue-dark);
}

/* ----------------------------------------------------------------- voice */
.sw-listen__voice {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding-top: 11px;
	border-top: 1px solid var(--sw-line);
}

.sw-listen__voice[hidden] { display: none; }

.sw-listen__voice-label {
	flex: 0 0 auto;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--sw-muted);
}

.sw-listen__voice-select {
	flex: 1 1 auto;
	min-width: 0;
	height: 30px;
	padding: 0 26px 0 9px;
	border: 1px solid var(--sw-line);
	border-radius: 7px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B7A93' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 9px center;
	color: var(--sw-ink);
	font-family: inherit;
	font-size: 12px;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	text-overflow: ellipsis;
}

.sw-listen__note {
	margin: 9px 0 0;
	padding: 0;
	font-size: 12px;
	line-height: 18px;
	color: #C0392B;
}

.sw-listen__note:empty { display: none; }

/* -------------------------------------------------------------- chapters */
.sw-listen__chapters {
	max-height: 190px;
	margin-top: 12px;
	padding: 6px;
	overflow-y: auto;
	border: 1px solid var(--sw-line);
	border-radius: 10px;
	background: #F9FBFE;
}

.sw-listen__chapters[hidden] { display: none; }

.sw-listen__chapters button {
	display: block;
	width: 100%;
	padding: 7px 9px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--sw-ink);
	font-family: inherit;
	font-size: 13px;
	line-height: 19px;
	text-align: left;
	cursor: pointer;
}

.sw-listen__chapters button:hover { background: #E7F0FE; color: var(--sw-blue); }
.sw-listen__chapters button.is-current { background: #E7F0FE; color: var(--sw-blue); font-weight: 600; }

/* ============================================ DESIGN 2, COMPACT (the row) */

.sw-listen--row .sw-listen__card {
	display: flex;
	flex-direction: column;
	padding: 12px 14px 14px;
	border-color: #D8E4F7;
}

.sw-listen--row .sw-listen__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.sw-listen--row .sw-listen__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--sw-muted);
}

.sw-listen--row .sw-listen__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #2FBF71;
}

.sw-listen--row.is-playing .sw-listen__dot { animation: sw-listen-dot 1.6s ease-out infinite; }

@keyframes sw-listen-dot {
	0%   { box-shadow: 0 0 0 0 rgba(47, 191, 113, .55); }
	100% { box-shadow: 0 0 0 7px rgba(47, 191, 113, 0); }
}

.sw-listen--row .sw-listen__len {
	font-size: 11px;
	font-weight: 600;
	line-height: 16px;
	color: var(--sw-muted);
	font-variant-numeric: tabular-nums;
}

/* The headphone stage carries the card; it absorbs the leftover height so the
   two cards in the row stay the same size whatever the summary length. */
.sw-listen--row .sw-listen__stage {
	flex: 1 1 auto;
	min-height: 96px;
	margin: 6px 0 10px;
}

.sw-listen--row .sw-listen__hero {
	width: 74px;
	height: 74px;
	border-width: 8px;
}

.sw-listen--row .sw-listen__hero svg { width: 30px; height: 30px; }

.sw-listen--row .sw-listen__dots { width: 46px; height: 46px; }

.sw-listen--row .sw-listen__scrubrow { margin-bottom: 10px; }

.sw-listen--row .sw-listen__controls { gap: 3px; }
.sw-listen--row .sw-listen__play  { width: 46px; height: 46px; }
.sw-listen--row .sw-listen__round { width: 32px; height: 32px; }
.sw-listen--row .sw-listen__round svg { width: 16px; height: 16px; }
.sw-listen--row .sw-listen__rate { height: 28px; min-width: 38px; padding: 0 8px; font-size: 12px; }

/* Transport shows the play triangle; the hero button shows the headphones. */
.sw-listen--row .sw-listen__controls .sw-listen__ico-play  { display: block; }
.sw-listen--row .sw-listen__controls .sw-listen__ico-pause { display: none; }
.sw-listen--row.is-playing .sw-listen__controls .sw-listen__ico-play  { display: none; }
.sw-listen--row.is-playing .sw-listen__controls .sw-listen__ico-pause { display: block; }

.sw-listen--row .sw-listen__voice { margin-top: 10px; padding-top: 9px; }

/* ============================================================ AI SUMMARY */

.sw-sum {
	display: flex;
	flex-direction: column;
	padding: 12px 14px 14px;
	border: 1px solid #D8E4F7;
	border-radius: 14px;
	background:
		radial-gradient(120% 100% at 100% 0%, rgba(22, 104, 227, .07) 0%, rgba(22, 104, 227, 0) 60%),
		#fff;
	box-shadow: 0 6px 18px rgba(22, 35, 61, .06);
	font-family: var(--font-sans, inherit);
}

.sw-sum__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.sw-sum__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #16233D;
}

.sw-sum__spark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 7px;
	background: #E7F0FE;
	color: #1668E3;
}

.sw-sum__spark svg { display: block; }

.sw-sum__len {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	line-height: 16px;
	color: #6B7A93;
}

.sw-sum__tldr {
	margin: 0 0 10px;
	padding: 0;
	font-size: 13.5px;
	line-height: 21px;
	color: #3C4A63;
}

.sw-sum__points {
	flex: 1 1 auto;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
	border-left: 0;
}

.sw-sum__points li {
	position: relative;
	margin: 0;
	padding: 0 0 6px 16px;
	font-size: 13px;
	font-weight: 500;
	line-height: 19px;
	color: #16233D;
	list-style: none;
}

.sw-sum__points li:last-child { padding-bottom: 0; }

.sw-sum__points li::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 0;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #1668E3;
}

.sw-sum__more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	height: 34px;
	margin-top: auto;
	padding: 0 12px;
	border: 1px solid #E3E9F2;
	border-radius: 9px;
	background: #F5F8FD;
	color: #16233D;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.sw-sum__more:hover { border-color: #1668E3; background: #E7F0FE; color: #1668E3; }

.sw-sum__more:focus-visible {
	outline: 2px solid #1668E3;
	outline-offset: 2px;
}

.sw-sum__more svg { display: block; }

@media (max-width: 720px) {
	.sw-sum { padding: 12px 13px 13px; }
	.sw-sum__tldr { font-size: 13px; line-height: 20px; }

	/* Stacked, the cards no longer need to match heights — so the player's
	   stage stops absorbing slack and the card collapses to its content. */
	.sw-listen--row .sw-listen__stage {
		flex: 0 0 auto;
		min-height: 0;
		margin: 4px 0 8px;
	}
}

/* ================================================================ DESIGN 1 */

.sw-listen--d1 .sw-listen__card { padding: 14px; }

.sw-listen__d1head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 2px 2px 12px;
}

.sw-listen__badge {
	flex: 0 0 auto;
	width: 50px;
	height: 50px;
	border-radius: 13px;
	background: #E7F0FE;
	color: var(--sw-blue);
	display: flex;
	align-items: center;
	justify-content: center;
}

.sw-listen__d1titles { flex: 1 1 auto; min-width: 0; }

.sw-listen__d1titles strong {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 21px;
	color: var(--sw-ink);
}

.sw-listen__d1titles em {
	display: block;
	font-size: 12.5px;
	font-style: normal;
	line-height: 18px;
	color: var(--sw-muted);
}

/* Small decorative waveform in the header — fills as playback advances. */
.sw-listen__mini-wave {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 1.5px;
	width: 74px;
	height: 26px;
}

.sw-listen__mini-wave span {
	display: block;
	flex: 1 1 auto;
	min-width: 1px;
	border-radius: 1px;
	background: #C6D6EE;
	transition: background-color .15s linear, transform .18s ease;
}

.sw-listen__mini-wave span.is-done { background: var(--sw-blue); }
.sw-listen.is-playing .sw-listen__mini-wave span.is-head { background: #6FA8F5; transform: scaleY(1.3); }

.sw-listen__thumb {
	margin: 0 0 12px;
	border-radius: 10px;
	overflow: hidden;
	line-height: 0;
	background: #EEF2F8;
}

.sw-listen__thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.sw-listen--d1 .sw-listen__times  { padding: 0 2px 2px; }
.sw-listen--d1 .sw-listen__track  { margin-bottom: 6px; }
.sw-listen--d1 .sw-listen__controls { padding: 4px 0 12px; }

.sw-listen__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 12px;
	border-top: 1px solid var(--sw-line);
}

/* ================================================================ DESIGN 2 */

.sw-listen--d2 .sw-listen__card {
	padding: 20px 18px 18px;
	border-color: #D8E4F7;
	text-align: center;
}

.sw-listen__brand { line-height: 0; }
.sw-listen__brand svg { width: 148px; height: auto; }
.sw-listen--d2 .sw-listen__brand { display: flex; justify-content: center; }

/* The sidebar stylesheet capitalises headings; keep sentence case as designed. */
.sw-listen__d2title,
.sw-listen__d3title { text-transform: none; }

.sw-listen__d2title {
	margin: 14px 0 0;
	padding: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 28px;
	color: var(--sw-ink);
}

.sw-listen__d2sub {
	margin: 4px auto 0;
	padding: 0;
	max-width: 300px;
	font-size: 13.5px;
	line-height: 20px;
	color: var(--sw-muted);
}

.sw-listen__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin: 16px 0 14px;
}

.sw-listen__hero {
	position: relative;
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	padding: 0;
	border: 10px solid #E9F1FE;
	border-radius: 50%;
	background: linear-gradient(180deg, #2E7BF0 0%, var(--sw-blue) 100%);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 22px rgba(22, 104, 227, .3);
	transition: transform .18s ease, box-shadow .18s ease;
}

.sw-listen__hero:hover  { box-shadow: 0 10px 28px rgba(22, 104, 227, .45); }
.sw-listen__hero:active { transform: scale(.95); }
.sw-listen__hero svg    { width: 38px; height: 38px; }

/* Dotted grids either side of the button, as in the reference. */
.sw-listen__dots {
	flex: 0 0 auto;
	width: 52px;
	height: 62px;
	background-image: radial-gradient(#C9DCF7 1.4px, transparent 1.4px);
	background-size: 9px 9px;
	opacity: .9;
}

.sw-listen--d2 .sw-listen__scrubrow { margin-bottom: 14px; }
.sw-listen--d2 .sw-listen__controls { margin-bottom: 16px; }
.sw-listen--d2 .sw-listen__play { width: 50px; height: 50px; }
.sw-listen--d2 .sw-listen__controls .sw-listen__ico-play  { display: block; }
.sw-listen--d2 .sw-listen__controls .sw-listen__ico-pause { display: none; }
.sw-listen--d2.is-playing .sw-listen__controls .sw-listen__ico-play  { display: none; }
.sw-listen--d2.is-playing .sw-listen__controls .sw-listen__ico-pause { display: block; }
.sw-listen--d2 .sw-listen__controls { gap: 6px; }
.sw-listen--d2 .sw-listen__round { width: 34px; height: 34px; }
.sw-listen--d2 .sw-listen__voice { text-align: left; }

/* ================================================================ DESIGN 3 */

.sw-listen--d3 .sw-listen__card { padding: 0; }

.sw-listen__hero-dark {
	position: relative;
	padding: 18px 20px 22px;
	background: linear-gradient(165deg, #16294D 0%, var(--sw-navy) 100%);
	text-align: center;
	overflow: hidden;
}

/* Faint waveform texture behind the heading. */
.sw-listen__hero-wave {
	position: absolute;
	inset: 0;
	background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 7px);
	mask-image: radial-gradient(120% 80% at 50% 55%, #000 0%, transparent 72%);
	-webkit-mask-image: radial-gradient(120% 80% at 50% 55%, #000 0%, transparent 72%);
	pointer-events: none;
}

.sw-listen__hero-dark > *:not(.sw-listen__hero-wave) { position: relative; }

.sw-listen--d3 .sw-listen__brand { display: flex; justify-content: center; }
.sw-listen__brand--light svg { width: 140px; }
/* The wordmark ships in ink and the tagline in a gradient; both need
   recolouring for the dark panel. The four-colour icon mark is left alone. */
.sw-listen__brand--light svg path[fill="#1E2538"] { fill: #fff; }
.sw-listen__brand--light svg path[fill^="url("] { fill: #A9BDDE; }

.sw-listen__d3title {
	margin: 14px 0 0;
	padding: 0;
	font-size: 19px;
	font-weight: 700;
	line-height: 26px;
	color: #fff;
}

.sw-listen__d3sub {
	margin: 5px auto 0;
	padding: 0;
	max-width: 290px;
	font-size: 13px;
	line-height: 19px;
	color: #B9C8E2;
}

.sw-listen__body { padding: 16px 18px 18px; }

/* Large progress-aware waveform. */
.sw-listen__bigwave {
	display: flex;
	align-items: center;
	gap: 2px;
	height: 56px;
	margin-bottom: 14px;
}

.sw-listen__bigwave span {
	display: block;
	flex: 1 1 auto;
	min-width: 2px;
	border-radius: 2px;
	background: #C6D6EE;
	transition: background-color .15s linear, transform .18s ease;
}

.sw-listen__bigwave span.is-done { background: var(--sw-blue); }
.sw-listen.is-playing .sw-listen__bigwave span.is-head { background: #6FA8F5; transform: scaleY(1.3); }
.sw-listen.is-playing .sw-listen__bigwave span.is-near { transform: scaleY(1.15); }

.sw-listen--d3 .sw-listen__scrubrow { margin-bottom: 14px; }
.sw-listen--d3 .sw-listen__controls { gap: 6px; margin-bottom: 16px; }
.sw-listen--d3 .sw-listen__round { width: 34px; height: 34px; }

/* ---------------------------------------------------- reading highlight */
/* box-shadow, not padding, so highlighting never reflows the article. */
.sw-tts-active {
	background-color: rgba(22, 104, 227, .07);
	box-shadow: 0 0 0 5px rgba(22, 104, 227, .07);
	border-radius: 4px;
	transition: background-color .2s ease, box-shadow .2s ease;
}

/* Clickable paragraphs once playback has started. */
.sw-listen-live .sw_all_data p,
.sw-listen-live .sw_all_data li,
.sw-listen-live .sw_all_data h2,
.sw-listen-live .sw_all_data h3,
.sw-listen-live .sw_all_data h4 { cursor: pointer; }

/* ---------------------------------------------------------- sticky mini bar */
.sw-listen-mini {
	position: fixed;
	left: 50%;
	bottom: 20px;
	z-index: 9998;
	width: calc(100% - 32px);
	max-width: 520px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border: 1px solid var(--sw-line, #E3E9F2);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 14px 34px rgba(22, 35, 61, .18);
	transform: translate(-50%, 130%);
	opacity: 0;
	visibility: hidden;
	transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, visibility .28s;
}

.sw-listen-mini.is-visible {
	transform: translate(-50%, 0);
	opacity: 1;
	visibility: visible;
}

.sw-listen-mini__play {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(180deg, #2E7BF0 0%, #1668E3 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.sw-listen-mini__play .sw-listen__ico-pause { display: none; }
.sw-listen-mini.is-playing .sw-listen__ico-play  { display: none; }
.sw-listen-mini.is-playing .sw-listen__ico-pause { display: block; }

.sw-listen-mini__body { flex: 1 1 auto; min-width: 0; }

.sw-listen-mini__title {
	margin: 0 0 6px;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 16px;
	color: #16233D;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sw-listen-mini__bar {
	position: relative;
	height: 4px;
	border-radius: 999px;
	background: #DFE6F1;
}

.sw-listen-mini__fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	border-radius: 999px;
	background: #1668E3;
}

.sw-listen-mini__close {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #6B7A93;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.sw-listen-mini__close:hover { background: #EEF2F8; color: #16233D; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 420px) {
	.sw-listen__d2title { font-size: 18px; line-height: 26px; }
	.sw-listen__hero { width: 84px; height: 84px; border-width: 8px; }
	.sw-listen__dots { width: 38px; }
	.sw-listen__play { width: 50px; height: 50px; }
	.sw-listen__round { width: 34px; height: 34px; }
	.sw-listen__controls { gap: 4px; }
	.sw-listen-mini { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.sw-listen.is-playing .sw-listen__play::after,
	.sw-listen.is-playing .sw-listen__hero::after { animation: none; }
	.sw-listen.is-playing .sw-listen__bigwave span.is-head,
	.sw-listen.is-playing .sw-listen__bigwave span.is-near,
	.sw-listen.is-playing .sw-listen__mini-wave span.is-head { transform: none; }
	.sw-listen-mini { transition: opacity .2s ease, visibility .2s; }
}

/* ============================================ mobile: two bare icons, one row */
/*
 * Declared last on purpose. @media adds no specificity, so these have to come
 * after the base .sw-gpt block further up — otherwise its border shorthand wins
 * on source order and the frame stays visible however many times it is unset.
 */
@media (max-width: 720px) {
	.sw-gpt {
		width: 34px;
		height: 40px;
		padding: 0;
		justify-content: center;
		border-color: transparent;
		background: transparent;
	}

	.sw-gpt:hover,
	.sw-gpt:focus-visible {
		border-color: transparent;
		background: transparent;
	}

	.sw-gpt > span:not(.sw-gpt__ico) { display: none; }
	.sw-gpt__ico svg { width: 23px; height: 23px; }
}
