/* Shared-library navigation: inspect one decision and its neighbourhood. */
.shared-workspace {
	--shared-blue: #3867b5;
	--shared-green: #26714e;
	--shared-purple: #7753a8;
	max-width: 1500px;
	margin: 0 auto;
}
[data-theme="dark"] .shared-workspace {
	--shared-blue: #9ab7f2;
	--shared-green: #8acba9;
	--shared-purple: #baa0dd;
}
.shared-top,
.shared-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}
.shared-top {
	margin-bottom: 28px;
	font-size: 12px;
	color: var(--muted);
	flex-wrap: wrap;
}
.shared-layout {
	display: grid;
	grid-template-columns: 190px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}
.shared-workspace.has-inspector .shared-layout {
	grid-template-columns: 175px minmax(0, 1fr) 280px;
	gap: 24px;
}
.shared-library {
	position: sticky;
	top: 84px;
	min-width: 0;
}
.shared-library label,
.shared-library h2 {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--muted);
	margin: 0 0 10px;
}
.shared-library input {
	width: 100%;
	min-width: 0;
	padding: 9px 10px;
	font-size: 12px;
}
.shared-library-group {
	margin-top: 26px;
}
.shared-library-item {
	display: flex;
	width: 100%;
	gap: 9px;
	text-align: left;
	align-items: flex-start;
	padding: 11px 9px;
	border: 0;
	background: transparent;
	border-radius: 8px;
	color: var(--ink);
	font-size: 12px;
}
.shared-library-item > svg {
	flex: 0 0 16px;
	margin-top: 2px;
}
.shared-library-item.selected {
	background: var(--surface);
	box-shadow: var(--shadow-xs);
}
.shared-library-item:hover,
.shared-dependency:hover,
.shared-use:hover {
	background: var(--hover);
}
.shared-library-item small,
.shared-use small {
	display: block;
	color: var(--muted);
	font-size: 10px;
	margin-top: 4px;
}
.shared-main {
	min-width: 0;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 30px;
}
.shared-main h1 {
	font-size: 24px;
	font-weight: 550;
	line-height: 1.25;
	letter-spacing: -0.5px;
	margin: 8px 0 0;
}
.shared-main h2 {
	font-size: 16px;
	margin: 8px 0 14px;
	line-height: 1.4;
}
.shared-main h3,
.shared-inspector h3 {
	font-size: 13px;
	font-weight: 600;
	margin: 20px 0 10px;
}
.shared-description {
	color: var(--muted);
	font-size: 13px;
	line-height: 1.7;
	max-width: 510px;
	margin: 16px 0 24px;
}
.shared-count,
.shared-reference {
	display: inline-flex;
	gap: 5px;
	align-items: center;
	color: var(--muted);
	font-size: 10px;
	white-space: nowrap;
}
.shared-reference {
	margin: 7px 0 5px 8px;
}
.shared-count svg,
.shared-reference svg {
	width: 13px;
	height: 13px;
}
.shared-tree {
	padding: 10px 0 22px;
}
.shared-expression {
	display: inline-flex;
	align-items: stretch;
	flex-wrap: wrap;
	max-width: 100%;
	border: 1px solid color-mix(in srgb, var(--shared-green) 24%, var(--line));
	background: color-mix(in srgb, var(--shared-green) 4%, var(--paper));
	border-radius: 8px;
	padding: 3px;
	gap: 1px;
	text-align: left;
	font-size: 13px;
	line-height: 1.6;
	color: var(--shared-green);
	vertical-align: middle;
}
.shared-expression:hover {
	border-color: var(--shared-green);
}
.shared-subject {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: color-mix(in srgb, var(--shared-blue) 8%, var(--paper));
	color: var(--shared-blue);
	border-radius: 5px;
	padding: 3px 7px;
	font-weight: 550;
}
.shared-subject svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}
.shared-predicate {
	padding: 3px 7px;
}
.shared-nest {
	margin: 12px 0 4px 9px;
	padding-left: 12px;
	border-left: 1px solid var(--line);
}
.shared-line {
	display: grid;
	grid-template-columns: 35px minmax(0, 1fr);
	align-items: baseline;
	gap: 6px;
	margin: 10px 0;
}
.shared-operator {
	color: var(--shared-purple);
	background: color-mix(in srgb, var(--shared-purple) 7%, transparent);
	border-radius: 4px;
	padding: 3px 0;
	text-align: center;
	font-size: 9px;
	font-weight: 650;
	letter-spacing: 0.4px;
}
.shared-alternative {
	font-size: 13px;
	color: var(--shared-green);
}
.shared-muted {
	font-size: 12px;
	color: var(--muted);
	line-height: 1.7;
}
.shared-trial,
.shared-consumers {
	border-top: 1px solid var(--line);
	padding-top: 20px;
	margin-top: 14px;
}
.shared-trial select {
	max-width: 100%;
	font-size: 12px;
	padding: 9px 12px;
}
.shared-result {
	margin: 18px 0;
}
.shared-result p {
	font-size: 13px;
	line-height: 1.7;
	color: var(--muted);
	margin: 10px 0;
}
.shared-verdict {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	color: var(--muted);
}
.shared-verdict svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
}
.shared-verdict.yes {
	color: var(--ok);
}
.shared-workspace details {
	font-size: 12px;
	color: var(--muted);
	line-height: 1.7;
	margin-top: 18px;
}
.shared-workspace summary {
	cursor: pointer;
	color: var(--ink);
}
.shared-workspace pre {
	max-height: 420px;
	overflow: auto;
	padding: 12px;
	background: var(--sunken);
	border: 1px solid var(--line);
	border-radius: 7px;
	font-size: 10px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.shared-workspace code {
	font-size: 10px;
	overflow-wrap: anywhere;
}
.shared-about {
	border-top: 1px solid var(--line);
	padding-top: 20px;
}
.shared-use {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 10px;
	text-align: left;
	padding: 12px 0;
	border: 0;
	border-bottom: 1px solid var(--line);
	background: transparent;
	color: var(--ink);
	font-size: 13px;
}
.shared-use > svg:last-child {
	margin-left: auto;
	width: 14px;
	flex-shrink: 0;
}
.shared-propose {
	margin-top: 26px;
}
.shared-propose .btn {
	font-size: 12px;
	white-space: normal;
}
.shared-propose p {
	margin-top: 10px;
}
.shared-notice {
	color: var(--ok);
	font-size: 12px;
	line-height: 1.7;
}
.shared-notice:empty {
	display: none;
}
.shared-inspector {
	position: sticky;
	top: 80px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 20px;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
	min-width: 0;
}
.shared-inspector header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.shared-inspector h2 {
	font-size: 18px;
	margin: 18px 0 12px;
}
.shared-inspector p {
	font-size: 12px;
	line-height: 1.7;
}
.shared-close {
	display: grid;
	place-items: center;
	padding: 5px;
	background: transparent;
	color: var(--muted);
	border: 0;
}
.shared-dependency {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 9px 0;
	width: 100%;
	border: 0;
	background: transparent;
	font-size: 12px;
	text-align: left;
	color: var(--ink);
}
.shared-dependency svg {
	flex: 0 0 14px;
}
.shared-inspector .shared-use {
	flex-wrap: wrap;
}
.shared-inspector .shared-use small {
	width: 100%;
	order: 1;
	margin-top: 0;
}
.shared-identity {
	display: block;
	color: var(--muted);
	padding: 10px 0;
}
.shared-impact > p {
	font-size: 13px;
	line-height: 1.7;
}
.shared-impact > .shared-section-head {
	align-items: flex-start;
}
.shared-proposal-tree {
	margin: 20px 0;
	border-left: 2px solid var(--shared-purple);
	padding-left: 12px;
}
.shared-impact-grid {
	display: grid;
	gap: 20px;
	margin: 20px 0;
}
.shared-impact-card {
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 18px;
	min-width: 0;
}
.shared-impact-card h3 {
	margin: 0 0 5px;
}
.shared-impact-card table {
	table-layout: fixed;
	width: 100%;
	margin: 16px 0;
	font-size: 11px;
	border-collapse: collapse;
}
.shared-impact-card th,
.shared-impact-card td {
	text-align: left;
	padding: 10px 6px;
	border-bottom: 1px solid var(--line);
	white-space: normal;
	overflow-wrap: anywhere;
}
.shared-impact-card th:first-child {
	width: 42%;
}
.shared-impact-card tbody th {
	font-weight: 400;
}
.shared-impact-card tr.changed {
	background: var(--ok-soft);
}
.shared-adopted {
	color: var(--ok);
	font-size: 12px;
}
.shared-impact-card .btn {
	font-size: 12px;
	white-space: normal;
}
@media (max-width: 1250px) {
	.shared-workspace.has-inspector .shared-layout {
		grid-template-columns: 170px minmax(0, 1fr);
		gap: 24px;
	}
	.shared-inspector {
		position: fixed;
		z-index: 35;
		top: 76px;
		right: 12px;
		bottom: 12px;
		width: 300px;
		max-width: calc(100vw - 24px);
		max-height: none;
		box-shadow: var(--shadow-lg);
	}
}
@media (max-width: 800px) {
	.shared-layout,
	.shared-workspace.has-inspector .shared-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}
	.shared-library {
		position: static;
	}
	#shared-library-results {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
	.shared-library-group {
		margin-top: 18px;
	}
	.shared-main {
		padding: 22px 16px;
	}
	.shared-main h1 {
		font-size: 22px;
	}
	.shared-inspector {
		top: 64px;
	}
	.shared-section-head {
		flex-wrap: wrap;
	}
	.shared-count {
		margin-top: 8px;
	}
}
@media (max-width: 420px) {
	.shared-main {
		padding: 20px 10px;
	}
	.shared-nest {
		margin-left: 3px;
		padding-left: 5px;
	}
	.shared-line {
		grid-template-columns: 27px minmax(0, 1fr);
		gap: 4px;
	}
	.shared-expression {
		font-size: 12px;
	}
	.shared-impact-card {
		padding: 10px;
	}
	.shared-impact-card th,
	.shared-impact-card td {
		padding: 8px 3px;
	}
	.shared-verdict {
		gap: 3px;
		font-size: 10px;
		flex-wrap: wrap;
	}
	.shared-top {
		gap: 10px;
	}
	.shared-reference {
		margin-left: 0;
	}
}

