:root {
	--ink: #172622;
	--muted: #63716c;
	--line: #dce4df;
	--surface: #ffffff;
	--canvas: #f3f6f3;
	--brand: #246b5a;
	--brand-dark: #164d40;
	--brand-pale: #e7f2ed;
	--critical: #b83d4b;
	--critical-pale: #fbeaec;
	--high: #d66d27;
	--high-pale: #fff0e3;
	--medium: #ad831b;
	--medium-pale: #fff7d9;
	--passed: #2d7a58;
	--passed-pale: #e8f5ee;
	--shadow: 0 14px 38px rgba(31, 58, 49, 0.07);
	font-family:
		Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--ink);
	background: var(--canvas);
}

* {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-width: 320px;
	background:
		radial-gradient(circle at 72% 0%, rgba(65, 135, 112, 0.07), transparent 28rem),
		var(--canvas);
}

button,
input,
select,
textarea {
	font: inherit;
}

button {
	cursor: pointer;
}

.app-shell {
	display: grid;
	grid-template-columns: 232px minmax(0, 1fr);
	min-height: 100vh;
}

.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
	padding: 28px 18px 22px;
	background: #173d35;
	color: #fff;
}

.brand {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 0 8px 30px;
	color: #fff;
	text-decoration: none;
}

.brand-mark {
	display: grid;
	width: 38px;
	height: 38px;
	place-items: center;
	border-radius: 12px;
	background: #d7ad68;
	color: #173d35;
	font-family: Georgia, serif;
	font-size: 23px;
	font-weight: 700;
}

.brand strong,
.brand small {
	display: block;
}

.brand small {
	margin-top: 2px;
	color: #a9c6bd;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

nav {
	display: grid;
	gap: 5px;
}

.nav-link {
	padding: 11px 13px;
	border-radius: 9px;
	color: #b9d0c9;
	font-size: 14px;
	text-decoration: none;
	transition: 160ms ease;
}

.nav-link:hover,
.nav-link.active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.privacy-note {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-top: auto;
	padding: 14px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.05);
}

.privacy-note strong {
	font-size: 12px;
}

.privacy-note p {
	margin: 4px 0 0;
	color: #a9c6bd;
	font-size: 11px;
	line-height: 1.45;
}

.privacy-icon {
	color: #d7ad68;
	font-size: 20px;
}

main {
	min-width: 0;
}

.topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 100px;
	padding: 22px 34px;
	border-bottom: 1px solid var(--line);
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(12px);
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

h1 {
	margin-bottom: 0;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 31px;
	font-weight: 500;
}

h2 {
	margin-bottom: 0;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 23px;
	font-weight: 500;
}

h3 {
	font-size: 17px;
}

.eyebrow {
	margin-bottom: 7px;
	color: var(--brand);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.14em;
}

.topbar-actions {
	display: flex;
	gap: 10px;
}

.button {
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 700;
	transition: 160ms ease;
}

.button.primary {
	background: var(--brand);
	color: #fff;
}

.button.primary:hover {
	background: var(--brand-dark);
}

.button.secondary {
	border-color: var(--line);
	background: #fff;
	color: var(--ink);
}

.button.secondary:hover {
	border-color: #b9c8c1;
}

.content {
	max-width: 1500px;
	margin: 0 auto;
	padding: 30px 34px 70px;
}

.hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
	gap: 20px;
	margin-bottom: 20px;
}

.readiness-card,
.guardrail-card,
.panel {
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.readiness-card {
	padding: 25px 28px;
}

.readiness-head {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	align-items: center;
}

.score-ring {
	display: grid;
	width: 78px;
	height: 78px;
	place-content: center;
	border-radius: 50%;
	background:
		radial-gradient(circle closest-side, white 79%, transparent 80% 100%),
		conic-gradient(var(--brand) calc(var(--score) * 1%), #e2e9e5 0);
	text-align: center;
}

.score-ring span {
	font-size: 22px;
	font-weight: 800;
	line-height: 1;
}

.score-ring small {
	color: var(--muted);
	font-size: 10px;
}

.readiness-card > p {
	max-width: 680px;
	margin: 15px 0;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.55;
}

.progress-track {
	overflow: hidden;
	height: 7px;
	border-radius: 20px;
	background: #e7ece9;
}

.progress-track span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--brand);
	transition: width 350ms ease;
}

.legend {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin-top: 16px;
	color: var(--muted);
	font-size: 12px;
}

.legend span {
	display: flex;
	align-items: center;
	gap: 6px;
}

.legend b {
	color: var(--ink);
}

.dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
}

.dot.critical {
	background: var(--critical);
}

.dot.high {
	background: var(--high);
}

