:root {
	--rsw-bg: linear-gradient(180deg, #f4f8fc 0%, #edf3fb 100%);
	--rsw-card: #ffffff;
	--rsw-text: #142033;
	--rsw-muted: #607089;
	--rsw-line: #d9e4f0;
	--rsw-primary: #0f6bff;
	--rsw-primary-dark: #0b4fbf;
	--rsw-success: #16784b;
	--rsw-warning: #9a6400;
	--rsw-danger: #b42318;
	--rsw-shadow: 0 18px 48px rgba(17, 37, 68, 0.08);
	--rsw-radius-lg: 24px;
	--rsw-radius-md: 16px;
	--rsw-radius-sm: 12px;
}

.rsw-shell,
.rsw-shell * {
	box-sizing: border-box;
}

.rsw-shell {
	max-width: 1180px;
	margin: 40px auto;
	padding: 28px;
	color: var(--rsw-text);
	background: var(--rsw-bg);
	border-radius: 28px;
	box-shadow: var(--rsw-shadow);
}

.rsw-auth-shell {
	max-width: 720px;
}

.rsw-auth-card {
	padding: 32px;
	background: var(--rsw-card);
	border: 1px solid var(--rsw-line);
	border-radius: var(--rsw-radius-lg);
	box-shadow: 0 8px 24px rgba(18, 35, 64, 0.04);
}

.rsw-page-header,
.rsw-card-header,
.rsw-progress-meta,
.rsw-step-actions,
.rsw-meta-grid,
.rsw-file-actions,
.rsw-admin-forms,
.rsw-counter-grid,
.rsw-detail-grid,
.rsw-header-actions,
.rsw-action-grid {
	display: flex;
	gap: 18px;
}

.rsw-portal-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 24px;
}

.rsw-portal-link {
	display: inline-flex;
	align-items: center;
	padding: 10px 16px;
	border-radius: 999px;
	border: 1px solid var(--rsw-line);
	background: rgba(255, 255, 255, 0.72);
	color: var(--rsw-text);
	font-weight: 600;
	text-decoration: none;
}

.rsw-portal-link.is-active {
	background: #e9f2ff;
	border-color: #bdd5ff;
	color: var(--rsw-primary-dark);
}

.rsw-page-header,
.rsw-card-header {
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 22px;
}

.rsw-page-header h2,
.rsw-step-header h3,
.rsw-card-header h3 {
	margin: 0 0 8px;
	font-size: clamp(1.6rem, 2vw, 2.3rem);
	line-height: 1.15;
}

.rsw-page-header p,
.rsw-step-header p,
.rsw-card p,
.rsw-help {
	margin: 0;
	color: var(--rsw-muted);
	line-height: 1.6;
}

.rsw-eyebrow {
	margin-bottom: 10px;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rsw-primary);
}

.rsw-header-stat,
.rsw-counter-card,
.rsw-card,
.rsw-progress-card,
.rsw-step-panel,
.rsw-notice {
	background: var(--rsw-card);
	border: 1px solid var(--rsw-line);
	border-radius: var(--rsw-radius-lg);
	box-shadow: 0 8px 24px rgba(18, 35, 64, 0.04);
}

.rsw-header-stat,
.rsw-counter-card {
	min-width: 180px;
	padding: 18px 20px;
}

.rsw-header-stat span,
.rsw-counter-card span {
	display: block;
	color: var(--rsw-muted);
	font-size: 0.9rem;
}

.rsw-header-stat strong,
.rsw-counter-card strong {
	display: block;
	margin-top: 8px;
	font-size: 1.7rem;
}

.rsw-progress-card,
.rsw-step-panel,
.rsw-card {
	padding: 28px;
	margin-bottom: 24px;
}

.rsw-step-header {
	margin-bottom: 28px;
}

.rsw-progress-bar {
	height: 12px;
	background: #d7e5fb;
	border-radius: 999px;
	overflow: hidden;
	margin: 18px 0 20px;
}