/* Decision workspace prototype: facts, reasoning and live cases in one place. */
.proto {
	--term-data: var(--accent-2);
	--term-knowledge: #3fb488;
	--term-input: #5b8def;
	--term-open: var(--warn);
}
.proto-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
	padding: 9px 14px;
	border: 1px dashed var(--line-2);
	border-radius: 10px;
	background: var(--surface-2);
	font-size: 13px;
	color: var(--muted);
}
.proto-banner strong {
	color: var(--ink);
}
.proto-banner .proto-link {
	margin-left: auto;
}
.proto-link {
	padding: 0;
	border: 0;
	background: none;
	font-size: 13px;
	font-weight: 550;
	color: var(--ink-2);
	text-decoration: underline;
	text-decoration-color: var(--line-2);
	text-underline-offset: 3px;
	cursor: pointer;
}
.proto-link:hover {
	color: var(--ink);
	text-decoration-color: currentColor;
}

/* Start and drafting */
.proto-start,
.proto-drafting {
	max-width: 780px;
	margin: 12px auto 40px;
}
.proto-start h1,
.proto-drafting h1 {
	font-size: clamp(34px, 4vw, 48px);
	letter-spacing: -0.04em;
	margin-bottom: 12px;
}
.proto-start > p {
	max-width: 620px;
	font-size: 16px;
	color: var(--muted);
}
.proto-question {
	margin: 26px 0 18px;
}
.proto-question input {
	height: 56px;
	padding: 0 18px;
	border-radius: 14px;
	font-family: var(--font-display);
	font-size: 22px;
	font-weight: 600;
	letter-spacing: -0.02em;
}
.proto-answer-shape {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 30px;
	padding: 0;
	border: 0;
}
.proto-answer-shape legend {
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-2);
}
.proto-answer-shape span {
	padding: 7px 13px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	font-size: 13px;
	color: var(--muted);
}
.proto-answer-shape span.on {
	border-color: var(--ink);
	color: var(--ink);
	font-weight: 600;
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.proto-start h2 {
	margin: 0 0 4px;
	font-size: 17px;
}
.proto-sources {
	margin: 14px 0 28px;
	padding: 0;
	list-style: none;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--surface);
	overflow: hidden;
}
.proto-sources li {
	display: grid;
	grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.1fr);
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--line);
	font-size: 13.5px;
}
.proto-sources li:last-child {
	border-bottom: 0;
}
.proto-sources .icon {
	width: 18px;
	height: 18px;
	padding: 2px;
	border-radius: 50%;
	background: var(--accent);
	color: #0b0c0a;
	stroke-width: 2.4;
}
.proto-sources li.off {
	color: var(--muted);
	background: var(--surface-2);
}
.proto-sources li.off .icon {
	background: var(--sunken);
	color: var(--muted);
}
.proto-sources strong,
.proto-sources small {
	display: block;
}
.proto-sources em {
	font-style: normal;
	font-size: 12.5px;
	color: var(--muted);
}
.proto-drafting ol {
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
}
.proto-drafting li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
	font-size: 15px;
	color: var(--faint);
	transition: color 0.3s;
}
.proto-drafting li.active {
	color: var(--ink);
}
.proto-drafting li.done {
	color: var(--ink-2);
}
.proto-drafting li .icon {
	width: 18px;
	height: 18px;
	padding: 2px;
	border-radius: 50%;
	background: var(--accent);
	color: #0b0c0a;
	stroke-width: 2.6;
}
.proto-spinner {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 2px solid var(--line-2);
}
.proto-drafting li.active .proto-spinner {
	border-top-color: var(--accent-2);
	animation: proto-spin 0.8s linear infinite;
}
@keyframes proto-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Workspace frame */
.proto-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 18px;
}
.proto-head h1 {
	margin-bottom: 6px;
	font-size: 34px;
	letter-spacing: -0.035em;
}
.proto-head p {
	margin: 0;
	color: var(--muted);
}
.proto-status {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: stage;
}
.proto-status li {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px 6px 8px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 550;
	color: var(--faint);
	counter-increment: stage;
}
.proto-status li::before {
	content: counter(stage);
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 1px solid var(--line-2);
	font-size: 11px;
}
.proto-status li.current {
	background: var(--surface);
	color: var(--ink);
	box-shadow:
		0 0 0 1px var(--line),
		var(--shadow-xs);
}
.proto-status li.current::before {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--canvas);
}
.proto-status li.passed {
	color: var(--ok);
}
.proto-status li.passed::before {
	content: "✓";
	background: var(--ok-soft);
	border-color: transparent;
}
.proto-guide {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(120px, 220px) auto;
	align-items: center;
	gap: 18px;
	margin-bottom: 16px;
	padding: 14px 16px;
	border: 1px solid color-mix(in srgb, var(--accent-2) 45%, transparent);
	border-radius: 14px;
	background: var(--accent-soft);
}
.proto-guide.complete {
	border-color: color-mix(in srgb, var(--ok) 35%, transparent);
	background: var(--ok-soft);
}
.proto-guide-main {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-width: 0;
}
.proto-guide-main > .icon {
	width: 20px;
	height: 20px;
	margin-top: 1px;
	color: var(--accent-ink);
}
.proto-guide strong,
.proto-guide span {
	display: block;
}
.proto-guide strong {
	font-size: 14.5px;
}
.proto-guide span {
	font-size: 13px;
	color: var(--ink-2);
}
.proto-guide .progress {
	margin: 0;
}
.proto-grid {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr) 350px;
	gap: 16px;
	align-items: start;
}
.proto-pane {
	min-width: 0;
	padding: 18px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}
.proto-facts,
.proto-try {
	position: sticky;
	top: 76px;
	max-height: calc(100vh - 92px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.proto-pane-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}
.proto-pane-head h2 {
	margin: 0;
	font-family: var(--font-sans);
	font-size: 15px;
	letter-spacing: -0.01em;
}

/* Facts */
.proto-facts h3 {
	margin: 16px 0 6px;
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted);
}
.proto-facts ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.proto-facts li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 6px 0;
	font-size: 13px;
}
.proto-facts li > .icon {
	width: 26px;
	height: 26px;
	padding: 5px;
	flex-shrink: 0;
	border-radius: 7px;
	background: var(--sunken);
	border: 1px solid var(--line);
	color: var(--ink-2);
}
.proto-facts li strong,
.proto-facts li small {
	display: block;
}
.proto-facts li small {
	font-size: 12px;
}
.proto-unlinked {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding: 9px 11px;
	border-radius: 10px;
	background: var(--warn-soft);
	font-size: 12.5px;
	font-weight: 550;
	color: var(--warn);
}
.proto-unlinked.done {
	background: var(--ok-soft);
	color: var(--ok);
}
.proto-term-card {
	margin: -4px -4px 14px;
	padding: 14px;
	border-radius: 12px;
	border: 1px solid var(--line-2);
	background: var(--surface-2);
	font-size: 13px;
}
.proto-term-card .eyebrow {
	margin-bottom: 4px;
}
.proto-term-card h3 {
	margin: 0 0 8px;
	font-family: var(--font-serif);
	font-size: 18px;
	font-style: italic;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ink);
}
.proto-term-card p {
	margin: 0 0 8px;
	line-height: 1.5;
}
.proto-term-target {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	font-weight: 600;
}
.term-card-open {
	border-color: color-mix(in srgb, var(--warn) 40%, transparent);
	background: var(--warn-soft);
}
.proto-term-card .tags {
	margin-bottom: 8px;
}
.proto-term-card .btn {
	margin: 0 10px 0 0;
}