.dot.medium {
	background: var(--medium);
}

.dot.passed {
	background: var(--passed);
}

.guardrail-card {
	padding: 24px;
	background: linear-gradient(145deg, #f0f7f4, #fff);
}

.guardrail-card p:not(.eyebrow) {
	margin-bottom: 18px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.5;
}

.confirmation {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	font-size: 12px;
	line-height: 1.45;
}

.confirmation input,
.check-row input,
.check-grid input,
.coordination-row input {
	accent-color: var(--brand);
}

.button.approve {
	width: 100%;
	margin: 18px 0 8px;
	background: var(--brand);
	color: #fff;
}

.button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

#approvalHelp {
	color: var(--muted);
}

.workspace-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 390px;
	gap: 20px;
	align-items: start;
}

#caseForm {
	display: grid;
	gap: 20px;
}

.panel {
	overflow: hidden;
}

.form-panel {
	padding: 25px 28px 28px;
	scroll-margin-top: 20px;
}

.panel-heading {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
	margin-bottom: 24px;
}

.section-status {
	padding: 5px 9px;
	border-radius: 999px;
	background: #eef2f0;
	color: var(--muted);
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
}

.section-status.ok {
	background: var(--passed-pale);
	color: var(--passed);
}

.section-status.issue {
	background: var(--high-pale);
	color: var(--high);
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 17px;
}

.form-grid.compact {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
	display: grid;
	gap: 7px;
	color: #40504b;
	font-size: 11px;
	font-weight: 750;
	letter-spacing: 0.01em;
}

input,
select,
textarea {
	width: 100%;
	border: 1px solid #cad5d0;
	border-radius: 8px;
	background: #fbfcfb;
	color: var(--ink);
	outline: none;
}

input,
select {
	height: 40px;
	padding: 0 11px;
}

textarea {
	resize: vertical;
	padding: 11px;
	line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(36, 107, 90, 0.09);
}

input.invalid,
select.invalid,
textarea.invalid {
	border-color: var(--critical);
	background: #fffafb;
}

.check-row,
.check-grid {
	display: grid;
	gap: 12px 18px;
	margin-top: 19px;
}

