/* The public walkthrough page, its preview, version diff and right of reply
   (docs/design/singleWorkerHosts.md, Phase 2): carried over from Consider The Evidence's
   public/style.css when walkthroughs moved to SignalCodes, minus CTE's own identity shell (page
   font, body width, wordmark header). Loaded only by the pages in src/lib/walkPage.js; the walk
   itself brings its own <style> inside the published content. */

/* The walk's three columns need ~60rem, wider than the site's reading column; its own CSS
   collapses to one column on narrow viewports. */
.walk-page {
	max-width: 62rem;
	margin: 0 auto;
	line-height: 1.5;
}

/* Walk pages take .site-container.wide only to escape the 800px reading column, but .wide is
   built for tool pages that scroll their own panes: it is overflow:hidden, and above 800px so is
   the body — leaving a long walk unscrollable. The walk scrolls as one page, so give it back. */
.site-container.wide:has(> .walk-page) {
	overflow-y: auto;
}

.doc-title {
	margin-bottom: 2.5rem;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 1.6rem;
	font-weight: 400;
	line-height: 1.3;
}

/* On a tutorial page the title sits centered under the site identity line,
   echoing the centered .site-header directly above it. */
.walk-page .doc-title {
	text-align: center;
}

/* The "a newer version exists" affordance (2026-09-16: replaces the old ⇄ diff-icon) — a
   coloured box, not an inline link, so it reads as a notification rather than a footnote. */
.update-banner {
	margin: 0 0 1.5rem;
}