/* Reasoning */
.proto-levels {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: 10px;
	background: var(--sunken);
	border: 1px solid var(--line);
}
.proto-levels button,
.proto-seg button {
	height: 28px;
	padding: 0 11px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	font-size: 12.5px;
	font-weight: 550;
	color: var(--muted);
}
.proto-levels button[aria-pressed="true"],
.proto-seg button[aria-pressed="true"] {
	background: var(--surface);
	color: var(--ink);
	box-shadow:
		0 0 0 1px var(--line),
		var(--shadow-xs);
}
.proto-structure {
	display: flex;
	gap: 10px;
	margin-bottom: 8px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--surface-2);
	border: 1px solid var(--line);
	font-size: 13px;
	color: var(--ink-2);
}
.proto-structure p {
	margin: 0;
	line-height: 1.5;
}
.proto-structure .icon {
	color: var(--accent-ink);
	margin-top: 2px;
}
.proto-legend-terms {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0 0 6px;
	font-size: 12px;
	color: var(--muted);
}
.proto-legend-terms span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.proto-legend-terms i {
	width: 16px;
	height: 0;
	border-bottom: 2px solid;
}
.lg-data {
	border-color: var(--term-data) !important;
}
.lg-knowledge {
	border-color: var(--term-knowledge) !important;
}
.lg-input {
	border-color: var(--term-input) !important;
}
.lg-rule {
	border-bottom-style: dashed !important;
	border-color: var(--faint) !important;
}
.lg-open {
	border-bottom-style: dotted !important;
	border-color: var(--term-open) !important;
}
.proto-note {
	font-size: 12.5px;
	color: var(--muted);
}
.proto-rule {
	position: relative;
	margin: 0;
	padding: 16px 4px 14px 0;
	border-top: 1px solid var(--line);
	scroll-margin-top: 90px;
}
.proto-rule[data-depth="1"] {
	margin-left: 22px;
}
.proto-rule[data-depth="2"] {
	margin-left: 44px;
}
.proto-rule[data-depth="1"]::before,
.proto-rule[data-depth="2"]::before {
	content: "";
	position: absolute;
	left: -14px;
	top: 16px;
	bottom: 14px;
	width: 2px;
	border-radius: 2px;
	background: var(--line-2);
}
.proto-rule.kind-unless::before {
	background: var(--term-input);
}
.proto-rule.kind-never-if::before {
	background: var(--err);
}
.proto-rule-line {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}
.proto-n {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--muted);
}
.proto-kind {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--sunken);
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-2);
}
.kind-unless .proto-kind {
	background: color-mix(in srgb, var(--term-input) 14%, transparent);
	color: var(--term-input);
}
.kind-never-if .proto-kind {
	background: var(--err-soft);
	color: var(--err);
}
.kind-decision .proto-kind {
	background: var(--ink);
	color: var(--canvas);
}
.proto-rule-line .proto-mark {
	margin-left: auto;
}
.proto-sentence {
	margin: 0 0 10px;
	font-family: var(--font-serif);
	font-size: 19px;
	line-height: 1.55;
	letter-spacing: -0.005em;
}
.kind-decision .proto-sentence {
	font-size: 22px;
}
.proto-rule.pending .proto-sentence {
	color: var(--ink-2);
}
.proto-rule.pending {
	border-top-style: dashed;
}
.term {
	display: inline;
	padding: 0 1px;
	margin: 0;
	border: 0;
	border-bottom: 2px solid var(--term-data);
	border-radius: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	cursor: pointer;
	transition: background 0.15s;
}
.term:hover,
.term.selected {
	background: var(--accent-soft);
}
.term.selected {
	outline: 2px solid var(--ring);
	outline-offset: 2px;
	border-radius: 2px;
}
.term-knowledge {
	border-bottom-color: var(--term-knowledge);
}
.term-input {
	border-bottom-color: var(--term-input);
}
.term-rule {
	border-bottom: 2px dashed var(--faint);
}
.term-open {
	border-bottom: 2px dotted var(--term-open);
	background: var(--warn-soft);
}
.proto-cite {
	margin: 0 0 10px;
	padding: 8px 12px;
	border-left: 2px solid var(--line-2);
	font-size: 13px;
	line-height: 1.5;
	color: var(--ink-2);
}
.proto-cite small,
.proto-why blockquote small,
.proto-versus small {
	display: block;
	margin-bottom: 2px;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--muted);
}
.proto-cite-none {
	font-size: 12.5px;
	color: var(--warn);
}
.proto-engine {
	margin: 0 0 10px;
	padding: 12px 14px;
	border-radius: 10px;
	background: #0c0d0b;
	color: #dfe2d8;
	font-size: 12px;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.proto-suggested {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 8px 8px 8px 12px;
	border-radius: 10px;
	border: 1px dashed color-mix(in srgb, var(--accent-2) 60%, transparent);
	background: var(--accent-soft);
	font-size: 13px;
}
.proto-suggested > span {
	display: flex;
	align-items: center;
	gap: 7px;
	flex: 1 1 200px;
	color: var(--ink-2);
}
.proto-suggested .icon {
	color: var(--accent-ink);
}
.proto-rule.dismissed {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	font-size: 13px;
	color: var(--faint);
}
.proto-dismissed {
	text-decoration: line-through;
}
.proto-card {
	margin: 10px 0 4px;
	padding: 14px;
	border: 1px solid var(--line);
	border-left: 3px solid var(--ink-2);
	border-radius: 12px;
	background: var(--surface-2);
	font-size: 13.5px;
}
.proto-knowledge {
	border-left-color: var(--term-knowledge);
}
.proto-conflict {
	border-left-color: var(--err);
}
.proto-gap {
	border-left-color: var(--warn);
}
.proto-draft {
	border-left-color: var(--accent-2);
	margin-top: 16px;
}
.proto-card-head {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 6px;
}
.proto-card-head strong {
	font-size: 14px;
}
.proto-from {
	margin-left: auto;
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
	color: var(--muted);
}
.proto-card p {
	margin: 0 0 10px;
	color: var(--ink-2);
	line-height: 1.5;
}
.proto-choices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 8px;
}
.proto-choice {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	border: 1px solid var(--line-2);
	border-radius: 10px;
	background: var(--surface);
	text-align: left;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}
.proto-choice:hover {
	border-color: var(--faint);
}
.proto-choice.chosen {
	border-color: var(--ink);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.proto-choice strong,
.proto-choice small {
	display: block;
}
.proto-choice strong {
	font-size: 13.5px;
}
.proto-choice small {
	margin-top: 2px;
	font-size: 12px;
	color: var(--muted);
}
.proto-choice em {
	flex-shrink: 0;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--accent-soft);
	font-size: 10.5px;
	font-style: normal;
	font-weight: 650;
	color: var(--accent-ink);
}
.proto-versus {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 10px;
}
.proto-versus blockquote {
	margin: 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--surface);
	border: 1px solid var(--line);
	font-size: 13px;
	line-height: 1.5;
}
.proto-decided {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 8px 0 2px;
	font-size: 13px;
	color: var(--ok);
	scroll-margin-top: 90px;
}
.proto-decided > span {
	color: var(--ink-2);
}
.proto-decided .icon {
	width: 15px;
	height: 15px;
	stroke-width: 2.4;
}
.proto-findings {
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}
.proto-findings li {
	display: flex;
	gap: 8px;
	padding: 4px 0;
	font-size: 13px;
}
.proto-composer {
	display: flex;
	gap: 12px;
	margin-top: 14px;
	padding: 14px;
	border: 1.5px dashed var(--line-2);
	border-radius: 12px;
	font-size: 13.5px;
}
.proto-composer > .icon {
	color: var(--accent-ink);
	margin-top: 2px;
}
.proto-composer p {
	margin: 2px 0 10px;
	color: var(--muted);
}
.proto-example {
	padding: 7px 12px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	font-size: 13px;
	font-style: italic;
	color: var(--ink-2);
}
.proto-example:hover {
	border-color: var(--faint);
	color: var(--ink);
}

