.reasoning-intro {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin: 20px 0 28px;
}
.reasoning-intro h2 {
	margin: 0 0 8px;
	font-size: 20px;
	letter-spacing: -0.04em;
}
.reasoning-intro p {
	max-width: 660px;
	color: var(--muted);
	margin: 0;
}
.reasoning-card {
	border-top: 3px solid var(--accent, #b7ef40);
}
.rd-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 24px;
}
.rd-topbar .back {
	margin: 0;
}
.rd-topbar [role="status"] {
	font-size: 12px;
	color: var(--muted);
}
.rd-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 310px;
	align-items: start;
	gap: 26px;
}
.rd-paper {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 5px;
	min-height: 640px;
	padding: 34px 34px 20px;
	box-shadow: 0 12px 40px #00000005;
	min-width: 0;
}
.rd-document-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 30px;
}
.rd-document-label .eyebrow {
	font-size: 10px;
	letter-spacing: 0.12em;
}
#rd-title {
	width: 100%;
	border: 0;
	border-radius: 0;
	padding: 0 0 10px;
	background: transparent;
	box-shadow: none;
	font-family: var(--font-display);
	font-size: 24px;
	font-weight: 650;
	letter-spacing: -0.045em;
	color: var(--text);
	min-height: 0;
}
#rd-title:focus {
	outline: 0;
	box-shadow: 0 2px 0 var(--accent, #b7ef40);
}
.rd-instruction {
	font-size: 13px;
	color: var(--muted);
	line-height: 1.6;
	margin: 8px 0 34px;
	max-width: 510px;
}
.rd-rules {
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.rd-rules .rd-rules {
	margin: 4px 0 18px 24px;
	padding-left: 16px;
	border-left: 1px solid var(--line);
}
.rd-rule {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 10px 8px;
	margin: 3px -8px;
	border-radius: 6px;
	border: 1px solid transparent;
	transition:
		background 0.12s,
		border-color 0.12s;
}
.rd-rule.selected {
	background: color-mix(in srgb, var(--accent, #b7ef40) 7%, var(--surface));
	border-color: color-mix(in srgb, var(--accent, #b7ef40) 45%, var(--line));
}
.rd-rule-number {
	border: 0;
	background: transparent;
	color: var(--muted);
	font: 11px / 1.6 var(--font-mono, monospace);
	padding: 8px 3px;
	cursor: pointer;
	min-width: 28px;
	overflow-wrap: anywhere;
	max-width: 55px;
}
.rd-rule-number:focus-visible {
	outline: 2px solid var(--accent, #b7ef40);
}
.rd-rule-content {
	flex: 1;
	min-width: 0;
}
.rd-rule textarea[data-rd-sentence] {
	display: block;
	width: 100%;
	resize: vertical;
	border: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	margin: 0;
	padding: 3px 0;
	font-family: var(--font-serif, Georgia);
	font-size: 16px;
	line-height: 1.5;
	min-height: 38px;
	max-height: 360px;
	color: var(--text);
}
.rd-rule textarea[data-rd-sentence]:focus {
	outline: none;
	box-shadow: none;
}
.rd-rule textarea[data-rd-sentence]::placeholder {
	color: var(--faint);
}
.rd-linked-sentence {
	display: block;
	background: none;
	border: 0;
	padding: 3px 0;
	text-align: left;
	color: var(--text);
	font: 16px / 1.5 var(--font-serif, Georgia);
	cursor: pointer;
	width: 100%;
	overflow-wrap: anywhere;
}
.rd-rule-note {
	display: block;
	font-size: 10px;
	color: var(--muted);
	margin: 6px 0;
}
.rd-add-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	border-top: 1px dashed var(--line);
	padding-top: 18px;
	margin: 22px 0 48px;
}
.rd-add-row .btn {
	font-size: 12px;
}
.rd-empty {
	color: var(--muted);
	font-family: var(--font-serif);
	font-size: 16px;
	padding: 40px 0;
}
.rd-paper-footer {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	justify-content: space-between;
	color: var(--muted);
	font-size: 10px;
	border-top: 1px solid var(--line);
	padding-top: 16px;
}
.rd-history {
	margin-top: 20px;
	font-size: 12px;
	color: var(--muted);
}
.rd-history details {
	margin-top: 12px;
}
.rd-history pre {
	max-height: 300px;
	overflow: auto;
}
.rd-inspector {
	position: sticky;
	top: 90px;
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: 12px;
	overflow: auto;
	max-height: calc(100vh - 114px);
	min-width: 0;
	box-shadow: var(--shadow-sm);
}
.rd-inspector-head {
	padding: 22px 20px 12px;
}
.rd-inspector-head h2 {
	font-size: 16px;
	margin: 8px 0;
}
.rd-inspector-head p {
	font-family: var(--font-serif);
	font-size: 14px;
	line-height: 1.45;
	color: var(--muted);
	margin: 0;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.rd-inspector-tabs {
	display: flex;
	border-bottom: 1px solid var(--line);
	gap: 0;
	padding: 0 12px;
}
.rd-inspector-tabs button {
	padding: 12px 8px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	font-size: 11px;
	color: var(--muted);
	cursor: pointer;
}
.rd-inspector-tabs button.selected {
	border-bottom-color: var(--accent, #b7ef40);
	color: var(--text);
}
.rd-inspector-fields {
	padding: 20px;
}
.rd-inspector-fields label {
	font-size: 12px;
}
.rd-inspector-fields textarea {
	font-size: 13px;
	line-height: 1.55;
	resize: vertical;
	margin-bottom: 16px;
}
.rd-inspector-fields .field-hint {
	font-size: 11px;
	line-height: 1.6;
	color: var(--muted);
}
.rd-inspector-fields pre {
	font-size: 11px;
	max-height: 350px;
	overflow: auto;
}
.rd-inspector-actions {
	padding: 0 20px 20px;
	display: grid;
	gap: 8px;
}
.rd-inspector-actions .btn {
	font-size: 12px;
	justify-content: flex-start;
}
.rd-structure-actions {
	display: grid;
	gap: 8px;
}
.rd-link-note {
	margin: 18px 20px 0;
	padding: 12px;
	background: var(--bg);
	border-radius: 6px;
	font-size: 12px;
}
.rd-link-note p {
	font-size: 11px;
	line-height: 1.5;
}
.rd-link-note .btn {
	margin-top: 12px;
}
.rd-link-note a {
	font-size: 11px;
}
.rd-link-note .notice {
	margin: 12px 0 0;
	font-size: 11px;
}
#rd-error:empty {
	display: none;
}
#rd-error {
	margin-top: 20px;
}
@media (max-width: 1100px) {
	.rd-layout {
		grid-template-columns: minmax(0, 1fr) 280px;
		gap: 16px;
	}
	.rd-paper {
		padding: 24px 20px;
	}
	.rd-rules .rd-rules {
		margin-left: 12px;
		padding-left: 10px;
	}
}
@media (max-width: 800px) {
	.rd-layout {
		grid-template-columns: minmax(0, 1fr);
	}
	.rd-inspector {
		position: static;
		max-height: none;
	}
	.rd-topbar {
		align-items: flex-start;
		flex-wrap: wrap;
	}
	.rd-topbar .actions {
		margin-left: auto;
	}
	.rd-paper {
		min-height: 400px;
	}
	.rd-rules .rd-rules {
		margin-left: 4px;
		padding-left: 6px;
	}
	.rd-rule {
		gap: 4px;
	}
	.rd-rule-number {
		min-width: 24px;
		font-size: 9px;
		max-width: 28px;
	}
	.rd-rule textarea[data-rd-sentence],
	.rd-linked-sentence {
		font-size: 16px;
	}
	.rd-document-label {
		margin-bottom: 20px;
	}
	#rd-title {
		font-size: 22px;
	}
	.rd-paper-footer {
		font-size: 9px;
	}
	.reasoning-intro {
		align-items: flex-start;
		flex-direction: column;
	}
	.rd-inspector-head p {
		-webkit-line-clamp: initial;
	}
}