.update-banner a {
	display: inline-block;
	padding: 0.4rem 0.85rem;
	border-radius: 0.3rem;
	background: light-dark(#0b5a52, #134e4a);
	color: light-dark(#fff, #5eead4);
	font-size: 0.85em;
	font-weight: 600;
	text-decoration: none;
}

.update-banner a:hover {
	text-decoration: underline;
}

/* An unpublished preview (src/previews.ts): same family as .frozen-notice, but a stronger
   edge so it is never mistaken for the published page; problems turn it amber. */
.preview-banner {
	margin: 0 0 1.5rem;
	padding: 0.5rem 0.75rem;
	border-left: 4px solid light-dark(#0b5a52, #5eead4);
	background: #8881;
	font-size: 0.9em;
}

.preview-banner p {
	margin: 0.2rem 0;
}

.preview-banner ul {
	margin: 0.3rem 0 0.2rem 1.2rem;
	padding: 0;
}

.preview-banner-problems {
	border-left-color: light-dark(#b45309, #fbbf24);
}

.frozen-notice {
	margin: 0 0 2rem;
	padding: 0.5rem 0.75rem;
	border-left: 3px solid #8886;
	background: #8881;
	font-size: 0.9em;
	opacity: 0.85;
}

/* Right of reply (src/reply.ts) — page chrome, never inside <article>. One collapsible
   element above the doc: the summary line is the closed state, the people list is the body. */
.right-of-reply {
	margin: 0 0 1.5rem;
	font-size: 0.9em;
}

.right-of-reply > summary {
	cursor: pointer;
	font-size: 0.95em;
	opacity: 0.75;
}

.right-of-reply > summary:hover,
.right-of-reply[open] > summary {
	opacity: 1;
}

.right-of-reply[open] {
	padding: 0.5rem 0.75rem;
	border-left: 3px solid #8886;
	background: #8881;
}

.reply-intro {
	margin: 0 0 0.5rem;
}

.reply-people {
	margin: 0 0 1rem;
	padding-left: 1.2rem;
}

.reply-people > li {
	margin: 0.75rem 0;
}

.reply-people p {
	margin: 0.2rem 0;
}

.reply-who {
	font-weight: 600;
}

.reply-who .reply-org {
	font-weight: 400;
}

.reply-line {
	font-size: 0.95em;
	opacity: 0.85;
}

.reply-org {
	opacity: 0.7;
}

.reply-response {
	margin: 0.75rem 0 0;
}

.reply-response figcaption {
	font-size: 0.9em;
	opacity: 0.85;
}

.reply-response blockquote {
	margin: 0.4rem 0;
	padding: 0.1rem 0 0.1rem 0.9rem;
	border-left: 3px solid #8886;
}

.reply-anchor {
	display: block;
}

.reply-ack {
	padding: 0.3rem 0.6rem;
	background: #8881;
	font-size: 0.9em;
}

/* /respond/<token> (right of reply, Phase 5). */
.respond-form {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin: 1.5rem 0;
}

.respond-form textarea {
	font: inherit;
	padding: 0.4rem 0.5rem;
}

.respond-form button {
	font: inherit;
	padding: 0.4rem 1rem;
	cursor: pointer;
}

.respond-counter {
	margin: -0.4rem 0 0;
	font-size: 0.8em;
	opacity: 0.7;
}

.respond-error {
	margin: 0;
	padding: 0.5rem 0.75rem;
	border-left: 3px solid #d33;
	background: #d331;
}

.citation-changes {
	margin: 0 0 1.5rem;
	padding-left: 1.2rem;
}

.citation-changes li {
	margin: 0.2rem 0;
}

/* Quote blocks published from SignalCodes: <blockquote class="… quote" data-href="…">.
   The whole box is the hit target; quote-embed.js handles the click. */
.quote[data-href] {
	position: relative;
	cursor: pointer;
}

.quote[data-href]:hover {
	text-decoration: underline;
}

/* Fixed mini player for YouTube quote links. */
#yt-mini {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	width: min(360px, 92vw);
	aspect-ratio: 16 / 9;
	z-index: 9999;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* On a walkthrough the Back/Next bar is fixed to the bottom; sit above it, not over it. */
body:has(.tw-root.tw-js .tw-controls) #yt-mini {
	bottom: 5rem;
}

/* Likewise this site's contact button (site.css .contact-widget), which CTE never had: lift it
   clear of the walk's fixed Back/Next bar instead of covering Next. */
body:has(.tw-root.tw-js .tw-controls) .contact-widget {
	bottom: 5rem;
}

#yt-mini .yt-mini-frame {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

#yt-mini .yt-mini-close {
	position: absolute;
	top: 4px;
	right: 4px;
	z-index: 1;
	width: 1.6rem;
	height: 1.6rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 1rem;
	line-height: 1.6rem;
	text-align: center;
	cursor: pointer;
}

/* The right-of-reply as a walkthrough's last page (src/reply.ts, renderRightOfReplyPage): no
   collapse, no inset box, just the page. */
.right-of-reply-page {
	font-size: 1em;
}

.right-of-reply-page h2 {
	margin: 0 0 0.25rem;
}

.reply-summary {
	margin: 0 0 0.75rem;
	opacity: 0.75;
}

/* Everything a respondent says (icon, box, arrows, reply box) is indigo, not the site's teal, so it
   reads as a different voice from the author's. */
:root {
	--tw-reply: #5b4bb7;
}

@media (prefers-color-scheme: dark) {
	:root {
		--tw-reply: #9d8fe8;
	}
}

/* Reactions (public/walkreply.js, src/reply.ts): the Replies icon above the controls bar, its status
   box and the respondent's reply box. System colours so they follow light/dark. */
.tw-replies-icon {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-left: 0.5rem;
	padding: 0.2rem 0.4rem;
	vertical-align: middle;
	font: inherit;
	font-size: 0.85rem;
	color: var(--tw-reply);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
}

.tw-replies-icon[hidden] {
	display: none;
}

.tw-replies-icon svg {
	fill: none;
	stroke: currentColor;
}

/* Nobody invited: muted. Invited: outline in the accent colour. Replied: filled, so it is noticed even
   while the layer is off. */
.tw-replies-none {
	color: #8887;
}

.tw-replies-replied svg {
	fill: currentColor;
}

.tw-replies-count {
	font-weight: 600;
}

/* The arrow from the status box to a reacted-to passage (public/walkreply.js drawLinks). */
.tw-links {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 15;
}

.tw-links path {
	fill: none;
	stroke: var(--tw-reply);
	stroke-width: 1.5;
}

.tw-links marker path {
	fill: var(--tw-reply);
	stroke: none;
}

.tw-replies-list {
	margin: 0.4rem 0 0;
	padding-left: 1.1rem;
}

.tw-replies-list:empty {
	display: none;
}

/* One box above the controls bar (public/walkreply.js): the Replies icon is its foot and always shows;
   open, the status panel grows upward out of it inside the same outline, and the X folds it back. */
.tw-replies-widget {
	position: fixed;
	left: max(1rem, calc((100vw - 60rem) / 2));
	z-index: 20;
	width: max-content;
	max-width: calc(100vw - 2rem);
	background: Canvas;
	color: CanvasText;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 0.9em;
}

.tw-replies-widget[hidden] {
	display: none;
}

.tw-replies-widget.tw-open {
	width: min(26rem, calc(100vw - 2rem));
	border-color: var(--tw-reply);
	box-shadow: 0 4px 18px #0003;
}

.tw-replies-note {
	max-height: 50vh;
	overflow: auto;
	padding: 0.5rem 0.9rem;
}

.tw-replies-note[hidden],
.tw-replies-close[hidden] {
	display: none;
}

.tw-replies-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.tw-replies-widget:not(.tw-open) .tw-replies-icon {
	border-color: #8886;
	background: Canvas;
}

.tw-replies-widget.tw-open .tw-replies-foot {
	border-top: 1px solid color-mix(in srgb, var(--tw-reply) 27%, transparent);
}

.tw-replies-widget .tw-replies-icon {
	margin-left: 0;
}

.tw-replies-close {
	padding: 0 0.6rem;
	font: inherit;
	font-size: 1.3rem;
	line-height: 1;
	color: inherit;
	background: transparent;
	border: none;
	cursor: pointer;
}

.tw-comments-panel {
	position: fixed;
	left: max(1rem, calc((100vw - 60rem) / 2));
	bottom: 4.25rem;
	z-index: 20;
	width: min(26rem, calc(100vw - 2rem));
	max-height: 55vh;
	overflow: auto;
	padding: 0.5rem 0.9rem;
	background: Canvas;
	color: CanvasText;
	border: 1px solid #8887;
	border-radius: 6px;
	box-shadow: 0 4px 18px #0003;
	font-size: 0.9em;
}

.tw-comments-panel[hidden],
.tw-comments-btn[hidden] {
	display: none;
}

.reply-stepcomments > summary {
	cursor: pointer;
}

.reply-stepcomments ul,
.reply-gone {
	margin: 0.4rem 0 0.75rem;
	padding-left: 1.2rem;
}

.reply-stepcomment-head {
	opacity: 0.7;
}

.reply-gone-original {
	padding: 0.5rem 0.75rem;
	border-left: 3px solid #8886;
}

.reply-gone-original .tw-step {
	display: block;
}

/* The respondent's reply box (public/walkreply.js): a heading bar, what to do now, the summary when it
   is showing, and a row of buttons. */
.tw-replybox {
	display: flex;
	flex-direction: column;
	padding: 0;
	width: min(30rem, calc(100vw - 2rem));
	border: 2px solid var(--tw-reply);
	background: Canvas;
}

.tw-rb-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.45rem 0.9rem;
	background: color-mix(in srgb, var(--tw-reply) 13%, transparent);
	border-bottom: 1px solid color-mix(in srgb, var(--tw-reply) 40%, transparent);
}

.tw-rb-title {
	margin: 0;
	font-size: 1.05em;
}

.tw-rb-leave {
	font-size: 0.85em;
}

.tw-rb-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 0.6rem 0.9rem;
}