/* Marks and outcomes */
.proto-mark {
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	border-radius: 50%;
	font-size: 10.5px;
	font-weight: 700;
	background: var(--sunken);
	color: var(--muted);
}
.proto-mark .icon {
	width: 13px;
	height: 13px;
	stroke-width: 2.4;
}
.mark-yes {
	background: var(--ok-soft);
	color: var(--ok);
}
.mark-if {
	background: var(--accent-soft);
	color: var(--accent-ink);
}
.mark-no {
	background: var(--err-soft);
	color: var(--err);
}
.mark-conflict {
	background: var(--warn-soft);
	color: var(--warn);
}
.mark-unknown {
	background: var(--sunken);
	color: var(--ink-2);
	box-shadow: inset 0 0 0 1px var(--line-2);
}
.mark-na,
.mark-overridden {
	background: transparent;
	color: var(--faint);
}
.proto-locked {
	padding: 20px 6px;
	text-align: center;
}
.proto-locked > .icon {
	width: 40px;
	height: 40px;
	padding: 10px;
	border-radius: 12px;
	background: var(--sunken);
	color: var(--ink-2);
}
.proto-locked h3 {
	margin: 12px 0 6px;
	font-size: 15px;
}
.proto-locked p {
	font-size: 13px;
	color: var(--muted);
}
.proto-cases {
	display: grid;
	gap: 6px;
	margin-bottom: 14px;
}
.proto-cases button {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
	text-align: left;
	transition:
		border-color 0.15s,
		background 0.15s;
}
.proto-cases button:hover {
	border-color: var(--line-2);
}
.proto-cases button[aria-pressed="true"] {
	border-color: var(--ink);
	background: var(--surface-2);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.proto-cases strong,
.proto-cases small {
	display: block;
}
.proto-cases strong {
	font-size: 13px;
}
.proto-cases small {
	font-size: 11.5px;
}
.proto-outcome {
	padding: 14px;
	border-radius: 12px;
	background: var(--sunken);
	border: 1px solid var(--line);
	font-size: 13.5px;
}
.proto-outcome-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
	font-family: var(--font-display);
	font-size: 20px;
	letter-spacing: -0.02em;
}
.proto-outcome-head .icon {
	width: 22px;
	height: 22px;
	padding: 3px;
	border-radius: 50%;
	stroke-width: 2.4;
	background: var(--surface);
}
.proto-outcome p {
	margin: 0;
	line-height: 1.5;
}
.proto-outcome ul {
	margin: 8px 0 0;
	padding-left: 18px;
}
.proto-outcome li {
	margin-bottom: 4px;
}
.state-yes {
	background: var(--ok-soft);
	border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.state-yes .proto-outcome-head {
	color: var(--ok);
}
.state-if {
	background: var(--accent-soft);
	border-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
}
.state-if .proto-outcome-head {
	color: var(--accent-ink);
}
.state-no {
	background: var(--err-soft);
	border-color: color-mix(in srgb, var(--err) 30%, transparent);
}
.state-no .proto-outcome-head {
	color: var(--err);
}
.state-conflict {
	background: var(--warn-soft);
	border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
.state-conflict .proto-outcome-head {
	color: var(--warn);
}
.proto-warn {
	display: flex;
	gap: 8px;
	margin-top: 10px !important;
	font-size: 12.5px;
	color: var(--warn);
}
.proto-warn .icon {
	flex-shrink: 0;
	margin-top: 1px;
}
.proto-whatif {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px dashed var(--line-2);
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
}
.proto-whatif.check-label {
	justify-content: flex-start;
	flex-wrap: nowrap;
	cursor: pointer;
}
.proto-whatif.check-label > span {
	font-size: 13px;
	font-weight: 500;
	color: var(--ink);
}
.proto-whatif > span {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--muted);
}
.proto-seg {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: 9px;
	background: var(--sunken);
}
.proto-why {
	margin: 14px 0;
}
.proto-why summary {
	font-size: 13px;
	font-weight: 650;
}
.proto-why ol {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}
.proto-why li {
	padding: 10px 0;
	border-top: 1px solid var(--line);
	font-size: 13px;
}
.proto-why li > div {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}
.proto-why li p {
	margin: 0 0 6px;
	line-height: 1.5;
}
.proto-why blockquote {
	margin: 6px 0 0;
	padding: 8px 10px;
	border-radius: 8px;
	background: var(--paper);
	border: 1px solid var(--line);
	font-family: var(--font-serif);
	font-size: 14px;
	line-height: 1.5;
}
.proto-why blockquote small {
	font-family: var(--font-sans);
}
.proto-try > .btn {
	width: 100%;
}

/* Bottom: cases, coverage, review */
.proto-bottom {
	margin-top: 16px;
	padding: 18px 20px 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}
.proto-bottom .work-tabs {
	margin-bottom: 16px;
}
.proto-suggest-cases {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--accent-soft);
	font-size: 13.5px;
}
.proto-suggest-cases p {
	margin: 0 auto 0 0;
}
.proto-suggest-cases .icon {
	color: var(--accent-ink);
}
.proto-bottom td small {
	display: block;
}
.proto-bottom td:nth-child(4) {
	white-space: nowrap;
}
.proto-bar {
	display: block;
	width: 100%;
	height: 14px;
	margin: 12px 0 10px;
	border-radius: 999px;
	overflow: hidden;
}
.proto-bar .seg-yes,
.proto-legend .seg-yes {
	fill: var(--ok);
	background: var(--ok);
}
.proto-bar .seg-if,
.proto-legend .seg-if {
	fill: var(--accent-2);
	background: var(--accent-2);
}
.proto-bar .seg-unknown,
.proto-legend .seg-unknown {
	fill: var(--line-2);
	background: var(--line-2);
}
.proto-bar .seg-no,
.proto-legend .seg-no {
	fill: var(--err);
	background: var(--err);
}
.proto-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	font-size: 13px;
}
.proto-legend span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.proto-legend i {
	width: 10px;
	height: 10px;
	border-radius: 3px;
}
.proto-bottom .checklist {
	margin-bottom: 14px;
}
.proto-flash {
	animation: proto-flash 1.2s var(--ease);
}
@keyframes proto-flash {
	0%,
	40% {
		box-shadow: 0 0 0 4px var(--accent-soft);
		background-color: var(--accent-soft);
	}
}
@media (max-width: 1280px) {
	.proto-grid {
		grid-template-columns: 220px minmax(0, 1fr) 320px;
	}
}
@media (max-width: 1180px) {
	.proto-grid {
		grid-template-columns: minmax(0, 1fr) 320px;
	}
	.proto-facts {
		position: static;
		grid-column: 1 / -1;
		order: 3;
		max-height: none;
		column-count: 2;
		column-gap: 24px;
	}
	.proto-facts > * {
		break-inside: avoid;
	}
	.proto-head {
		flex-direction: column;
		align-items: flex-start;
	}
}
@media (max-width: 860px) {
	.proto-grid {
		grid-template-columns: minmax(0, 1fr);
	}
	.proto-try {
		position: static;
		max-height: none;
	}
	.proto-facts {
		column-count: 1;
	}
	.proto-guide {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}
	.proto-sources li {
		grid-template-columns: 22px minmax(0, 1fr);
	}
	.proto-sources em {
		grid-column: 2;
	}
	.proto-versus {
		grid-template-columns: minmax(0, 1fr);
	}
	.proto-rule[data-depth="1"] {
		margin-left: 14px;
	}
	.proto-rule[data-depth="2"] {
		margin-left: 28px;
	}
	.proto-rule[data-depth="1"]::before,
	.proto-rule[data-depth="2"]::before {
		left: -10px;
	}
	.proto-suggest-cases {
		flex-direction: column;
		align-items: flex-start;
	}
	.proto-pane-head {
		flex-wrap: wrap;
	}
}
.proto-entry {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 20px;
	padding: 14px 18px;
	border-radius: 14px;
	border: 1px solid #1d1f1b;
	background:
		radial-gradient(
			420px 160px at 100% 0%,
			rgba(198, 240, 74, 0.2),
			transparent 70%
		),
		var(--stage);
	color: var(--stage-ink);
	text-decoration: none;
	box-shadow: var(--shadow-sm);
	transition: transform 0.2s var(--ease);
}
.proto-entry:hover {
	transform: translateY(-1px);
}
.proto-entry > .icon {
	width: 22px;
	height: 22px;
	color: var(--accent);
}
.proto-entry strong,
.proto-entry small {
	display: block;
}
.proto-entry small {
	color: var(--stage-muted);
	font-size: 13px;
}
.proto-entry-go {
	margin-left: auto;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--accent);
	white-space: nowrap;
}
@media (max-width: 640px) {
	.proto-entry {
		flex-wrap: wrap;
	}
	.proto-entry-go {
		margin-left: 36px;
	}
}

/* Guided entry: one decision at a time; detail is opt-in. */
.guided-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 24px 0;
}
.guided-nav .back {
	margin: 0;
}
.guided-page {
	max-width: 680px;
	margin: 48px auto 80px;
}
.guided-page h1 {
	font-size: 28px;
	line-height: 1.25;
	letter-spacing: -0.04em;
	margin: 12px 0 20px;
	outline: none;
}
.guided-page h2 {
	font-size: 18px;
	line-height: 1.4;
}
.guided-page p,
.guided-page li {
	font-size: 15px;
	line-height: 1.7;
}
.guided-lead {
	color: var(--muted);
	margin-bottom: 28px;
}
.guided-example,
.guided-message,
.guided-source-group {
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	margin: 24px 0;
}
.guided-message ul {
	padding-left: 22px;
}
.guided-source-group h2 {
	margin: 0 0 6px;
}
.guided-source-group p + h2 {
	margin-top: 24px;
}
.guided-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 28px 0;
}
.guided-page .guided-footnote {
	font-size: 12px;
	color: var(--muted);
	margin-top: 24px;
}
.guided-page details {
	border-top: 1px solid var(--line);
	padding: 18px 0;
	margin: 0;
}
.guided-page summary {
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}
.guided-page details p {
	font-size: 14px;
}
.guided-source-details ul {
	padding: 0;
	list-style: none;
}
.guided-source-details li {
	padding: 10px 0;
}
.guided-source-details li span {
	display: block;
	font-size: 12px;
	color: var(--muted);
}
.guided-page .proto-card {
	margin: 20px 0;
	padding: 24px;
}
.guided-page .proto-card-head {
	flex-wrap: wrap;
}
.guided-page .proto-card-head > strong {
	font-size: 18px;
	line-height: 1.4;
}
.guided-page .proto-from {
	display: none;
}
.guided-page .proto-choices {
	display: grid;
	grid-template-columns: 1fr;
}
.guided-page .proto-choice {
	white-space: normal;
	text-align: left;
}
.guided-page .proto-choice strong {
	font-size: 14px;
}
.guided-page .proto-choice em {
	font-size: 11px;
}
.guided-page .guided-progress {
	font-size: 12px;
	color: var(--muted);
}
.guided-summary dl {
	margin: 16px 0;
}
.guided-summary dl > div {
	margin: 12px 0;
}
.guided-summary dt {
	font-size: 12px;
	color: var(--muted);
}
.guided-summary dd {
	font-size: 14px;
	margin: 4px 0;
}
.guided-case-label {
	display: block;
	margin: 24px 0 8px;
}
.guided-page select {
	display: block;
	width: 100%;
	margin-top: 8px;
}
.guided-page .proto-outcome {
	margin: 24px 0;
	padding: 24px;
}
.guided-why blockquote {
	border-left: 2px solid var(--line);
	padding-left: 16px;
	margin: 16px 0;
	font-size: 14px;
	line-height: 1.6;
}
.guided-why blockquote small {
	display: block;
	color: var(--muted);
	margin-bottom: 8px;
}
.guided-whatif .check-label {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 20px;
}
.guided-return {
	margin: 20px 0;
}
@media (max-width: 600px) {
	.guided-page {
		margin: 28px auto 40px;
	}
	.guided-page h1 {
		font-size: 24px;
	}
	.guided-example,
	.guided-message,
	.guided-source-group,
	.guided-page .proto-card {
		padding: 18px;
	}
	.guided-page .proto-choice {
		flex-wrap: wrap;
	}
	.guided-page .proto-choice em {
		white-space: normal;
	}
	.guided-nav .btn {
		font-size: 12px;
	}
}

/* Living document: a reasoning tree that lights up when you try it. */
.living {
	--concept: #3867d6;
	--concept-soft: color-mix(in srgb, var(--concept) 10%, transparent);
	--check: #2a8457;
	--op: #7155c9;
	--op-soft: color-mix(in srgb, var(--op) 11%, transparent);
	--tree: var(--line-2);
	--rail: 248px;
	max-width: 1100px;
	margin: 0 auto;
}
[data-theme="dark"] .living {
	--concept: #8eabff;
	--check: #6fd6a6;
	--op: #b7a6ff;
}
.living.started {
	padding-bottom: 96px;
}
.living.console-open {
	padding-bottom: min(46vh, 470px);
}
html:has(.living.started) {
	scroll-padding-top: 84px;
	scroll-padding-bottom: 104px;
}
html:has(.living.console-open) {
	scroll-padding-bottom: calc(min(42vh, 440px) + 28px);
}
.living-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}
.living-top .back {
	margin: 0;
}
.living-meta {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 12.5px;
	color: var(--muted);
}
.living-link {
	padding: 0;
	border: 0;
	background: none;
	font-size: 13px;
	font-weight: 550;
	color: var(--ink-2);
	text-decoration: underline;
	text-decoration-color: var(--line-2);
	text-underline-offset: 3px;
	cursor: pointer;
}
.living-link:hover {
	color: var(--ink);
	text-decoration-color: currentColor;
}