.rsw-progress-bar-fill {
	display: block;
	height: 100%;
	width: 20%;
	background: linear-gradient(90deg, #0f6bff, #41b6ff);
	border-radius: 999px;
	transition: width 0.25s ease;
}

.rsw-step-indicators {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 12px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.rsw-step-indicators li {
	border: 1px solid var(--rsw-line);
	border-radius: var(--rsw-radius-md);
	background: #f8fbff;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.rsw-step-indicators li.is-active {
	background: #edf5ff;
	border-color: #bdd5ff;
	box-shadow: 0 0 0 4px rgba(15, 107, 255, 0.08);
}

.rsw-step-indicators li.is-complete:not(.is-active) {
	background: #f1fbf5;
	border-color: #c7ead6;
}

.rsw-step-indicators li.is-incomplete:not(.is-active) {
	background: #fbfcfe;
}

.rsw-step-trigger {
	display: flex;
	width: 100%;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 14px;
	border: 0;
	border-radius: inherit;
	background: transparent;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.rsw-step-trigger:hover,
.rsw-step-trigger:focus-visible {
	outline: none;
}

.rsw-step-indicators li:hover {
	border-color: #bdd5ff;
}

.rsw-step-indicators span {
	display: inline-flex;
	width: 34px;
	height: 34px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #dbe9ff;
	font-weight: 700;
}

.rsw-step-indicators li.is-complete span {
	background: #d9f3e4;
	color: #0e6b43;
}

.rsw-step-panel {
	display: none;
}

.rsw-step-panel.is-active {
	display: block;
}

.rsw-fields-grid,
.rsw-filter-grid {
	display: grid;
	gap: 22px;
}

.rsw-fields-grid {
	grid-template-columns: repeat(12, minmax(0, 1fr));
	row-gap: 28px;
}

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

.rsw-field {
	display: flex;
	flex-direction: column;
	gap: 12px;
	grid-column: span 12;
}

.rsw-field-width-full {
	grid-column: span 12;
}

.rsw-field-width-half {
	grid-column: span 6;
}

.rsw-field label,
.rsw-inline-form label {
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.55;
}

.rsw-field-section,
.rsw-field-note {
	gap: 0;
}

.rsw-section-heading {
	padding-top: 10px;
	border-top: 1px solid #e5edf7;
}

.rsw-section-heading h4 {
	margin: 0 0 8px;
	font-size: 1.05rem;
	line-height: 1.4;
}

.rsw-field input:not([type="radio"]):not([type="checkbox"]),
.rsw-field select,
.rsw-field textarea,
.rsw-inline-form input:not([type="hidden"]),
.rsw-inline-form select,
.rsw-inline-form textarea,
.rsw-filter-form input,
.rsw-filter-form select {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--rsw-line);
	border-radius: var(--rsw-radius-sm);
	background: #fff;
	font-size: 1rem;
	color: var(--rsw-text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rsw-field input:focus,
.rsw-field select:focus,
.rsw-field textarea:focus,
.rsw-inline-form input:focus,
.rsw-inline-form select:focus,
.rsw-inline-form textarea:focus,
.rsw-filter-form input:focus,
.rsw-filter-form select:focus {
	outline: none;
	border-color: var(--rsw-primary);
	box-shadow: 0 0 0 4px rgba(15, 107, 255, 0.12);
}

.rsw-choice-group {
	display: grid;
	gap: 12px;
}

.rsw-choice,
.rsw-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border: 1px solid var(--rsw-line);
	border-radius: var(--rsw-radius-md);
	background: #f8fbff;
	cursor: pointer;
}

.rsw-checkbox {
	align-self: flex-start;
	max-width: 100%;
}

.rsw-required {
	color: var(--rsw-danger);
}

.rsw-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--rsw-primary);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease;
}

.rsw-button:hover,
.rsw-button:focus {
	background: var(--rsw-primary-dark);
	transform: translateY(-1px);
}

.rsw-button-secondary {
	background: #eaf2ff;
	color: var(--rsw-primary-dark);
}

.rsw-button-danger {
	background: var(--rsw-danger);
}

.rsw-button[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
}

.rsw-step-actions {
	justify-content: space-between;
	align-items: center;
	margin-top: 28px;
}

.rsw-header-actions,
.rsw-action-grid {
	flex-wrap: wrap;
	align-items: center;
}

.rsw-auth-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 8px;
}

.rsw-auth-links {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 18px;
}

.rsw-auth-links a {
	color: var(--rsw-primary);
	font-weight: 600;
	text-decoration: none;
}

.rsw-field-conditional.is-hidden {
	display: none;
}

.rsw-review-box,
.rsw-highlight-box {
	padding: 22px;
	border-radius: var(--rsw-radius-md);
	background: #f7faff;
	border: 1px solid #d6e6ff;
}

.rsw-review-box {
	margin-bottom: 28px;
}

.rsw-notice {
	margin-bottom: 20px;
	padding: 16px 18px;
}

.rsw-notice-success {
	border-color: #b9e3cd;
	background: #effaf4;
}

.rsw-notice-error {
	border-color: #f0c6c2;
	background: #fdf3f2;
}

.rsw-counter-grid {
	flex-wrap: wrap;
	margin-bottom: 24px;
}

.rsw-counter-card {
	flex: 1 1 170px;
}

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

.rsw-table {
	width: 100%;
	border-collapse: collapse;
}