.check-row {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-row label,
.check-grid label,
.coordination-row > label:first-child {
	display: flex;
	gap: 8px;
	align-items: center;
	font-weight: 600;
}

.check-row input,
.check-grid input,
.coordination-row input[type="checkbox"] {
	width: auto;
	height: auto;
}

.confirmation.inline {
	margin-top: 18px;
}

.behavior-table-wrap {
	overflow-x: auto;
	margin-top: 20px;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 11px;
}

.data-table th {
	padding: 9px 7px;
	border-bottom: 1px solid var(--line);
	color: var(--muted);
	font-size: 9px;
	letter-spacing: 0.08em;
	text-align: left;
	text-transform: uppercase;
}

.data-table td {
	padding: 8px 6px;
	border-bottom: 1px solid #edf1ef;
}

.data-table input {
	min-width: 74px;
	height: 34px;
}

.data-table .behavior-name {
	min-width: 130px;
	font-weight: 750;
}

.field-hint {
	margin: 12px 0 0;
	color: var(--muted);
	font-size: 11px;
}

.source-tabs {
	display: flex;
	gap: 4px;
	width: fit-content;
	margin-bottom: 20px;
	padding: 4px;
	border-radius: 10px;
	background: #edf2ef;
}

.source-tab {
	padding: 8px 13px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
}

.source-tab.active {
	background: #fff;
	color: var(--brand);
	box-shadow: 0 2px 8px rgba(31, 58, 49, 0.08);
}

.source-view {
	display: none;
}

.source-view.active {
	display: block;
}

.dropzone {
	display: grid;
	min-height: 190px;
	place-items: center;
	align-content: center;
	gap: 7px;
	border: 1.5px dashed #aebfb7;
	border-radius: 13px;
	background: #f7faf8;
	text-align: center;
	transition: 160ms ease;
}

.dropzone:hover,
.dropzone.dragging {
	border-color: var(--brand);
	background: var(--brand-pale);
}

.dropzone input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.dropzone strong {
	color: var(--ink);
	font-size: 14px;
}

.dropzone small {
	color: var(--muted);
	font-weight: 500;
}

.drop-icon {
	display: grid;
	width: 38px;
	height: 38px;
	place-items: center;
	border-radius: 50%;
	background: var(--brand-pale);
	color: var(--brand);
	font-size: 22px;
}

.compact-button {
	display: inline-grid;
	min-height: 33px;
	margin-top: 5px;
	padding: 0 12px;
	place-items: center;
}

.source-message {
	margin-top: 11px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #f0f3f1;
	color: var(--muted);
	font-size: 11px;
}

.source-message.ok {
	background: var(--passed-pale);
	color: var(--passed);
}

.source-message.error {
	background: var(--critical-pale);
	color: var(--critical);
}

.document-list,
.captured-sources {
	display: grid;
	gap: 8px;
	margin-top: 12px;
}

.document-item,
.captured-source {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: center;
	padding: 11px 13px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: #fff;
}

.document-item strong,
.captured-source strong {
	display: block;
	font-size: 11px;
}

.document-item small,
.captured-source small {
	display: block;
	margin-top: 3px;
	color: var(--muted);
	font-size: 9px;
}

.document-state {
	padding: 4px 7px;
	border-radius: 999px;
	background: var(--brand-pale);
	color: var(--brand);
	font-size: 9px;
	font-weight: 800;
}

.candidate-area,
.web-capture {
	margin-top: 24px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

.subheading,
.catalog-heading {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: flex-start;
	margin-bottom: 14px;
}

.subheading h3,
.catalog-heading h3 {
	margin-bottom: 4px;
}

.subheading p,
.catalog-heading p {
	margin: 0;
	color: var(--muted);
	font-size: 11px;
}

.count-pill {
	padding: 5px 8px;
	border-radius: 999px;
	background: #edf2ef;
	color: var(--muted);
	font-size: 9px;
	font-weight: 800;
}

.candidate-table-wrap {
	overflow-x: auto;
}

.candidate-table td {
	vertical-align: middle;
}

.candidate-table tr.verified {
	background: var(--passed-pale);
	opacity: 0.7;
}

.candidate-value {
	max-width: 210px;
	font-weight: 750;
	word-break: break-word;
}

.confidence {
	display: inline-block;
	padding: 3px 6px;
	border-radius: 5px;
	background: #eef2f0;
	color: var(--muted);
	font-size: 8px;
	font-weight: 800;
	text-transform: uppercase;
}

.verify-candidate {
	min-height: 30px;
	padding: 0 9px;
}

.source-catalog {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.catalog-card {
	display: grid;
	gap: 9px;
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fbfcfb;
}

.catalog-card-head {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	align-items: flex-start;
}

.catalog-card h4 {
	margin: 0;
	font-size: 12px;
}

.source-kind {
	padding: 3px 6px;
	border-radius: 5px;
	background: var(--brand-pale);
	color: var(--brand);
	font-size: 8px;
	font-weight: 800;
	text-transform: uppercase;
}

.catalog-card p {
	margin: 0;
	color: var(--muted);
	font-size: 10px;
	line-height: 1.45;
}

.catalog-card a {
	width: fit-content;
	color: var(--brand);
	font-size: 10px;
	font-weight: 800;
	text-decoration: none;
}

.catalog-card a:hover {
	text-decoration: underline;
}

.capture-excerpt {
	margin: 17px 0 12px;
}

.captured-source a {
	color: var(--brand);
	font-size: 10px;
	word-break: break-all;
}

.model-card {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: linear-gradient(135deg, #f2f8f5, #fff);
}

.model-orb {
	display: grid;
	flex: 0 0 auto;
	width: 43px;
	height: 43px;
	place-items: center;
	border-radius: 13px;
	background: var(--brand);
	color: #fff;
	font-family: Georgia, serif;
	font-size: 22px;
}

.model-copy {
	min-width: 0;
	flex: 1;
}

.model-copy strong {
	font-size: 12px;
}

.model-copy p {
	margin: 4px 0 0;
	color: var(--muted);
	font-size: 10px;
	line-height: 1.4;
}

.ai-guardrails {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: 14px 0;
}

.ai-guardrails span {
	padding: 5px 8px;
	border: 1px solid #cfe0d8;
	border-radius: 999px;
	background: var(--brand-pale);
	color: var(--brand-dark);
	font-size: 9px;
	font-weight: 750;
}

.model-picker {
	max-width: 320px;
	margin-bottom: 14px;
}

.ai-actions {
	display: flex;
	gap: 9px;
}

.ai-progress {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 17px;
	padding: 14px;
	border-radius: 10px;
	background: #f4f7f5;
}

.ai-progress strong {
	display: block;
	font-size: 11px;
}

.ai-progress p {
	margin: 3px 0 0;
	color: var(--muted);
	font-size: 9px;
}

.spinner {
	width: 22px;
	height: 22px;
	border: 3px solid #cfe0d8;
	border-top-color: var(--brand);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.draft-area {
	display: grid;
	gap: 14px;
	margin-top: 23px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

.draft-label {
	padding: 5px 8px;
	border-radius: 5px;
	background: var(--critical-pale);
	color: var(--critical);
	font-size: 9px;
	font-weight: 900;
	letter-spacing: 0.08em;
}

.draft-notices {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.draft-notices > div {
	padding: 12px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: #fafbfa;
}

.draft-notices strong {
	font-size: 10px;
}

.draft-notices ul {
	margin: 8px 0 0;
	padding-left: 17px;
	color: var(--muted);
	font-size: 10px;
	line-height: 1.5;
}

.document-actions {
	display: flex;
	gap: 7px;
	align-items: center;
}

.analyze-document {
	min-height: 29px;
	padding: 0 8px;
	font-size: 9px;
}

.coordination-row {
	display: flex;
	gap: 20px;
	align-items: end;
	margin-top: 20px;
}

.coordination-row .grow {
	flex: 1;
}

.findings-panel {
	position: sticky;
	top: 20px;
	max-height: calc(100vh - 40px);
	overflow: auto;
}

.sticky-heading {
	position: sticky;
	z-index: 2;
	top: 0;
	margin: 0;
	padding: 22px 22px 18px;
	border-bottom: 1px solid var(--line);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(8px);
}

.icon-button {
	display: grid;
	width: 30px;
	height: 30px;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #fff;
	color: var(--muted);
	font-size: 20px;
}

.empty-state {
	padding: 60px 30px;
	color: var(--muted);
	text-align: center;
}

.empty-state h3 {
	margin: 14px 0 8px;
	color: var(--ink);
}

.empty-state p {
	font-size: 12px;
	line-height: 1.5;
}

.empty-icon {
	display: grid;
	width: 48px;
	height: 48px;
	margin: auto;
	place-items: center;
	border-radius: 50%;
	background: var(--brand-pale);
	color: var(--brand);
	font-size: 20px;
}

.findings-list {
	display: grid;
	gap: 10px;
	padding: 14px;
}

.finding {
	padding: 14px;
	border: 1px solid var(--line);
	border-left-width: 4px;
	border-radius: 10px;
	background: #fff;
}

.finding.critical {
	border-left-color: var(--critical);
}

.finding.high {
	border-left-color: var(--high);
}

.finding.medium {
	border-left-color: var(--medium);
}

.finding.passed {
	border-left-color: var(--passed);
}

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

.severity {
	padding: 3px 6px;
	border-radius: 5px;
	font-size: 8px;
	font-weight: 900;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.critical .severity {
	background: var(--critical-pale);
	color: var(--critical);
}

.high .severity {
	background: var(--high-pale);
	color: var(--high);
}

.medium .severity {
	background: var(--medium-pale);
	color: var(--medium);
}

.passed .severity {
	background: var(--passed-pale);
	color: var(--passed);
}

.finding-rule {
	color: var(--muted);
	font-size: 9px;
}

.finding h3 {
	margin-bottom: 6px;
	font-size: 13px;
}

.finding p {
	margin-bottom: 0;
	color: var(--muted);
	font-size: 11px;
	line-height: 1.45;
}

.finding .recommendation {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed var(--line);
	color: #41534d;
}

.toast {
	position: fixed;
	z-index: 10;
	right: 25px;
	bottom: 25px;
	max-width: 360px;
	padding: 13px 16px;
	border-radius: 9px;
	background: #173d35;
	color: #fff;
	box-shadow: var(--shadow);
	font-size: 12px;
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
	transition: 200ms ease;
}

.toast.show {
	opacity: 1;
	transform: translateY(0);
}

@media (max-width: 1100px) {
	.workspace-grid {
		grid-template-columns: 1fr;
	}

	.findings-panel {
		position: static;
		max-height: none;
	}

	.form-grid.compact {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 780px) {
	.app-shell {
		grid-template-columns: 1fr;
	}

	.sidebar {
		position: static;
		height: auto;
		padding: 16px;
	}

	.sidebar nav,
	.privacy-note {
		display: none;
	}

	.brand {
		padding: 0;
	}

	.topbar {
		align-items: flex-start;
		padding: 20px;
	}

	.topbar-actions {
		flex-direction: column;
	}

	.content {
		padding: 20px 14px 50px;
	}

	.hero-grid,
	.form-grid,
	.form-grid.compact,
	.check-row,
	.check-grid {
		grid-template-columns: 1fr;
	}

	.form-panel {
		padding: 21px 18px;
	}

	.coordination-row {
		align-items: stretch;
		flex-direction: column;
	}

	.source-catalog {
		grid-template-columns: 1fr;
	}

	.draft-notices {
		grid-template-columns: 1fr;
	}
}