/* Paper */
.living-paper {
	position: relative;
	max-width: 860px;
	margin: 0 auto;
	padding: 52px 60px 36px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 24px;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.6) inset,
		var(--shadow-md);
}
.living-paper > * {
	position: relative;
}
.living-paper > .eyebrow {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 12px;
}
.living-paper > .eyebrow .icon {
	color: var(--accent-ink);
}
.living-paper h1 {
	margin: 0 0 12px;
	font-size: clamp(36px, 4.2vw, 50px);
	letter-spacing: -0.045em;
	line-height: 1.02;
}
.living-intro {
	margin: 0 0 26px;
	max-width: 520px;
	font-size: 16.5px;
	color: var(--muted);
}
#living-seed {
	min-height: 108px;
	padding: 18px 20px;
	border-radius: 18px;
	font-family: var(--font-serif);
	font-size: 23px;
	line-height: 1.45;
	resize: none;
	box-shadow:
		var(--shadow-xs),
		0 0 0 6px var(--sunken);
}
.living-start-actions,
.living-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-top: 18px;
}
.living-seeds {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	font-size: 12.5px;
	color: var(--muted);
}
.living-seeds > span {
	margin-right: 4px;
}
.living-seed-chip {
	padding: 6px 12px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	font-size: 13px;
	color: var(--ink-2);
	transition:
		border-color 0.15s,
		transform 0.15s;
}
.living-seed-chip:hover {
	border-color: var(--faint);
	color: var(--ink);
	transform: translateY(-1px);
}
.living-paper .living-question {
	margin: 0 0 10px;
	font-size: clamp(28px, 3vw, 34px);
	letter-spacing: -0.035em;
	line-height: 1.12;
}
.living-provenance {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	font-size: 13px;
	color: var(--muted);
}
.living-provenance .icon {
	width: 14px;
	height: 14px;
	color: var(--accent-ink);
}
.living-health {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}
.living-health li,
.living-health button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	color: var(--muted);
}
.living-health li {
	padding: 5px 11px 5px 9px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface-2);
}
.living-health strong {
	font-weight: 650;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}
.living-health .icon {
	width: 14px;
	height: 14px;
}
.living-health li.ok .icon {
	color: var(--ok);
}
.living-health li.warn {
	padding: 0;
	border-color: color-mix(in srgb, var(--warn) 35%, transparent);
	background: var(--warn-soft);
}
.living-health li.warn:not(:has(button)) {
	padding: 5px 11px 5px 9px;
	color: var(--warn);
}
.living-health li.warn button {
	padding: 5px 11px 5px 9px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--warn);
	cursor: pointer;
}
.living-health li.warn strong {
	color: var(--warn);
}
.living-health li.warn button:hover {
	background: color-mix(in srgb, var(--warn) 14%, transparent);
}
.living-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	margin: 28px 0 4px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
}
.living-view-switch {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: 10px;
	background: var(--sunken);
	border: 1px solid var(--line);
}
.living-view-switch button {
	height: 28px;
	padding: 0 13px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	font-size: 12.5px;
	font-weight: 550;
	color: var(--muted);
	transition: color 0.15s;
}
.living-view-switch button:hover {
	color: var(--ink);
}
.living-view-switch button[aria-pressed="true"] {
	background: var(--surface);
	color: var(--ink);
	box-shadow:
		0 0 0 1px var(--line),
		var(--shadow-xs);
}
.living-engine-note {
	margin: 0;
	font-size: 12.5px;
	color: var(--muted);
}
.living-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
	color: var(--muted);
}
.living-legend li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.living-legend i {
	display: inline-block;
	width: 12px;
	height: 10px;
	border-radius: 3px;
}
.lg-data {
	background: var(--concept-soft);
	box-shadow: inset 0 0 0 1px
		color-mix(in srgb, var(--concept) 40%, transparent);
}
.lg-check {
	background: color-mix(in srgb, var(--check) 14%, var(--surface));
}
.lg-op {
	background: var(--op-soft);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--op) 40%, transparent);
}
.lg-open {
	height: 0 !important;
	border-bottom: 2px dotted var(--warn);
	border-radius: 0 !important;
}

/* Rows */
.living-document {
	margin: 6px 0 18px;
}
.living-node {
	position: relative;
	padding: 20px 0 12px;
}
.living-node.nested {
	margin-left: 32px;
	padding: 12px 0 8px 20px;
	border-left: 1.5px solid var(--tree);
}
.living-node.nested::before {
	content: "";
	position: absolute;
	left: -1.5px;
	top: 28px;
	width: 14px;
	border-top: 1.5px solid var(--tree);
}
.living-sentence {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr) 30px;
	align-items: start;
	gap: 10px;
}
.living-gutter {
	padding-top: 4px;
}
.living-gutter > span {
	display: block;
	padding-top: 6px;
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--faint);
	text-align: center;
}
.living-gutter .icon-btn,
.living-pencil .icon-btn {
	width: 28px;
	height: 28px;
}
.living-gutter .icon-btn svg,
.functional-toggle svg {
	transition: transform 0.2s var(--ease);
}
.living-gutter .icon-btn[aria-expanded="false"] svg,
.functional-toggle[aria-expanded="false"] svg {
	transform: rotate(-90deg);
}
.living-text {
	min-width: 0;
}
.living-pencil {
	padding-top: 4px;
	opacity: 0;
	transition: opacity 0.15s;
}
.living-node:hover > .living-sentence .living-pencil,
.living-node:focus-within > .living-sentence .living-pencil {
	opacity: 1;
}

/* Words view */
.living-prose {
	margin: 0;
	font-family: var(--font-serif);
	font-size: 23px;
	line-height: 1.6;
	letter-spacing: -0.005em;
	cursor: text;
	text-wrap: pretty;
}
.living-node.nested .living-prose {
	font-size: 18.5px;
	color: var(--ink-2);
}
.living-prose .term {
	display: inline;
	margin: 0;
	padding: 0 1px;
	border: 0;
	background: var(--concept-soft);
	border-radius: 0;
	background: var(--concept-soft);
	font: inherit;
	color: inherit;
	cursor: pointer;
	transition: background 0.15s;
}
.living-prose .term:hover,
.living-prose .term.selected {
	background: var(--accent-soft);
}
.living-prose .term.selected {
	outline: 2px solid var(--ring);
	outline-offset: 2px;
	border-radius: 3px;
}
.living-prose .term-open {
	border-bottom: 0;
	background: var(--warn-soft);
}
.living-prose .term[data-state]::after {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 0 0.45em 3px;
	border-radius: 50%;
	vertical-align: middle;
	background: var(--faint);
}
.living-prose .term[data-state="yes"]::after {
	background: var(--ok);
}
.living-prose .term[data-state="if"]::after {
	background: var(--accent-2);
}
.living-prose .term[data-state="no"]::after {
	background: var(--err);
}
.living-selection,
.living-edit-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 10px 0 0 40px;
}
.living-edit-actions {
	margin-left: 0;
}
.living-edit-actions span,
.living-edited,
.hybrid-pending {
	font-size: 12.5px;
	color: var(--warn);
}
.living-edited {
	margin: 6px 0 0 40px;
}
.living-text textarea {
	width: 100%;
	padding: 10px 12px;
	border-radius: 12px;
	font-family: var(--font-serif);
	font-size: 20px;
	line-height: 1.55;
	resize: none;
	overflow: hidden;
}

/* Logic view: a proof tree. Logic words sit in the margin, meaning on the line. */
.living-hybrid {
	font-family: var(--font-sans);
}
.functional-sentence,
.functional-group {
	display: grid;
	gap: 0;
}
.functional-atom {
	position: relative;
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) 24px 28px;
	align-items: center;
	column-gap: 10px;
	padding: 7px 0;
	border-radius: 10px;
	scroll-margin: 140px 0 55vh;
	transition:
		background 0.25s,
		opacity 0.25s;
}
.functional-atom > .functional-mark {
	grid-column: 3;
}
.functional-atom > .functional-toggle {
	grid-column: 4;
}
.functional-head {
	grid-template-columns: minmax(0, 1fr) auto 28px;
	padding: 0 0 14px;
}
.functional-head > .functional-verdict {
	grid-column: 2;
}
.functional-lead {
	display: flex;
	justify-content: flex-end;
}
.functional-phrase {
	min-width: 0;
	font-size: 16.5px;
	line-height: 1.65;
	color: var(--ink-2);
}
.functional-head > .functional-phrase {
	font-family: var(--font-display);
	font-size: 27px;
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.2;
	color: var(--ink);
}
.functional-subject,
.functional-operation,
.functional-value,
.functional-op {
	max-width: 100%;
	font: inherit;
	text-align: left;
	white-space: normal;
	overflow-wrap: anywhere;
	cursor: pointer;
}
/* A sentence has two quiet, flat highlights; details appear on selection. */
.functional-subject,
.functional-operation {
	display: inline;
	margin: 0;
	padding: 3px 6px;
	border: 0;
	border-radius: 4px;
	text-decoration: none;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	transition: background 0.15s;
}
.functional-subject {
	background: var(--concept-soft);
	color: var(--ink);
	font-weight: 600;
}
.functional-subject .icon {
	display: inline;
	width: 13px;
	height: 13px;
	margin-right: 6px;
	vertical-align: -1px;
	color: var(--concept);
}
.functional-operation {
	background: color-mix(in srgb, var(--check) 7%, var(--surface));
	color: var(--ink-2);
	font-weight: 400;
}
.functional-subject:hover,
.functional-subject.selected {
	background: color-mix(in srgb, var(--concept) 17%, var(--surface));
}
.functional-operation:hover,
.functional-operation.selected {
	background: color-mix(in srgb, var(--check) 15%, var(--surface));
	color: var(--ink);
}
.functional-operation.needs-evidence {
	background: var(--warn-soft);
}
.functional-head .functional-subject,
.functional-head .functional-operation {
	background: transparent;
	padding: 0;
}
.functional-head .functional-subject:hover,
.functional-head .functional-operation:hover {
	background: var(--hover);
}
.functional-value {
	padding: 1px 7px;
	border: 1px solid var(--line-2);
	border-radius: 6px;
	background: var(--sunken);
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--ink-2);
}
.functional-subject.selected,
.functional-operation.selected,
.functional-value.selected {
	outline: 2px solid var(--ring);
	outline-offset: 2px;
}
.functional-op {
	padding: 2px 6px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--op);
	cursor: help;
	transition: background 0.15s;
}
.functional-op:hover {
	background: var(--op-soft);
}
span.functional-op {
	cursor: default;
}
.functional-word {
	padding: 2px 0;
	font-family: var(--font-mono);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--faint);
}
.functional-bracket {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
.functional-group > .functional-group {
	position: relative;
	margin: 2px 0 2px 48px;
	padding: 2px 0 2px 12px;
	border-left: 1.5px dashed color-mix(in srgb, var(--op) 45%, transparent);
}
.functional-group > .functional-group > .functional-lead {
	position: absolute;
	top: 12px;
	left: -48px;
	width: 38px;
}
.functional-added {
	display: inline-block;
	margin-left: 8px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--accent);
	color: #0b0c0a;
	font-family: var(--font-sans);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.02em;
	vertical-align: 2px;
}
.functional-atom.is-added {
	background: color-mix(in srgb, var(--accent) 16%, transparent);
	box-shadow: inset 3px 0 0 var(--accent-2);
}
.functional-toggle {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--faint);
	transition:
		background 0.15s,
		color 0.15s;
}
.functional-toggle:hover,
.functional-atom:hover > .functional-toggle {
	color: var(--ink-2);
}
.functional-toggle:hover {
	background: var(--hover);
}
/* Supporting rules hang from a rail with an elbow to each condition. */
.functional-branch {
	--rail-color: var(--tree);
	position: relative;
	grid-column: 2 / -1;
	margin: 2px 0 4px;
	padding: 2px 0 2px 14px;
	animation: living-branch 0.25s var(--ease);
}
@keyframes living-branch {
	from {
		opacity: 0;
		transform: translateY(-3px);
	}
}
/* Each condition draws its own elbow and rail segment; the last one stops at
   its elbow, so rails never run past the final child. */