.tw-rb-hint {
	margin: 0 0 0.6rem;
	opacity: 0.8;
}

.tw-rb-hint[hidden],
.tw-rb-write[hidden],
.tw-rb-check[hidden],
.tw-rb-decline[hidden],
.tw-rb-count:empty {
	display: none;
}

.tw-rb-count {
	margin: 0 0 0.5rem;
	font-size: 0.9em;
}

.tw-rb-write textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
}

.tw-rb-decline {
	margin: 0.5rem 0 0;
	font-size: 0.9em;
}

.tw-rb-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
	padding: 0.5rem 0.9rem;
	border-top: 1px solid #8884;
	background: #8881;
}

.tw-rb-publish {
	margin-left: auto;
}

.tw-reply-status {
	flex-basis: 100%;
	font-size: 0.85em;
	opacity: 0.85;
}

.tw-reply-status:empty {
	display: none;
}

.tw-reply-count {
	margin: 0.25rem 0 0.5rem;
	opacity: 0.7;
	font-size: 0.9em;
}

/* Share, top right: copies the public link. */
.tw-share-btn {
	position: fixed;
	top: 0.75rem;
	right: 1rem;
	z-index: 25;
	box-shadow: 0 2px 10px #0003;
}

/* Reactions (public/walkreply.js): a passage the respondent liked or questioned is tinted in the step
   (CSS Custom Highlight API), so the walk's own markup is never touched. */
::highlight(tw-like) {
	background-color: #43a04766;
}

::highlight(tw-rephrase) {
	background-color: #ef6c0066;
}

::highlight(tw-mention) {
	background-color: #4fc3f766;
}

.reply-stepquote {
	font-style: italic;
}

/* Like / Question beside a selection, and "Remove" beside a clicked reaction. */
.tw-react-pair {
	position: absolute;
	z-index: 30;
	display: flex;
	gap: 0.35rem;
	align-items: center;
	padding: 0.3rem;
	background: Canvas;
	color: CanvasText;
	border: 1px solid #8887;
	border-radius: 6px;
	box-shadow: 0 2px 10px #0003;
	font-size: 0.85em;
}

.tw-react-pair[hidden],
.tw-react-tip[hidden] {
	display: none;
}

