/* The workbench follows the evidence: input, operation, reasoning. */
.work-tabs {
	display: flex;
	gap: 24px;
	border-bottom: 1px solid var(--line-2);
	margin: 0 0 28px;
	overflow-x: auto;
}
.work-tabs a,
.work-tabs button {
	flex-shrink: 0;
	padding: 14px 0;
	color: var(--muted);
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	text-decoration: none;
	font: inherit;
	cursor: pointer;
}
.work-tabs .selected {
	color: var(--ink);
	border-bottom-color: var(--ink);
	font-weight: 650;
}
.work-masthead {
	display: flex;
	align-items: center;
	gap: 28px;
	margin: 24px 0 36px;
}
.work-masthead h1 {
	font-size: clamp(28px, 3.3vw, 48px);
	letter-spacing: -0.045em;
	margin: 10px 0;
}
.work-masthead p {
	color: var(--muted);
	max-width: 610px;
	line-height: 1.6;
}
.work-masthead > .actions {
	margin-left: auto;
	flex-shrink: 0;
}
.work-number {
	font: italic 78px var(--font-serif);
	color: var(--faint);
	border-right: 1px solid var(--line-2);
	padding-right: 28px;
}
.work-metrics {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border-top: 1px solid var(--line-2);
	border-bottom: 1px solid var(--line-2);
	margin-bottom: 18px;
}
.work-metrics > div {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: 22px;
	border-right: 1px solid var(--line);
}
.work-metrics > div:last-child {
	border: 0;
}
.work-metrics strong {
	font: 32px var(--font-mono);
	letter-spacing: -0.05em;
}
.work-metrics span {
	color: var(--muted);
	font-size: 12px;
}
.rule-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}
.rule-card {
	display: block;
	height: 100%;
	border: 1px solid var(--line-2);
	border-radius: var(--radius);
	background: var(--surface);
	padding: 26px;
	text-decoration: none;
	color: var(--ink);
	transition:
		border-color 0.15s,
		transform 0.15s;
}
.rule-card:hover {
	border-color: var(--ink);
	transform: translateY(-2px);
}
.rule-card h2 {
	margin: 24px 0 12px;
	font-size: 23px;
	letter-spacing: -0.035em;
}
.rule-card p {
	color: var(--muted);
	line-height: 1.7;
	min-height: 45px;
}
.rule-card-foot {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	border-top: 1px solid var(--line);
	padding-top: 18px;
	margin-top: 24px;
	font-size: 12px;
}
.work-footnote {
	color: var(--muted);
	font-size: 12px;
	margin: 28px 0;
	max-width: 850px;
	line-height: 1.7;
}
.logic-workspace {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: 22px;
	margin: 24px 0;
	align-items: start;
}
.rule-sheet {
	padding: 36px;
	background: var(--paper);
	border: 1px solid var(--line-2);
	border-top: 4px solid var(--accent);
	box-shadow: var(--shadow-sm);
	border-radius: 4px;
}
.rule-sheet h2 {
	font: italic 30px / 1.3 var(--font-serif);
	margin: 22px 0 34px;
}
.rule-sheet dl {
	display: grid;
	grid-template-columns: 70px minmax(0, 1fr);
	gap: 26px 18px;
}
.rule-sheet dt {
	font: 11px var(--font-mono);
	letter-spacing: 0.12em;
	color: var(--muted);
	padding-top: 4px;
}
.rule-sheet dd {
	margin: 0;
	line-height: 1.7;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.rule-sheet-note {
	border-top: 1px solid var(--line);
	margin-top: 32px;
	padding-top: 18px;
	color: var(--muted);
	font-size: 12px;
}
.work-review,
.work-history {
	padding: 26px;
	margin-bottom: 22px;
}
.work-review h3 {
	margin-top: 24px;
}
.work-review p,
.work-history > p {
	line-height: 1.7;
	color: var(--muted);
}
.work-review li {
	margin: 14px 0;
	overflow-wrap: anywhere;
}
.work-review li small {
	display: block;
}
.work-history details {
	border-top: 1px solid var(--line);
	padding: 16px 0;
}
.work-history summary {
	cursor: pointer;
}
.work-history pre {
	max-height: 450px;
	overflow: auto;
}
.rule-test {
	padding: 18px 0;
	border-top: 1px solid var(--line);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.rule-test p {
	line-height: 1.7;
}
.work-picker {
	border: 1px solid var(--line-2);
	border-radius: 10px;
	padding: 16px;
	margin: 18px 0;
	max-height: 240px;
	overflow: auto;
}
.work-picker legend {
	padding: 0 6px;
	font-weight: 650;
}
.work-picker .check-label {
	margin: 10px 0;
}
.work-picker small {
	display: block;
	color: var(--muted);
}
.suggestion-inbox {
	background: var(--surface);
	border: 1px solid var(--line-2);
	padding: clamp(22px, 5vw, 64px);
	max-width: 100%;
	border-radius: var(--radius);
}
.suggestion-inbox h2 {
	font: italic 38px var(--font-serif);
	margin: 18px 0;
}
.suggestion-inbox p {
	max-width: 680px;
	line-height: 1.8;
	color: var(--muted);
}
.review-stages {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 30px;
}
.review-stages span {
	border: 1px solid var(--line-2);
	padding: 10px 18px;
	border-radius: 40px;
	font: 12px var(--font-mono);
}
.endpoint-blueprint {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	border: 1px solid var(--line-2);
	border-radius: var(--radius);
	margin: 24px 0;
	background: var(--surface);
}
.endpoint-blueprint section {
	padding: 26px;
	border-right: 1px solid var(--line);
	overflow-wrap: anywhere;
}
.endpoint-blueprint section:last-child {
	border: 0;
}
.endpoint-blueprint h2 {
	margin: 22px 0;
}
.endpoint-blueprint p {
	line-height: 1.7;
}
.endpoint-blueprint small {
	color: var(--muted);
}
.release-row {
	display: flex;
	justify-content: space-between;
	align-items: start;
	gap: 20px;
	border-top: 1px solid var(--line);
	padding: 22px 0;
}
.release-row > div {
	min-width: 0;
}
.release-row code {
	overflow-wrap: anywhere;
}
@media (max-width: 1050px) {
	.work-number {
		display: none;
	}
	.work-masthead {
		flex-wrap: wrap;
	}
	.work-masthead > .actions {
		margin-left: 0;
	}
	.logic-workspace {
		grid-template-columns: 1fr;
	}
}
@media (max-width: 650px) {
	.rule-grid,
	.endpoint-blueprint {
		grid-template-columns: 1fr;
	}
	.work-metrics {
		grid-template-columns: repeat(2, 1fr);
	}
	.work-metrics > div {
		padding: 16px 10px;
	}
	.rule-sheet,
	.work-review,
	.work-history {
		padding: 20px;
	}
	.rule-sheet dl {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.rule-sheet dd {
		margin-bottom: 18px;
	}
	.release-row {
		flex-direction: column;
	}
	.endpoint-blueprint section {
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}
	.rule-card .row {
		flex-wrap: wrap;
		gap: 10px;
	}
}
.dimension-editor,
.authority-editor,
.relationship-editor,
.test-editor {
	border: 1px solid var(--line-2);
	background: var(--surface-2);
	border-radius: 10px;
	padding: 18px;
	margin: 14px 0;
}
.rule-governance-form {
	border-top: 1px solid var(--line-2);
	margin-top: 22px;
	padding-top: 12px;
}
.rule-governance-form h3 {
	margin-top: 24px;
}
.rule-governance-form .grid {
	align-items: start;
}
.context-summary {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 22px 0;
}
.context-summary dt {
	color: var(--muted);
	font-size: 12px;
	margin-bottom: 5px;
}
.context-summary dd {
	margin: 0;
	overflow-wrap: anywhere;
}
@media (max-width: 650px) {
	.context-summary {
		grid-template-columns: 1fr;
	}
}

/* Rule editor: one page, sectioned, with a live preview and a readiness checklist. */
.editor-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 20px;
}
.editor-head h1 {
	margin-bottom: 8px;
}
.editor-head p {
	max-width: 640px;
	margin: 0;
	font-size: 15px;
	color: var(--muted);
}
.rule-editor > .notice {
	margin: 0 0 20px;
}
.editor-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 24px;
	align-items: start;
}
.editor-main {
	min-width: 0;
}
.editor-section {
	margin-bottom: 16px;
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	scroll-margin-top: 84px;
}
.editor-section > header,
.editor-advanced > summary {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr) auto;
	align-items: start;
	gap: 14px;
	margin-bottom: 22px;
}
.editor-section h2 {
	margin: 3px 0 4px;
	font-size: 18px;
}
.editor-section header p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--muted);
}
.editor-step {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--sunken);
	border: 1px solid var(--line-2);
	font-size: 13px;
	font-weight: 650;
	color: var(--ink-2);
}
.field-tag {
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
	color: var(--muted);
	background: var(--sunken);
	border: 1px solid var(--line);
}
.field-tag.required {
	color: var(--ink);
	background: var(--surface);
	border-color: var(--line-2);
}
.field-tag.recommended {
	color: var(--accent-ink);
	background: var(--accent-soft);
	border-color: transparent;
}
.field {
	display: grid;
	align-content: start;
	gap: 7px;
	margin-bottom: 18px;
	min-width: 0;
}
.field-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}
.field-head label {
	display: inline;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-2);
}
.field-head .field-tag {
	padding: 1px 8px;
	font-size: 11px;
}
.field-hint {
	display: block;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--muted);
}
.editor-section textarea {
	field-sizing: content;
	min-height: 64px;
	max-height: 360px;
}
.editor-section .grid.two {
	gap: 0 16px;
}
.family-picker {
	margin: 0 0 18px;
	padding: 0;
	border: 0;
	min-width: 0;
}
.family-picker legend {
	margin-bottom: 8px;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-2);
}
.family-options {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}
.family-option {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--line-2);
	border-radius: 11px;
	background: var(--surface);
	cursor: pointer;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}