.functional-branch .functional-atom::before,
.functional-branch .functional-atom::after {
	content: "";
	position: absolute;
	left: -15.5px;
	pointer-events: none;
}
.functional-branch .functional-atom::before {
	top: 22px;
	width: 10px;
	border-top: 1.5px solid var(--rail-color);
}
.functional-branch .functional-atom::after {
	top: -2px;
	bottom: 0;
	border-left: 1.5px solid var(--rail-color);
}
.functional-branch
	.functional-atom:nth-last-child(1 of .functional-atom)::after {
	bottom: auto;
	height: 25.5px;
}
.functional-branch .functional-phrase {
	font-size: 15.5px;
}
.functional-branch .functional-atom {
	grid-template-columns: 38px minmax(0, 1fr) 24px 28px;
}
.functional-branch .living-inspector {
	margin-left: 0;
}
.functional-branch > [data-branch-edit] {
	position: absolute;
	top: -2px;
	right: -34px;
	width: 26px;
	height: 26px;
	opacity: 0;
	transition: opacity 0.15s;
}
.functional-branch:hover > [data-branch-edit],
.functional-branch > [data-branch-edit]:focus-visible {
	opacity: 1;
}
.functional-branch > [data-branch-edit] .icon {
	width: 14px;
	height: 14px;
}

/* Marks and the conclusion's verdict */
.functional-mark {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	font-size: 10.5px;
	font-weight: 700;
	background: var(--sunken);
	color: var(--muted);
	transition: transform 0.15s;
}
button.functional-mark:hover {
	transform: scale(1.12);
}
.functional-mark .icon,
.functional-verdict .icon {
	width: 13px;
	height: 13px;
	stroke-width: 2.5;
}
.functional-verdict {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 12px 0 9px;
	border: 0;
	border-radius: 999px;
	font-family: var(--font-sans);
	font-size: 13px;
	font-weight: 650;
	white-space: nowrap;
	cursor: pointer;
	transition: transform 0.15s;
}
.functional-verdict:hover {
	transform: translateY(-1px);
}
.mark-yes {
	background: var(--ok-soft);
	color: var(--ok);
}
.mark-if {
	background: var(--accent-soft);
	color: var(--accent-ink);
}
.mark-unknown {
	background: var(--sunken);
	color: var(--ink-2);
	box-shadow: inset 0 0 0 1px var(--line-2);
}
.mark-no {
	background: var(--err-soft);
	color: var(--err);
}
.mark-na {
	background: transparent;
	color: var(--faint);
}
.mark-interp {
	background: var(--warn-soft);
	color: var(--warn);
}
/* Trying a case lights the tree: rails take the parent's outcome, and
   conditions that don't matter for this case step back. */
.functional-atom[data-state="yes"] > .functional-branch {
	--rail-color: color-mix(in srgb, var(--ok) 55%, transparent);
}
.functional-atom[data-state="if"] > .functional-branch {
	--rail-color: color-mix(in srgb, var(--accent-2) 80%, transparent);
}
.functional-atom[data-state="no"] > .functional-branch {
	--rail-color: color-mix(in srgb, var(--err) 55%, transparent);
}
.functional-atom[data-state="na"] > .functional-phrase,
.functional-atom[data-state="na"] > .functional-lead,
.functional-atom[data-state="na"] > .functional-branch {
	opacity: 0.45;
}
.functional-atom[data-state="yes"] > .functional-phrase .functional-operation {
	text-decoration-color: var(--ok);
}
.functional-atom[data-state="no"] > .functional-phrase .functional-operation {
	text-decoration-color: var(--err);
}
.functional-atom[data-state="if"] > .functional-phrase .functional-operation {
	text-decoration-color: var(--accent-2);
}
.living-flash {
	animation: living-flash 1.4s var(--ease);
}
@keyframes living-flash {
	0%,
	45% {
		background: var(--accent-soft);
		box-shadow: 0 0 0 4px var(--accent-soft);
	}
}

/* Inspector: one local detail at a time. */
.living-inspector {
	position: relative;
	margin: 10px 0 8px 40px;
	padding: 16px 18px 12px;
	border: 1px solid var(--line-2);
	border-radius: 16px;
	background: var(--surface);
	box-shadow: var(--shadow-md);
	font-size: 14px;
	animation: living-branch 0.2s var(--ease);
}
.living-inspector.unresolved {
	border-color: color-mix(in srgb, var(--warn) 40%, transparent);
	box-shadow:
		inset 3px 0 0 var(--warn),
		var(--shadow-md);
}
.living-detail-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.living-detail-head .eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}
.living-detail-head .eyebrow .icon {
	width: 13px;
	height: 13px;
	color: var(--concept);
}
.living-inspector.unresolved .eyebrow,
.living-inspector.unresolved .eyebrow .icon {
	color: var(--warn);
}
.living-detail-head .icon-btn {
	width: 28px;
	height: 28px;
	margin: -4px -6px 0 0;
}
.living-inspector h3 {
	margin: 2px 0 8px;
	font-family: var(--font-serif);
	font-size: 22px;
	font-style: italic;
	font-weight: 400;
	letter-spacing: -0.01em;
}
.living-inspector p {
	margin: 0 0 8px;
	line-height: 1.55;
	color: var(--ink-2);
}
.functional-signature {
	display: inline-block;
	margin: 4px 0 8px;
	padding: 5px 9px;
	border-radius: 7px;
	background: #0c0d0b;
	color: #dfe2d8;
	font-size: 12.5px;
}
.living-inspector blockquote {
	margin: 10px 0;
	padding: 10px 12px;
	border-left: 3px solid var(--accent-2);
	border-radius: 0 10px 10px 0;
	background: var(--paper);
	font-family: var(--font-serif);
	font-size: 15.5px;
	line-height: 1.5;
}
.living-inspector.unresolved blockquote {
	border-left-color: var(--warn);
}
.living-inspector blockquote small,
.living-steps blockquote small {
	display: block;
	margin-bottom: 3px;
	font-family: var(--font-sans);
	font-size: 11.5px;
	font-weight: 600;
	color: var(--muted);
}
.living-paper mark,
.living-console mark {
	background: var(--marker);
	border-radius: 3px;
	padding: 0 0.12em;
}
.living-inspector.unresolved mark {
	background: var(--warn-soft);
	box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--warn) 60%, transparent);
}
.living-sage {
	display: flex;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 10px;
	background: var(--accent-soft);
	font-size: 13px;
}
.living-sage .icon {
	flex-shrink: 0;
	margin-top: 2px;
	color: var(--accent-ink);
}
.living-inspector-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 10px 0 6px;
}
.living-inspector-actions:empty {
	display: none;
}
.living-inspector details,
.living-proposal details {
	margin-top: 6px;
	font-size: 13px;
}
.living-paper summary {
	cursor: pointer;
	font-size: 13px;
	font-weight: 550;
	color: var(--muted);
}
.living-small {
	font-size: 12.5px;
	color: var(--muted);
}

