/* #last edited 2026-06-29T00:00:00Z */

:root {
	--bg: #080b0f;
	--panel: #0f141b;
	--panel-2: #151b23;
	--line: #25313d;
	--text: #edf4f8;
	--muted: #8ea0ad;
	--accent: #3dd6d0;
	--danger: #ff6370;
	--warn: #f0b84a;
	--ok: #5dde8c;
	--shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
	--sticky-top: 9rem;
	color-scheme: dark;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background:
		radial-gradient(circle at 76% 8%, rgba(61, 214, 208, 0.13), transparent 26rem),
		linear-gradient(180deg, #0a0d12 0%, var(--bg) 38rem);
	color: var(--text);
	min-width: 320px;
}

body.review-active .kpis,
body.database-active .kpis,
body.analytics-active .kpis,
body.email-active .kpis {
	display: none;
}

body.review-active main,
body.analytics-active main,
body.email-active main {
	padding-top: 0.85rem;
}

button,
input,
select {
	font: inherit;
}

.topbar {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 2rem;
	padding: 2rem clamp(1rem, 3vw, 2.75rem) 1.2rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(8, 11, 15, 0.88);
	backdrop-filter: blur(18px);
}

.topbar > div {
	min-width: 0;
}

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

h1 {
	font-size: clamp(1.75rem, 3vw, 3rem);
	letter-spacing: 0;
	line-height: 1.06;
	overflow-wrap: anywhere;
}

h2 {
	font-size: 1rem;
}

h3 {
	font-size: 0.78rem;
	text-transform: uppercase;
	color: var(--muted);
	letter-spacing: 0.08em;
	margin-bottom: 0.8rem;
}

.eyebrow {
	color: var(--accent);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	margin-bottom: 0.35rem;
}

.auth-form,
.filters {
	display: flex;
	align-items: end;
	gap: 0.7rem;
	flex-wrap: wrap;
}

label {
	display: grid;
	gap: 0.35rem;
	color: var(--muted);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

input,
select {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 7px;
	color: var(--text);
	padding: 0.62rem 0.72rem;
	min-height: 2.42rem;
	outline: none;
}

input:focus,
select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(61, 214, 208, 0.13);
}

button {
	border: 0;
	border-radius: 7px;
	background: var(--accent);
	color: #041011;
	padding: 0.68rem 0.95rem;
	min-height: 2.42rem;
	font-weight: 700;
	cursor: pointer;
}

button.secondary {
	background: rgba(255, 255, 255, 0.08);
	color: var(--text);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

button.danger {
	color: var(--danger);
}

main {
	padding: 1.2rem clamp(1rem, 3vw, 2.75rem) 3rem;
}

.status-line {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	color: var(--muted);
	font-size: 0.88rem;
	margin-bottom: 1rem;
}

.view-tabs {
	display: flex;
	gap: 0.45rem;
	margin-bottom: 1rem;
}

.view-tabs button {
	background: rgba(255, 255, 255, 0.06);
	color: var(--muted);
	border: 1px solid rgba(255, 255, 255, 0.1);
	min-height: 2.25rem;
	padding: 0.5rem 0.8rem;
}

.view-tabs button.active {
	background: var(--accent);
	color: #041011;
	border-color: transparent;
}

.sub-tabs {
	display: grid;
	gap: 0.42rem;
	margin: 0.75rem 0;
}

.sub-tabs button {
	background: rgba(255, 255, 255, 0.05);
	color: var(--muted);
	border: 1px solid rgba(255, 255, 255, 0.09);
	min-height: 2.25rem;
	padding: 0.48rem 0.68rem;
	text-align: left;
}

.sub-tabs button.active {
	background: rgba(61, 214, 208, 0.16);
	color: var(--text);
	border-color: rgba(61, 214, 208, 0.48);
}

.status-line > div:first-child {
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

.pulse {
	width: 0.58rem;
	height: 0.58rem;
	border-radius: 50%;
	background: var(--warn);
	box-shadow: 0 0 0 rgba(61, 214, 208, 0.5);
}

.pulse.live {
	background: var(--accent);
	animation: pulse 1.8s infinite;
}

.ocr-engine-status {
	font-size: 0.82rem;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.05);
}

.ocr-engine-status.ok {
	color: var(--ok);
	border-color: rgba(93, 222, 140, 0.4);
}

.ocr-engine-status.warning {
	color: var(--warn);
	border-color: rgba(240, 184, 74, 0.4);
}

.ocr-engine-status.critical {
	color: var(--danger);
	border-color: rgba(255, 99, 112, 0.4);
}

@keyframes pulse {
	0% { box-shadow: 0 0 0 0 rgba(61, 214, 208, 0.45); }
	70% { box-shadow: 0 0 0 10px rgba(61, 214, 208, 0); }
	100% { box-shadow: 0 0 0 0 rgba(61, 214, 208, 0); }
}

.kpis {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--line);
	border-radius: 8px;
	overflow: hidden;
	background: var(--line);
	box-shadow: var(--shadow);
	margin-bottom: 1.15rem;
}

.kpi {
	background: rgba(15, 20, 27, 0.94);
	padding: 1.05rem;
	min-height: 6rem;
}

.kpi span {
	display: block;
	color: var(--muted);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 0.7rem;
}

.kpi strong {
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	line-height: 1;
}

.workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(20rem, 28vw);
	gap: 1.1rem;
	align-items: start;
	margin-top: 1.1rem;
}