.family-option:hover {
	border-color: var(--faint);
}
.family-option:has(input:checked) {
	border-color: var(--ink);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.family-option input {
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	padding: 0;
	box-shadow: none;
	accent-color: var(--ink);
}
.family-option strong {
	display: block;
	font-size: 13.5px;
	color: var(--ink);
}
.family-option small {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
}
.repeater {
	margin: 0 0 12px;
	padding: 14px 16px 2px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface-2);
}
.repeater-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}
.repeater-title {
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--muted);
}
.repeater-head .icon-btn {
	margin: -4px -6px -4px 0;
}
.inline-label {
	display: flex;
	flex: 0 1 auto;
	min-width: 0;
	margin: 0;
}
.inline-label select {
	width: auto;
	max-width: 100%;
	height: 32px;
	font-size: 13px;
	font-weight: 600;
}
.test-editor {
	border-left: 3px solid var(--ok);
}
.test-editor[data-expected="withhold"] {
	border-left-color: var(--warn);
}
.editor-section > .btn {
	margin-bottom: 14px;
}
.editor-section .work-picker {
	margin-top: 18px;
}
.editor-advanced > summary {
	margin: 0;
	list-style: none;
	cursor: pointer;
}
.editor-advanced > summary::-webkit-details-marker {
	display: none;
}
.editor-advanced > summary strong {
	display: block;
	margin-top: 3px;
	font-size: 16px;
}
.editor-advanced > summary small {
	display: block;
	font-size: 13px;
	color: var(--muted);
}
.editor-advanced[open] > summary {
	margin-bottom: 20px;
}
.editor-aside {
	position: sticky;
	top: 84px;
	display: grid;
	gap: 16px;
	max-height: calc(100vh - 180px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.readiness {
	padding: 18px 18px 14px;
}
.readiness-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	font-size: 14px;
}
.readiness-head span {
	font-size: 12.5px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}
.readiness .progress {
	margin: 10px 0 14px;
}
.readiness h3 {
	margin: 12px 0 4px;
	font-size: 11.5px;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--muted);
}
.readiness-todo {
	color: var(--warn);
}
.readiness-save {
	color: var(--ink);
}
.readiness-ready {
	color: var(--ok);
}
.checklist {
	margin: 0;
	padding: 0;
	list-style: none;
}
.checklist li > button,
.checklist li > span {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 6px 8px;
	margin: 0 -8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	font-size: 13.5px;
	text-align: left;
	color: var(--ink);
}
.checklist li > button:hover {
	background: var(--hover);
}
.checklist li.done > button,
.checklist li.done > span {
	color: var(--muted);
}
.tick {
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 1.5px solid var(--line-2);
}
.checklist li.done .tick {
	background: var(--accent);
	border-color: transparent;
	color: #0b0c0a;
}
.tick .icon {
	width: 12px;
	height: 12px;
	stroke-width: 2.6;
}
.readiness-more summary {
	margin-top: 12px;
	font-size: 12.5px;
	color: var(--muted);
}
.work-review .checklist {
	margin-bottom: 8px;
}
.editor-preview {
	padding: 24px;
}
.editor-preview .eyebrow {
	margin-bottom: 14px;
}
.preview-title {
	margin: 0 0 2px;
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}
.preview-meta {
	margin: 0 0 12px;
	font-size: 12.5px;
	color: var(--muted);
}
.preview-summary {
	margin: 0 0 16px;
	font: italic 17px / 1.45 var(--font-serif);
}
.editor-preview dl {
	grid-template-columns: 56px minmax(0, 1fr);
	gap: 12px 12px;
	margin: 0 0 16px;
	font-size: 13.5px;
}
.editor-preview dt {
	font-size: 10.5px;
	padding-top: 2px;
}
.editor-preview dd.placeholder,
.preview-title.placeholder {
	color: var(--faint);
}
.editor-bar {
	position: sticky;
	bottom: 16px;
	z-index: 5;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
	padding: 12px 14px 12px 18px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	box-shadow: var(--shadow-md);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}