/* SAGE's suggestions */
.living-draft-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin: 8px 0 18px;
	padding: 10px 12px 10px 14px;
	border-radius: 14px;
	font-size: 13px;
	color: var(--muted);
}
.living-draft-status > span {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-right: auto;
}
.living-draft-status > span .icon {
	width: 15px;
	height: 15px;
	color: var(--ok);
}
.living-draft-status.suggested {
	border: 1px dashed color-mix(in srgb, var(--accent-2) 60%, transparent);
	background: var(--accent-soft);
	color: var(--ink-2);
}
.living-draft-status.suggested > span .icon {
	color: var(--accent-ink);
}
.living-draft-status .btn,
.living-actions .btn {
	height: 30px;
	padding: 0 13px;
	border-radius: 8px;
	font-size: 12.5px;
}
.living-proposal {
	margin: 8px 0 18px;
	padding: 18px 20px 14px;
	border: 1px solid color-mix(in srgb, var(--accent-2) 50%, transparent);
	border-radius: 18px;
	background: var(--surface);
	box-shadow: var(--shadow-md);
	animation: living-branch 0.25s var(--ease);
}
.living-proposal-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}
.living-proposal-head .icon {
	color: var(--accent-ink);
}
.living-proposal-head .eyebrow {
	margin: 0;
}
.living-proposal .living-hybrid {
	pointer-events: none;
}
.living-proposal .functional-head > .functional-phrase {
	font-size: 20px;
}
.living-proposal-text {
	margin: 0 0 8px;
	font-family: var(--font-serif);
	font-size: 19px;
	line-height: 1.55;
}
.living-proposal .living-actions {
	margin: 12px 0 4px;
}
.living-composer {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr) 36px;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
	padding: 7px 7px 7px 14px;
	border: 1px solid var(--line-2);
	border-radius: 18px;
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}
.living-composer:focus-within {
	border-color: var(--ring);
	box-shadow: 0 0 0 4px var(--accent-soft);
}
.living-composer-icon .icon {
	color: var(--accent-ink);
}
.living-composer textarea {
	min-height: 24px;
	padding: 6px 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-size: 15px;
	line-height: 1.5;
	resize: none;
	overflow: hidden;
}
.living-composer textarea:focus {
	box-shadow: none;
}
.living-send {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--btn-primary);
	color: var(--btn-primary-ink);
	transition: opacity 0.15s;
}
.living-send .icon {
	transform: rotate(-90deg);
}
.living-send:disabled {
	opacity: 0.25;
}
.living-prompt {
	margin: 10px 0 0;
	padding: 6px 12px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: transparent;
	font-size: 13px;
	font-style: italic;
	color: var(--ink-2);
}
.living-prompt:hover {
	border-color: var(--faint);
	color: var(--ink);
}
.living-footer-actions {
	display: flex;
	gap: 16px;
	margin-top: 14px;
}
.living-footer-actions:empty {
	display: none;
}
.living-note {
	margin: 16px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: var(--surface-2);
	font-size: 13px;
	color: var(--ink-2);
}
.living-sources {
	margin-top: 28px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
}
.living-sources p,
.living-sources a {
	font-size: 13px;
	color: var(--muted);
}
.living-engine {
	margin: 0;
	padding: 16px 18px;
	border-radius: 14px;
	border: 1px solid #1f211d;
	background: #0c0d0b;
	color: #c9ccc2;
	font-size: 13px;
	line-height: 1.8;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.eng-pred {
	color: #eef0e8;
	font-weight: 600;
}
.eng-op {
	color: var(--accent);
	font-weight: 700;
}

/* Scoreboard: every example's outcome at a glance. */
.living-scoreboard {
	display: flex;
	gap: 6px;
}
.living-score {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 28px;
	padding: 0 10px 0 4px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 600;
	color: var(--ink-2);
	cursor: pointer;
	transition:
		border-color 0.15s,
		transform 0.15s;
}
.living-score:hover {
	transform: translateY(-1px);
	border-color: var(--line-2);
}
.living-score.current {
	border-color: var(--ink);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.living-score-mark {
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	font-family: var(--font-sans);
	font-size: 9.5px;
	font-weight: 700;
}
.living-score-mark .icon {
	width: 11px;
	height: 11px;
	stroke-width: 2.6;
}
.living-score.mark-yes,
.living-score.mark-if,
.living-score.mark-no,
.living-score.mark-unknown,
.living-score.mark-interp {
	background: var(--surface);
	box-shadow: none;
	color: var(--ink-2);
}
.living-score.mark-yes .living-score-mark {
	background: var(--ok-soft);
	color: var(--ok);
}
.living-score.mark-if .living-score-mark {
	background: var(--accent-soft);
	color: var(--accent-ink);
}
.living-score.mark-no .living-score-mark {
	background: var(--err-soft);
	color: var(--err);
}
.living-score.mark-unknown .living-score-mark {
	background: var(--sunken);
	color: var(--ink-2);
	box-shadow: inset 0 0 0 1px var(--line-2);
}
.living-score.current {
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.living-score-note {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	color: var(--warn);
}

/* Console: docked under the document, opened from it. */
.living-dock,
.living-console {
	position: fixed;
	right: 0;
	left: var(--rail);
	z-index: 15;
	margin-inline: auto;
}
.living-dock {
	bottom: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	width: min(860px, calc(100vw - var(--rail) - 48px));
	padding: 8px 8px 8px 10px;
	border: 1px solid #22241f;
	border-radius: 18px;
	background: color-mix(in srgb, var(--stage) 92%, transparent);
	color: var(--stage-ink);
	box-shadow:
		0 20px 50px -18px rgba(0, 0, 0, 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	animation: living-rise 0.3s var(--ease);
}
.living-dock-icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 11px;
	background: rgba(198, 240, 74, 0.14);
	color: var(--accent);
}
.living-dock-text {
	display: flex;
	align-items: baseline;
	gap: 10px;
	min-width: 0;
	margin-right: auto;
	font-size: 13px;
	color: var(--stage-muted);
	white-space: nowrap;
	overflow: hidden;
}
.living-dock-text strong {
	font-size: 14px;
	color: var(--stage-ink);
}
.living-dock .living-score {
	border-color: rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.05);
	color: #d5d8ce;
}
.living-dock .living-score:hover {
	border-color: rgba(255, 255, 255, 0.24);
}
.living-dock .living-score.mark-yes .living-score-mark {
	background: rgba(99, 209, 151, 0.18);
	color: #7fe0ad;
}
.living-dock .living-score.mark-if .living-score-mark {
	background: rgba(198, 240, 74, 0.18);
	color: var(--accent);
}
.living-dock .living-score.mark-no .living-score-mark {
	background: rgba(240, 134, 114, 0.18);
	color: #f39a88;
}
.living-dock .living-score.mark-unknown .living-score-mark {
	background: rgba(255, 255, 255, 0.08);
	color: #c9ccc2;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.living-dock .living-score-note {
	color: var(--warn);
}
.living-dock .btn.primary {
	height: 34px;
	border-radius: 11px;
	background: var(--accent);
	color: #0b0c0a;
	box-shadow: 0 8px 20px -8px rgba(198, 240, 74, 0.7);
}
.living-console {
	bottom: 12px;
	display: flex;
	flex-direction: column;
	width: min(1040px, calc(100vw - var(--rail) - 32px));
	max-height: min(42vh, 440px);
	overflow: hidden;
	border: 1px solid var(--line-2);
	border-radius: 20px;
	background: var(--surface);
	box-shadow:
		0 0 0 4px var(--accent-soft),
		0 30px 80px -24px rgba(16, 16, 14, 0.4);
	animation: living-rise 0.28s var(--ease);
}
@keyframes living-rise {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
}
.living-console-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 10px 10px 16px;
	border-bottom: 1px solid var(--line);
	background: var(--surface-2);
}
.living-console-head .living-scoreboard {
	margin-left: auto;
}
.living-console-title {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 650;
}
.living-console-title .icon {
	color: var(--accent-ink);
}
.living-console-head select {
	width: auto;
	height: 32px;
	border-radius: 999px;
	padding-left: 14px;
	font-size: 13px;
	font-weight: 550;
}
.living-console-body {
	display: grid;
	grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
	align-items: start;
	gap: 18px;
	padding: 16px 18px 18px;
	overflow-y: auto;
	scrollbar-width: thin;
}
.living-trial {
	position: sticky;
	top: 0;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--sunken);
}
.living-outcome-head {
	display: flex;
	align-items: center;
	gap: 11px;
}
.living-outcome-icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--surface);
	box-shadow: var(--shadow-xs);
}
.living-outcome-icon .icon {
	width: 17px;
	height: 17px;
	stroke-width: 2.5;
}
.living-trial h3 {
	margin: 0;
	font-family: var(--font-display);
	font-size: 26px;
	letter-spacing: -0.03em;
}
.living-trial > p {
	margin: 10px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--ink-2);
}
.living-trial .living-trial-note {
	margin-top: 14px;
	font-size: 11.5px;
	color: var(--muted);
}
.living-trial.state-yes {
	background: var(--ok-soft);
	border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.living-trial.state-yes h3,
.living-trial.state-yes .living-outcome-icon {
	color: var(--ok);
}
.living-trial.state-if {
	background: var(--accent-soft);
	border-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
}
.living-trial.state-if h3,
.living-trial.state-if .living-outcome-icon {
	color: var(--accent-ink);
}
.living-trial.state-no {
	background: var(--err-soft);
	border-color: color-mix(in srgb, var(--err) 30%, transparent);
}
.living-trial.state-no h3,
.living-trial.state-no .living-outcome-icon {
	color: var(--err);
}
.living-trial.state-interp {
	background: var(--warn-soft);
	border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
.living-trial.state-interp h3,
.living-trial.state-interp .living-outcome-icon {
	color: var(--warn);
}
.living-feed {
	margin-top: 16px;
}
.living-feed > span {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 7px;
	font-size: 12px;
	font-weight: 650;
	color: var(--ink-2);
}
.living-feed > span .icon {
	width: 13px;
	height: 13px;
	color: var(--accent-ink);
}
.living-seg {
	display: flex;
	gap: 2px;
	padding: 3px;
	border-radius: 11px;
	border: 1px solid var(--line);
	background: var(--surface);
}
.living-seg button {
	flex: 1 1 auto;
	height: 30px;
	padding: 0 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	font-size: 12.5px;
	font-weight: 550;
	color: var(--muted);
	white-space: nowrap;
	transition:
		background 0.15s,
		color 0.15s;
}
.living-seg button:hover {
	color: var(--ink);
}
.living-seg button[aria-pressed="true"] {
	background: var(--ink);
	color: var(--canvas);
}
/* Steps read as a trace: marks joined by a line. */
.living-steps {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.living-steps li {
	position: relative;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: 14px;
	transition:
		background 0.2s,
		border-color 0.2s;
}
.living-steps li:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 23px;
	top: 38px;
	bottom: -8px;
	width: 1.5px;
	background: var(--line-2);
}
.living-steps li:hover {
	background: var(--surface-2);
}
.living-steps li.current {
	border-color: color-mix(in srgb, var(--ring) 60%, transparent);
	background: var(--surface-2);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.living-steps li > button {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	text-align: left;
	cursor: pointer;
}
.living-steps li > button strong,
.living-steps li > button span span {
	display: block;
}
.living-steps li > button strong {
	font-size: 14px;
}
.living-steps li > button span span {
	margin-top: 2px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--muted);
}
.living-steps li.step-na > button strong {
	color: var(--muted);
	font-weight: 550;
}
.living-steps blockquote {
	margin: 8px 0 0 36px;
	padding: 8px 12px;
	border-left: 2px solid var(--accent-2);
	border-radius: 0 10px 10px 0;
	background: var(--paper);
	font-family: var(--font-serif);
	font-size: 14.5px;
	line-height: 1.5;
}
.living-steps-empty {
	display: flex;
	gap: 10px;
	padding: 14px;
	color: var(--muted);
	font-size: 13.5px;
}
.living-steps-empty .icon {
	flex-shrink: 0;
	color: var(--accent-ink);
}
.living-steps-empty p {
	margin: 0;
}

@media (hover: none) {
	.living-pencil,
	.functional-branch > [data-branch-edit] {
		opacity: 1;
	}
}
@media (max-width: 1180px) {
	.living {
		--rail: 224px;
	}
	.functional-branch > [data-branch-edit] {
		right: -4px;
		top: -30px;
	}
}
@media (max-width: 860px) {
	.living {
		--rail: 0px;
	}
	.living-console {
		bottom: 8px;
		width: calc(100vw - 16px);
		max-height: 58vh;
	}
	html:has(.living.console-open) {
		scroll-padding-bottom: calc(58vh + 20px);
	}
	.living-console-body {
		grid-template-columns: minmax(0, 1fr);
	}
	.living-trial {
		position: static;
	}
	.living-console-head {
		flex-wrap: wrap;
	}
	.living-console-head .living-scoreboard {
		order: 5;
		width: 100%;
		margin-left: 0;
	}
	.living-dock {
		bottom: 10px;
		width: calc(100vw - 20px);
	}
	.living-dock-text span {
		display: none;
	}
}
@media (max-width: 640px) {
	.living-top .living-meta span {
		display: none;
	}
	.living-paper {
		padding: 28px 18px 22px;
		border-radius: 20px;
	}
	.living-paper .living-question {
		font-size: 25px;
	}
	.living-health li,
	.living-health li.warn button {
		font-size: 12px;
	}
	.living-prose {
		font-size: 19.5px;
	}
	.living-sentence {
		grid-template-columns: 24px minmax(0, 1fr) 24px;
		gap: 6px;
	}
	.living-gutter .icon-btn,
	.living-pencil .icon-btn {
		width: 24px;
		height: 24px;
	}
	.living-node.nested {
		margin-left: 10px;
		padding-left: 12px;
	}
	.living-node.nested::before {
		width: 8px;
	}
	.living-inspector,
	.living-selection,
	.living-edited {
		margin-left: 0;
	}
	/* Narrow screens: the logic word sits above its line with the mark and
	   toggle beside it, so each phrase keeps the full width. */
	.functional-atom,
	.functional-branch .functional-atom {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 1px;
		padding: 6px 0;
	}
	.functional-lead {
		grid-row: 1;
		justify-content: flex-start;
		min-height: 22px;
		align-items: center;
	}
	.functional-phrase {
		grid-column: 1;
		grid-row: 2;
		padding-right: 30px;
		font-size: 15.5px;
	}
	.functional-branch .functional-phrase {
		font-size: 15px;
	}
	.functional-atom > .functional-toggle {
		position: absolute;
		top: 2px;
		right: 0;
	}
	.functional-atom > .functional-mark {
		position: absolute;
		top: 5px;
		right: 32px;
		width: 22px;
		height: 22px;
	}
	.functional-atom:not(:has(> .functional-toggle)) > .functional-mark {
		right: 2px;
	}
	.functional-head {
		grid-template-columns: minmax(0, 1fr);
		padding-bottom: 10px;
	}
	.functional-head > .functional-phrase {
		grid-row: 1;
		padding-right: 0;
		font-size: 22px;
	}
	.functional-head > .functional-verdict {
		grid-column: 1;
		grid-row: 2;
		justify-self: start;
		margin-top: 6px;
	}
	.functional-op {
		padding: 1px 4px;
		margin-left: -4px;
		font-size: 10px;
	}
	.functional-word {
		font-size: 9.5px;
	}
	.functional-branch {
		grid-column: 1 / -1;
		grid-row: auto;
		margin-left: 6px;
		padding-left: 14px;
	}
	.functional-branch .functional-atom::before,
	.functional-branch .functional-atom::after {
		left: -15.5px;
	}
	.functional-branch .functional-atom::before {
		top: 17px;
		width: 10px;
	}
	.functional-branch
		.functional-atom:nth-last-child(1 of .functional-atom)::after {
		height: 20.5px;
	}
	.functional-group > .functional-group {
		margin-left: 8px;
		padding-left: 10px;
	}
	.functional-group > .functional-group > .functional-lead {
		position: static;
		justify-content: flex-start;
		width: auto;
		margin: 2px 0;
	}
	.functional-branch > [data-branch-edit] {
		display: none;
	}
	.living-dock .living-scoreboard {
		display: none;
	}
	.living-console-head select {
		min-width: 0;
		flex: 1;
	}
	.living-steps blockquote {
		margin-left: 0;
	}
	.living-seeds {
		gap: 6px;
	}
}

/* Read left to right: a subject feeds into a named check. */
.functional-call {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: stretch;
	max-width: 100%;
	gap: 0;
	vertical-align: middle;
	border: 1px solid var(--line);
	border-radius: 7px;
	background: var(--surface);
	padding: 2px;
}
.functional-call .functional-subject,
.functional-call .functional-operation {
	font-size: 14px;
	line-height: 1.6;
	padding: 3px 7px;
	border-radius: 4px;
	min-width: 0;
}
.functional-call .functional-subject {
	background: var(--concept-soft);
}
.functional-call .functional-operation {
	background: transparent;
}
.functional-call .functional-operation:hover,
.functional-call .functional-operation.selected {
	background: color-mix(in srgb, var(--check) 10%, var(--surface));
}
.functional-function-icon {
	display: inline-block;
	font:
		italic 17px / 1 Georgia,
		serif;
	color: var(--check);
	margin-right: 6px;
}
.functional-flow {
	align-self: center;
	color: var(--faint);
	font: 14px / 1 var(--font-sans);
	padding: 0 5px;
}
.functional-call .needs-evidence {
	background: var(--warn-soft);
}
.functional-head .functional-call {
	border: 0;
	padding: 0;
	background: transparent;
}
.functional-head .functional-call button {
	font-size: 22px;
}
.functional-head .functional-call .functional-subject {
	background: transparent;
}
@media (max-width: 700px) {
	.functional-call {
		row-gap: 2px;
	}
	.functional-call .functional-subject,
	.functional-call .functional-operation {
		font-size: 13px;
	}
	.functional-head .functional-call button {
		font-size: 19px;
	}
	.functional-flow {
		padding: 0 3px;
	}
}

/* The subject sits inside one readable assertion, without code punctuation. */
.functional-call {
	gap: 0;
	border-color: var(--line);
	background: var(--surface);
	padding: 3px;
	border-radius: 8px;
}
.functional-argument {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	max-width: 100%;
	border-radius: 5px;
	background: var(--concept-soft);
}
.functional-call .functional-subject {
	background: transparent;
}
.functional-call .functional-operation {
	align-self: center;
	padding-left: 9px;
	padding-right: 8px;
}
.functional-head .functional-argument {
	background: transparent;
}
@media (max-width: 700px) {
	.functional-argument .functional-subject {
		flex: 1;
	}
}

/* A persistent detail rail leaves the reasoning tree in place. */
.living.inspector-open {
	--inspector-width: 340px;
	padding-right: calc(var(--inspector-width) + 20px);
}
.living.inspector-open .living-paper {
	padding-inline: 28px;
}
.living > .living-inspector {
	position: fixed;
	z-index: 30;
	top: 76px;
	right: 16px;
	bottom: 16px;
	width: var(--inspector-width, 340px);
	max-width: calc(100vw - 24px);
	margin: 0;
	padding: 22px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: 14px;
	animation: none;
}
.living > .living-inspector .living-detail-head {
	position: sticky;
	top: -22px;
	z-index: 1;
	background: var(--surface);
	margin: -22px -22px 20px;
	padding: 20px 22px 14px;
	border-bottom: 1px solid var(--line);
}
.living > .living-inspector .living-detail-head .icon-btn {
	margin: 0;
	flex-shrink: 0;
}
.living.inspector-open .living-dock,
.living.inspector-open .living-console {
	right: calc(var(--inspector-width) + 32px);
	width: calc(100vw - var(--rail) - var(--inspector-width) - 64px);
	max-width: 1040px;
}
.living.inspector-open .living-dock-text span {
	display: none;
}
.living.inspector-open .living-console-head {
	flex-wrap: wrap;
}
.living.inspector-open .living-console-body {
	grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 1100px) {
	.living.inspector-open {
		padding-right: 0;
	}
	.living.inspector-open .living-paper {
		padding-inline: 20px;
	}
	.living > .living-inspector {
		top: 64px;
		right: 8px;
		bottom: 8px;
		box-shadow: -12px 0 36px rgb(0 0 0 / 0.16);
	}
	.living.inspector-open .living-dock,
	.living.inspector-open .living-console {
		right: 0;
		width: calc(100vw - var(--rail) - 24px);
	}
}