.analytics-shell,
.database-shell,
.email-shell {
	display: grid;
	gap: 1.1rem;
	margin-top: 1.1rem;
}

.email-panel {
	min-height: calc(100svh - var(--sticky-top) - 2rem);
}

#reviewView {
	display: grid;
	grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
	margin-top: 0.8rem;
}

.primary,
.inspector,
.chart-panel,
.analytics-grid > div {
	background: rgba(15, 20, 27, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	min-width: 0;
}

.primary,
.inspector {
	padding: 1rem;
	box-shadow: var(--shadow);
}

.database-panel {
	min-height: calc(100svh - var(--sticky-top) - 2rem);
}

.db-filters {
	min-width: min(36rem, 100%);
}

.db-filters select {
	min-width: 12rem;
}

.db-table-wrap {
	max-height: calc(100svh - var(--sticky-top) - 8.5rem);
}

.db-table-wrap table {
	border-collapse: separate;
	border-spacing: 0;
	min-width: 86rem;
}

.db-table-wrap th,
.db-table-wrap td {
	white-space: nowrap;
}

.db-table-wrap th {
	background: #151b23;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.09);
	z-index: 2;
}

.db-table-wrap tbody tr:first-child td {
	padding-top: 0.95rem;
}

.review-rail,
.review-workspace {
	background: rgba(15, 20, 27, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	box-shadow: var(--shadow);
	min-width: 0;
}

.review-rail {
	position: sticky;
	top: var(--sticky-top);
	max-height: calc(100svh - var(--sticky-top) - 0.75rem);
	overflow: hidden;
	padding: 0.85rem;
	display: grid;
	grid-template-rows: auto auto auto minmax(0, 1fr);
	gap: 0.65rem;
}

.review-workspace {
	padding: 1rem;
	min-height: calc(100svh - var(--sticky-top) - 0.75rem);
}

.review-rail-head {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 0.65rem;
}

.review-rail-head p,
.review-toolbar p {
	color: var(--muted);
	font-size: 0.82rem;
	line-height: 1.35;
	margin-top: 0.28rem;
}

.review-rail-head button {
	min-height: 2rem;
	padding: 0.42rem 0.62rem;
}

.review-rail input {
	width: 100%;
}

.review-list {
	display: grid;
	align-content: start;
	gap: 0.45rem;
	overflow: auto;
	padding-right: 0.25rem;
	min-height: 0;
}

.review-card {
	display: grid;
	gap: 0.5rem;
	width: 100%;
	text-align: left;
	background: rgba(255, 255, 255, 0.035);
	color: var(--text);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 7px;
	padding: 0.68rem;
	cursor: pointer;
}

.review-card:hover,
.review-card.selected {
	border-color: rgba(61, 214, 208, 0.55);
	background: rgba(61, 214, 208, 0.09);
}

.review-card-title {
	font-weight: 750;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.review-card-meta,
.review-card-reason {
	color: var(--muted);
	font-size: 0.76rem;
	line-height: 1.3;
}

.review-card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.review-toolbar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
	gap: 1rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.review-kicker {
	color: var(--accent);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 0.18rem;
}

.review-context-strip {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.6rem;
	align-items: start;
	margin: 0.85rem 0;
}

.review-context-strip .details,
.review-context-strip .notice,
.review-context-strip .artifact-list {
	margin-bottom: 0;
}

.review-context-strip .details {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 0.45rem 0.8rem;
	font-size: 0.8rem;
	min-width: 0;
}

.review-context-strip .details > div {
	min-width: 0;
	overflow-wrap: anywhere;
}

.review-context-strip .artifact-list {
	justify-content: start;
	align-content: start;
	min-width: 0;
	width: 100%;
	max-height: 6.5rem;
	overflow: auto;
	padding-right: 0.15rem;
}

.workspace > .inspector {
	position: sticky;
	top: var(--sticky-top);
	max-height: calc(100svh - var(--sticky-top) - 0.75rem);
	overflow: auto;
}

.section-head {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.section-head p {
	color: var(--muted);
	font-size: 0.9rem;
	margin-top: 0.28rem;
}

.compact {
	margin-bottom: 0.75rem;
}

.flow-grid,
.analytics-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem;
	margin-bottom: 0.85rem;
}

.alert-grid {
	display: grid;
	gap: 0.4rem;
	margin-bottom: 0.85rem;
}

.alert-row {
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-left: 3px solid var(--ok);
	border-radius: 8px;
	padding: 0.48rem 0.62rem;
	background: rgba(255, 255, 255, 0.045);
	display: grid;
	grid-template-columns: 5.2rem minmax(8rem, 1.1fr) minmax(8rem, 1fr) auto;
	gap: 0.55rem;
	align-items: center;
	width: 100%;
	min-height: 2.5rem;
	color: var(--text);
	text-align: left;
}

.alert-row.warning {
	border-left-color: var(--warn);
}

.alert-row.critical {
	border-left-color: var(--danger);
}

.alert-row span {
	color: var(--muted);
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.alert-row strong {
	font-size: 0.86rem;
}

.alert-row em,
.alert-row small {
	color: var(--muted);
	font-size: 0.8rem;
	font-style: normal;
	line-height: 1.2;
}

.alert-row small {
	color: var(--accent);
	white-space: nowrap;
}

.chart-panel,
.analytics-grid > div {
	padding: 0.9rem;
}

.bars {
	display: grid;
	gap: 0.45rem;
	height: auto;
	min-height: 8rem;
}

.throughput-row {
	display: grid;
	grid-template-columns: 3.8rem minmax(6rem, 1fr) 3rem minmax(10rem, auto);
	gap: 0.65rem;
	align-items: center;
	color: var(--muted);
	font-size: 0.78rem;
}

.throughput-row strong {
	color: var(--text);
	font-size: 0.82rem;
	line-height: 1;
	text-align: right;
}

.throughput-row time {
	color: var(--text);
	font-size: 0.78rem;
}

.throughput-row small {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.throughput-track {
	height: 0.55rem;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	overflow: hidden;
}

.throughput-total {
	display: block;
	height: 100%;
	background: var(--accent);
	border-radius: inherit;
	transition: width 220ms ease;
}

.stack-list {
	display: grid;
	gap: 0.55rem;
}

.stack-row {
	display: grid;
	grid-template-columns: minmax(6rem, 1fr) 4rem;
	gap: 0.7rem;
	align-items: center;
	color: var(--muted);
	font-size: 0.84rem;
}

.track {
	height: 0.5rem;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	overflow: hidden;
	margin-top: 0.25rem;
}

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

.table-wrap {
	overflow: auto;
	max-width: 100%;
	min-width: 0;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	min-width: 46rem;
}

th,
td {
	padding: 0.72rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	vertical-align: top;
}

th {
	color: var(--muted);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	background: rgba(255, 255, 255, 0.035);
	position: sticky;
	top: 0;
}

tbody tr {
	cursor: pointer;
	transition: background 140ms ease;
}

tbody tr:hover,
tbody tr.selected {
	background: rgba(61, 214, 208, 0.08);
}

.status {
	display: inline-flex;
	border-radius: 999px;
	padding: 0.2rem 0.52rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.76rem;
	white-space: nowrap;
}

.status.completed { color: var(--ok); }
.status.failed { color: var(--danger); }
.status.review_required { color: var(--warn); }
.status.processing,
.status.awaiting_script { color: var(--accent); }

.progress {
	width: 7rem;
}

.details {
	display: grid;
	gap: 0.5rem;
	color: var(--muted);
	font-size: 0.86rem;
	margin-bottom: 0.9rem;
}

.details strong {
	color: var(--text);
	font-weight: 700;
}

.roadmap-evidence {
	display: grid;
	gap: 0.62rem;
	margin-top: 0.25rem;
	padding-top: 0.8rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.evidence-head {
	display: grid;
	gap: 0.2rem;
}

.evidence-head span {
	color: var(--muted);
	font-size: 0.78rem;
	line-height: 1.35;
}

.evidence-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(8.6rem, 1fr));
	gap: 0.45rem;
}

.workspace > .inspector .evidence-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.evidence-card {
	position: relative;
	display: grid;
	gap: 0.36rem;
	min-width: 0;
	min-height: 6.4rem;
	padding: 0.62rem 0.64rem 0.68rem;
	background: rgba(255, 255, 255, 0.045);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 7px;
}

.card-title-row {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 0.5rem;
	min-width: 0;
}

.evidence-card strong {
	font-size: 0.8rem;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.state-pill {
	justify-self: start;
	border-radius: 999px;
	padding: 0.14rem 0.46rem;
	border: 1px solid rgba(255, 255, 255, 0.15);
	font-size: 0.62rem;
	font-weight: 850;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
}

.evidence-card small {
	color: var(--muted);
	font-size: 0.72rem;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.evidence-card small b {
	color: var(--text);
	display: block;
	font-weight: 750;
	margin-bottom: 0.16rem;
}

.evidence-card.ok {
	border-color: rgba(93, 222, 140, 0.44);
	background: linear-gradient(90deg, rgba(93, 222, 140, 0.14), rgba(93, 222, 140, 0.045));
	box-shadow: inset 4px 0 0 rgba(93, 222, 140, 0.72);
}

.evidence-card.warn {
	border-color: rgba(240, 184, 74, 0.48);
	background: linear-gradient(90deg, rgba(240, 184, 74, 0.14), rgba(240, 184, 74, 0.045));
	box-shadow: inset 4px 0 0 rgba(240, 184, 74, 0.75);
}

.evidence-card.missing {
	border-color: rgba(255, 99, 112, 0.52);
	background: linear-gradient(90deg, rgba(255, 99, 112, 0.16), rgba(255, 99, 112, 0.045));
	box-shadow: inset 4px 0 0 rgba(255, 99, 112, 0.75);
}

.ok .state-pill {
	background: rgba(93, 222, 140, 0.14);
	border-color: rgba(93, 222, 140, 0.42);
	color: var(--ok);
}

.warn .state-pill {
	background: rgba(240, 184, 74, 0.14);
	border-color: rgba(240, 184, 74, 0.46);
	color: var(--warn);
}

.missing .state-pill {
	background: rgba(255, 99, 112, 0.14);
	border-color: rgba(255, 99, 112, 0.5);
	color: var(--danger);
}

.help-dot {
	position: relative;
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 1.18rem;
	height: 1.18rem;
	min-height: 0;
	padding: 0;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.06);
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 850;
	line-height: 1;
	cursor: help;
	z-index: 3;
}

.help-dot:hover,
.help-dot:focus-visible {
	border-color: rgba(61, 214, 208, 0.6);
	color: var(--accent);
	outline: none;
}

.help-dot span {
	position: absolute;
	top: calc(100% + 0.4rem);
	right: 0;
	width: min(18rem, 72vw);
	padding: 0.65rem 0.72rem;
	border: 1px solid rgba(61, 214, 208, 0.35);
	border-radius: 7px;
	background: rgba(11, 16, 22, 0.98);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
	color: var(--text);
	font-size: 0.74rem;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.35;
	text-align: left;
	text-transform: none;
	white-space: normal;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-0.2rem);
	transition: opacity 120ms ease, transform 120ms ease;
	z-index: 20;
}

.help-dot:hover span,
.help-dot:focus-visible span {
	opacity: 1;
	transform: translateY(0);
}

.system-evidence {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.system-card {
	position: relative;
	display: grid;
	gap: 0.35rem;
	align-content: start;
	min-width: 0;
	min-height: 6.4rem;
	padding: 0.72rem;
	background: rgba(255, 255, 255, 0.045);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 7px;
}

.system-card .card-title-row > span {
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.system-card .state-pill {
	margin-top: -0.1rem;
	font-size: 0.6rem;
}

.system-card strong {
	color: var(--text);
	font-size: 0.95rem;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.system-card small {
	color: var(--muted);
	font-size: 0.74rem;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.system-card.ok {
	border-color: rgba(93, 222, 140, 0.44);
	background: linear-gradient(90deg, rgba(93, 222, 140, 0.13), rgba(93, 222, 140, 0.04));
	box-shadow: inset 4px 0 0 rgba(93, 222, 140, 0.7);
}

.system-card.warn {
	border-color: rgba(240, 184, 74, 0.48);
	background: linear-gradient(90deg, rgba(240, 184, 74, 0.13), rgba(240, 184, 74, 0.04));
	box-shadow: inset 4px 0 0 rgba(240, 184, 74, 0.72);
}

.system-card.missing {
	border-color: rgba(255, 99, 112, 0.52);
	background: linear-gradient(90deg, rgba(255, 99, 112, 0.15), rgba(255, 99, 112, 0.04));
	box-shadow: inset 4px 0 0 rgba(255, 99, 112, 0.75);
}

.positive-empty {
	border-color: rgba(93, 222, 140, 0.26);
	background: rgba(93, 222, 140, 0.045);
	color: var(--ok);
}

.empty {
	border: 1px dashed rgba(255, 255, 255, 0.16);
	border-radius: 8px;
	padding: 1rem;
}

.compact-empty {
	padding: 0.55rem;
	font-size: 0.82rem;
}

.artifact-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 0.8rem;
}

.artifact-list button {
	background: rgba(255, 255, 255, 0.08);
	color: var(--text);
	border: 1px solid transparent;
	min-height: auto;
	padding: 0.45rem 0.6rem;
	font-size: 0.78rem;
}

.artifact-list button:hover {
	border-color: rgba(61, 214, 208, 0.35);
}

.preview {
	min-height: 18rem;
	max-height: 30rem;
	overflow: auto;
	background: #07090c;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 0.9rem;
	color: #d7e6ec;
	white-space: pre-wrap;
	word-break: break-word;
}

.compact-preview {
	min-height: 14rem;
	max-height: 20rem;
}

.review-inspector {
	min-width: 0;
	width: 100%;
}

.review-editor-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-bottom: 0.7rem;
}

.review-editor-grid > div {
	min-width: 0;
}

.review-note {
	width: 100%;
	background: #07090c;
	color: #d7e6ec;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 0.9rem;
	outline: none;
	resize: vertical;
}

.code-pane {
	height: clamp(30rem, 62svh, 48rem);
	min-height: 0;
	max-height: calc(100svh - 20rem);
	overflow: auto;
	background: #07090c;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 7px;
	color: #d7e6ec;
	font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
	font-size: 0.82rem;
	line-height: 1.45;
	outline: none;
}

.code-pane.disabled {
	opacity: 0.72;
}

.code-line {
	display: grid;
	grid-template-columns: 3.25rem minmax(0, 1fr);
	min-height: 1.45rem;
	border-left: 3px solid transparent;
}

.code-line.changed,
.code-line.added {
	background: rgba(93, 222, 140, 0.12);
	border-left-color: var(--ok);
}

.code-line.removed {
	background: rgba(255, 99, 112, 0.11);
	border-left-color: var(--danger);
}

.line-no {
	color: #5f7180;
	text-align: right;
	padding: 0 0.7rem 0 0.35rem;
	user-select: none;
	border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.line-text {
	white-space: pre-wrap;
	word-break: break-word;
	padding: 0 0.65rem;
	min-width: 0;
	outline: none;
}

.rendered-markdown {
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 0.88rem;
	line-height: 1.55;
	padding: 0.85rem;
}

.markdown-render {
	display: grid;
	gap: 0.65rem;
	color: var(--text);
}

.markdown-render h1,
.markdown-render h2,
.markdown-render h3,
.markdown-render h4,
.markdown-render h5,
.markdown-render h6 {
	color: var(--text);
	line-height: 1.2;
	margin: 0.25rem 0 0;
}

.markdown-render h1 { font-size: 1.35rem; }
.markdown-render h2 { font-size: 1.15rem; }
.markdown-render h3 { font-size: 1rem; }

.markdown-render p,
.markdown-render ul,
.markdown-render pre,
.markdown-render table {
	margin: 0;
}

.markdown-render ul {
	padding-left: 1.15rem;
}

.markdown-render code {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 4px;
	padding: 0.05rem 0.24rem;
	font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.markdown-render pre {
	overflow: auto;
	background: rgba(0, 0, 0, 0.28);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 7px;
	padding: 0.7rem;
}

.markdown-render table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.82rem;
}

.markdown-render th,
.markdown-render td {
	border: 1px solid rgba(255, 255, 255, 0.1);
	padding: 0.45rem 0.55rem;
	vertical-align: top;
}

.read-only-message {
	display: grid;
	gap: 0.18rem;
	margin: 0.7rem;
	padding: 0.65rem 0.75rem;
	border: 1px solid rgba(240, 184, 74, 0.32);
	border-radius: 7px;
	background: rgba(240, 184, 74, 0.08);
	color: #f6d58c;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 0.82rem;
}

.read-only-message span {
	color: var(--muted);
}

.editable .line-text:focus {
	background: rgba(61, 214, 208, 0.08);
}

#reviewView .compact-preview {
	min-height: clamp(30rem, 62svh, 48rem);
	max-height: calc(100svh - 20rem);
}

.review-note {
	min-height: 3rem;
	margin-bottom: 0.7rem;
}

.diff-summary {
	border: 1px solid rgba(61, 214, 208, 0.22);
	border-radius: 7px;
	background: rgba(61, 214, 208, 0.06);
	color: var(--muted);
	padding: 0.52rem 0.65rem;
	font-size: 0.84rem;
	margin-bottom: 0.65rem;
}

.sensitive-panel {
	display: grid;
	gap: 0.35rem;
}

.sensitive-panel strong {
	color: var(--text);
}

.review-mode {
	display: inline-flex;
	border-radius: 999px;
	padding: 0.16rem 0.45rem;
	background: rgba(255, 255, 255, 0.07);
	color: var(--muted);
	font-size: 0.72rem;
}

.review-mode.sensitive_data {
	color: var(--warn);
	border: 1px solid rgba(240, 184, 74, 0.3);
}

.review-mode.correction {
	color: var(--accent);
	border: 1px solid rgba(61, 214, 208, 0.28);
}

.review-mode.completed {
	color: var(--ok);
	border: 1px solid rgba(93, 222, 140, 0.28);
}

.review-actions {
	display: flex;
	gap: 0.55rem;
	flex-wrap: wrap;
	justify-content: end;
}

.review-actions button {
	white-space: nowrap;
}

.review-actions .warn {
	border-color: rgba(240, 184, 74, 0.42);
	color: #f6d58c;
}

.artifact-list button span {
	color: inherit;
	font-size: 0.68rem;
	opacity: 0.72;
}

.artifact-list button.active {
	background: var(--accent);
	color: #041011;
	border-color: transparent;
	box-shadow: 0 0 0 2px rgba(61, 214, 208, 0.24);
}

.notice {
	border: 1px solid rgba(240, 184, 74, 0.35);
	color: #f6d58c;
	background: rgba(240, 184, 74, 0.08);
	border-radius: 8px;
	padding: 0.8rem;
	margin-bottom: 0.85rem;
	font-size: 0.88rem;
}

.runbook {
	color: var(--muted);
	border-color: rgba(61, 214, 208, 0.24);
	background: rgba(61, 214, 208, 0.06);
}

.timeline {
	display: grid;
	gap: 0.45rem;
	margin-top: 0.45rem;
}

.timeline-row {
	display: grid;
	grid-template-columns: 5.8rem minmax(7rem, 1fr);
	gap: 0.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	padding-top: 0.45rem;
}

.timeline-row span {
	color: var(--muted);
	font-size: 0.72rem;
	text-transform: uppercase;
}

.timeline-row.completed span {
	color: var(--ok);
}

.timeline-row.failed span {
	color: var(--danger);
}

.timeline-row small {
	grid-column: 2;
	color: var(--muted);
	word-break: break-word;
}

.hidden {
	display: none !important;
}

.vertical {
	display: grid;
	align-items: stretch;
	margin-bottom: 0.8rem;
}

.mini {
	max-height: 34rem;
}

.mini table {
	min-width: 34rem;
	font-size: 0.78rem;
}

.truncate {
	max-width: 20rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.muted {
	color: var(--muted);
	font-size: 0.78rem;
	margin-top: 0.22rem;
}

@media (max-width: 900px) {
	.topbar,
	.workspace,
	.section-head {
		display: grid;
	}

	.workspace {
		grid-template-columns: 1fr;
	}

	.db-filters {
		min-width: 0;
	}

	#reviewView {
		grid-template-columns: 1fr;
	}

	.review-rail {
		position: static;
		max-height: none;
	}

	.review-workspace {
		min-height: auto;
	}

	.review-toolbar,
	.review-context-strip {
		grid-template-columns: 1fr;
	}

	.review-context-strip .artifact-list,
	.review-actions {
		justify-content: start;
	}

	.kpis,
	.flow-grid,
	.analytics-grid,
	.alert-grid,
	.system-evidence {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.workspace > .inspector {
		position: static;
		max-height: none;
	}

	.alert-row,
	.review-editor-grid {
		grid-template-columns: 1fr;
	}

	.code-pane,
	#reviewView .compact-preview {
		min-height: 22rem;
	}

	.throughput-row {
		grid-template-columns: 3.4rem minmax(6rem, 1fr) 2.6rem;
	}

	.throughput-row small {
		grid-column: 2 / -1;
	}
}

@media (max-width: 680px) {
	.kpis,
	.flow-grid,
	.analytics-grid,
	.alert-grid,
	.system-evidence {
		grid-template-columns: 1fr;
	}

	.status-line {
		display: grid;
	}

	.auth-form,
	.filters {
		display: grid;
		align-items: stretch;
	}

	.workspace > .inspector .evidence-grid {
		grid-template-columns: 1fr;
	}
}