.editor-bar .form-error {
	flex-basis: 100%;
	margin: 0 0 4px;
}
.editor-status {
	margin-right: auto;
	font-size: 13.5px;
	font-weight: 550;
}
@media (max-width: 1180px) {
	.editor-layout {
		grid-template-columns: minmax(0, 1fr);
	}
	.editor-aside {
		position: static;
		order: -1;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-height: none;
		overflow: visible;
	}
}
@media (max-width: 760px) {
	.editor-aside {
		grid-template-columns: minmax(0, 1fr);
	}
	.editor-preview {
		display: none;
	}
	.family-options {
		grid-template-columns: minmax(0, 1fr);
	}
	.editor-section {
		padding: 18px 16px;
	}
	.editor-section > header,
	.editor-advanced > summary {
		grid-template-columns: 28px minmax(0, 1fr);
	}
	.editor-section > header > .field-tag,
	.editor-advanced > summary > .field-tag {
		display: none;
	}
	.editor-step {
		width: 28px;
		height: 28px;
	}
	.editor-head {
		flex-direction: column;
		align-items: flex-start;
	}
	.editor-bar {
		bottom: 8px;
		padding: 10px 12px;
	}
	.editor-status {
		flex-basis: 100%;
		font-size: 12.5px;
	}
	.editor-bar .btn {
		flex: 1;
	}
}
#rule-context > p {
	grid-column: 1 / -1;
	margin: 0 0 16px;
	font-size: 12.5px;
}