.tw-react-pair .tw-like,
.tw-react-btn.tw-like {
	border-color: #43a047;
}

.tw-react-pair .tw-rephrase,
.tw-react-btn.tw-rephrase {
	border-color: #ef6c00;
}

.tw-react-tip {
	position: fixed;
	z-index: 30;
	max-width: 18rem;
	padding: 0.25rem 0.5rem;
	background: Canvas;
	color: CanvasText;
	border: 1px solid #8887;
	border-radius: 4px;
	box-shadow: 0 2px 8px #0003;
	font-size: 0.8em;
	pointer-events: none;
}

/* On a concept card: the respondent's two buttons, and a tag for each published reaction. */
.tw-react-card {
	display: flex;
	gap: 0.35rem;
	margin-top: 0.4rem;
}

.tw-react-btn {
	font-size: 0.8em;
	padding: 0.1rem 0.5rem;
	cursor: pointer;
}

.tw-react-btn.tw-on.tw-like {
	background: #43a04733;
	box-shadow: inset 0 0 0 1px #43a047;
	font-weight: 600;
}

.tw-react-btn.tw-on.tw-rephrase {
	background: #ef6c0033;
	box-shadow: inset 0 0 0 1px #ef6c00;
	font-weight: 600;
}

.tw-react-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-top: 0.4rem;
}

.tw-react-badge {
	font-size: 0.75em;
	padding: 0.05rem 0.45rem;
	border-radius: 999px;
	border: 1px solid;
}

.tw-react-badge.tw-like {
	background: #43a04722;
	border-color: #43a047;
}

.tw-react-badge.tw-rephrase {
	background: #ef6c0022;
	border-color: #ef6c00;
}

.respond-actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

/* The respondent's rephrase box, opened beside a selection (public/walkreply.js). */
.tw-rephrase-edit {
	position: absolute;
	z-index: 30;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	width: min(24rem, calc(100vw - 1rem));
	padding: 0.5rem;
	background: Canvas;
	color: CanvasText;
	border: 2px solid var(--tw-reply);
	border-radius: 6px;
	box-shadow: 0 2px 10px #0003;
	font-size: 0.85em;
}

.tw-rephrase-edit[hidden] {
	display: none;
}

.tw-rephrase-edit textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
}

.tw-rephrase-edit .tw-re-row {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.tw-rephrase-edit .tw-re-count {
	margin-right: auto;
	opacity: 0.7;
}

/* One reaction in the Replies box: a heading bar naming who is speaking, then what they suggest. */
.tw-replies-list {
	list-style: none;
	padding-left: 0;
}

.tw-reply-card {
	margin: 0 0 0.5rem;
	border: 1px solid var(--tw-reply);
	border-radius: 6px;
	overflow: hidden;
}

.tw-reply-card-head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.25rem 0.6rem;
	background: color-mix(in srgb, var(--tw-reply) 13%, transparent);
	border-bottom: 1px solid color-mix(in srgb, var(--tw-reply) 40%, transparent);
	font-weight: 600;
}

.tw-reply-card-date {
	font-weight: 400;
	font-size: 0.85em;
	opacity: 0.7;
}

.tw-reply-card-body {
	padding: 0.4rem 0.6rem;
}

.tw-reply-card-said {
	margin-top: 0.15rem;
}

/* The open Replies box is one outline holding the title bar, the response(s), a dividing line and the
   icon + close foot. The cards inside have no border of their own. */
.tw-replies-widget {
	overflow: hidden;
}

.tw-replies-widget .tw-reply-card {
	margin: 0;
	border: none;
	border-radius: 0;
}

.tw-replies-widget .tw-reply-card + .tw-reply-card {
	border-top: 1px solid var(--tw-reply);
}

.tw-replies-widget .tw-replies-note {
	padding: 0;
}

.tw-replies-widget .tw-replies-list {
	margin: 0;
}

.tw-replies-empty {
	margin: 0;
	padding: 0.5rem 0.9rem;
}

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

/* Key-cap badges walknav.js adds to Back/Next: ← / → step too. Only where there's a keyboard
   and mouse to speak of (hover + fine pointer); touch screens never see them. currentColor keeps
   them right on the filled Next and in dark mode alike. */
.tw-key { display: none; }
@media (hover: hover) and (pointer: fine) {
	.tw-key {
		display: inline-block;
		min-width: 1.4em;
		padding: 0 0.3em;
		border: 1px solid currentColor;
		border-radius: 4px;
		font: inherit;
		font-size: 0.8em;
		line-height: 1.35;
		text-align: center;
		opacity: 0.7;
	}
	#twBack .tw-key { margin-right: 0.5em; }
	#twNext .tw-key { margin-left: 0.5em; }
}