.rsw-bulk-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.rsw-bulk-area {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.rsw-bulk-assign-form {
	padding: 18px 20px;
	border: 1px solid var(--rsw-line);
	border-radius: var(--rsw-radius-md);
	background: #f9fbff;
}

.rsw-hidden-form {
	display: none;
}

.rsw-bulk-toolbar,
.rsw-inline-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.rsw-bulk-select {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.rsw-select-column {
	width: 56px;
}

.rsw-table-stack {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rsw-row-assignment-form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.rsw-row-assignment-form select {
	min-width: 200px;
	flex: 1 1 220px;
}

.rsw-table th,
.rsw-table td {
	padding: 14px;
	border-bottom: 1px solid var(--rsw-line);
	text-align: left;
	vertical-align: top;
}

.rsw-inline-link {
	color: var(--rsw-primary);
	font-weight: 600;
	text-decoration: none;
}

.rsw-status-badge {
	display: inline-flex;
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 0.82rem;
	font-weight: 700;
}

.rsw-status-submitted,
.rsw-status-assigned {
	color: #114d91;
	background: #e6f1ff;
}

.rsw-status-under_review,
.rsw-status-awaiting_final_study {
	color: #8a5a00;
	background: #fff4db;
}

.rsw-status-accepted,
.rsw-status-final_study_uploaded,
.rsw-status-closed {
	color: #0e6b43;
	background: #e4f8ee;
}

.rsw-status-rejected {
	color: #9f1f16;
	background: #fde9e7;
}

.rsw-status-failed {
	color: #9f1f16;
	background: #fde9e7;
}

.rsw-comparison-state-match {
	color: #0e6b43;
	background: #e4f8ee;
}

.rsw-comparison-state-partial_match {
	color: #8a5a00;
	background: #fff4db;
}

.rsw-comparison-state-mismatch,
.rsw-comparison-state-missing_in_proposal {
	color: #9f1f16;
	background: #fde9e7;
}

.rsw-comparison-state-missing_in_application,
.rsw-comparison-state-not_detectable {
	color: #5d6778;
	background: #eef3f8;
}

.rsw-study-failure-note {
	margin-top: 6px;
	color: var(--rsw-danger);
	font-size: 0.82rem;
	font-weight: 700;
}

.rsw-detail-grid {
	align-items: flex-start;
	flex-wrap: wrap;
}

.rsw-detail-grid > .rsw-card:first-child {
	flex: 2 1 680px;
}

.rsw-detail-grid > .rsw-card:last-child {
	flex: 1 1 280px;
}

.rsw-detail-section {
	padding-top: 18px;
	margin-top: 18px;
	border-top: 1px solid var(--rsw-line);
}

.rsw-detail-section h4 {
	margin: 0 0 16px;
	font-size: 1.1rem;
}

.rsw-comparison-header {
	align-items: center;
	margin-bottom: 18px;
}

.rsw-comparison-rerun {
	display: flex;
	align-items: center;
}

.rsw-comparison-summary-grid > div {
	min-height: 102px;
}

.rsw-comparison-summary-note {
	margin-top: 18px;
	margin-bottom: 18px;
}

.rsw-summary-list {
	margin: 10px 0 0;
	padding-left: 18px;
	color: var(--rsw-text);
}

.rsw-comparison-details {
	margin-top: 12px;
}

.rsw-comparison-details-summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--rsw-primary-dark);
	margin-bottom: 14px;
}

.rsw-comparison-table td:nth-child(2),
.rsw-comparison-table td:nth-child(3),
.rsw-comparison-table td:nth-child(5) {
	min-width: 220px;
	white-space: pre-wrap;
	word-break: break-word;
}

.rsw-meta-grid {
	flex-wrap: wrap;
}

.rsw-meta-grid > div {
	display: flex;
	flex: 1 1 220px;
	flex-direction: column;
	gap: 4px;
	padding: 14px;
	border-radius: var(--rsw-radius-md);
	background: #f9fbff;
	border: 1px solid #e3edf7;
}

.rsw-file-actions,
.rsw-admin-forms {
	flex-direction: column;
}

.rsw-inline-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.rsw-timeline {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.rsw-timeline-item {
	padding: 14px 16px;
	border-radius: var(--rsw-radius-md);
	border: 1px solid var(--rsw-line);
	background: #f9fbff;
}

.rsw-timeline-item strong,
.rsw-timeline-item span {
	display: block;
}

.rsw-timeline-item span {
	margin-top: 6px;
	color: var(--rsw-muted);
	font-size: 0.92rem;
}

.rsw-debug-pre {
	margin: 14px 0 0;
	padding: 14px;
	border-radius: var(--rsw-radius-sm);
	background: #fff;
	border: 1px solid #f0c6c2;
	overflow-x: auto;
	font-size: 0.9rem;
	white-space: pre-wrap;
	word-break: break-word;
}

@media (max-width: 900px) {
	.rsw-shell {
		padding: 20px;
		margin: 20px auto;
	}

	.rsw-page-header,
	.rsw-card-header,
	.rsw-progress-meta,
	.rsw-step-actions,
	.rsw-detail-grid {
		flex-direction: column;
	}

	.rsw-fields-grid,
	.rsw-filter-grid {
		grid-template-columns: 1fr;
	}

	.rsw-field-width-half {
		grid-column: span 12;
	}

	.rsw-step-actions .rsw-button {
		width: 100%;
	}
}
