.rp-detail-page {
	--rp-detail-ink: #292f32;
	--rp-detail-muted: #687275;
	--rp-detail-line: #d7d9d4;
	--rp-detail-paper: #fbfaf6;
	--rp-detail-green: #315d50;
	--rp-detail-rust: #9c503a;
	max-width: 1680px;
	padding-bottom: 48px !important;
	color: var(--rp-detail-ink);
}

.rp-detail-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin: 10px 0 23px;
	padding: 0 0 18px;
	border-bottom: 1px solid var(--rp-detail-line);
}

.rp-detail-heading h1 {
	margin: 0;
	color: var(--rp-detail-ink);
	font: 600 32px/1.12 Georgia, 'Times New Roman', serif;
	overflow-wrap: anywhere;
}

.rp-detail-heading p {
	max-width: 920px;
	margin: 8px 0 0;
	color: var(--rp-detail-muted);
	font-size: 13px;
	line-height: 1.55;
}

.rp-manager-link { flex: 0 0 auto; }
.rp-detail-overview { align-items: stretch; }

.rp-overview-card {
	height: 100%;
	border: 1px solid var(--rp-detail-line);
	border-radius: 4px;
	background: var(--rp-detail-paper);
	box-shadow: 0 4px 16px rgba(37, 46, 41, .06) !important;
}

.rp-overview-card .card-body { padding: clamp(16px, 2vw, 25px); }
.rp-overview-card .card-title { margin: 3px 0 15px; color: var(--rp-detail-ink); font: 600 23px/1.2 Georgia, 'Times New Roman', serif; }
.rp-section-label { color: var(--rp-detail-green); font: 10px 'DM Mono', Consolas, monospace; text-transform: uppercase; }
.rp-overview-copy { margin: -7px 0 14px; color: var(--rp-detail-muted); font-size: 12px; line-height: 1.5; }

.rp-world-map-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.rp-world-map-link:hover { color: inherit; }
.rp-world-map-card img { display: block; width: 100%; max-height: 490px; object-fit: cover; border: 1px solid #e1e2dc; }
.rp-world-map-card .card-title { margin-bottom: 12px; }

.rp-campaign-facts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 15px;
	padding: 12px;
	border: 1px solid #e3e5de;
	background: #f5f5ef;
}

.rp-campaign-facts div { min-width: 0; }
.rp-campaign-facts dt { margin-bottom: 3px; color: #78817b; font: 9px 'DM Mono', Consolas, monospace; text-transform: uppercase; }
.rp-campaign-facts dd { margin: 0; color: #35413c; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.rp-campaign-facts div:nth-child(4) { grid-column: span 2; }

.rp-overview-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.rp-overview-actions .btn { --bs-btn-border-radius: 3px; font-size: 11px; }

.rp-overview-block { margin-top: 13px; padding-top: 11px; border-top: 1px solid #e6e7e1; }
.rp-overview-block h3,
.rp-party-summary h3 { margin: 0 0 7px; color: #48554e; font: 600 11px 'DM Mono', Consolas, monospace; text-transform: uppercase; }
.rp-overview-block ul { padding-left: 18px; }
.rp-overview-notes > div { white-space: pre-wrap; }

.rp-party-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 13px; }
.rp-party-summary > div { min-width: 0; padding: 11px; border: 1px solid #e5e6df; background: #fffefa; }
.rp-party-summary ul { padding-left: 17px; color: #45504a; }
.rp-party-summary li + li { margin-top: 3px; }

.rp-roster-section { margin-top: 34px; }
.rp-roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--rp-detail-line); }
.rp-roster-heading h2 { margin: 0; color: var(--rp-detail-ink); font: 600 25px/1.2 Georgia, 'Times New Roman', serif; }
.rp-roster-empty { padding: 22px; border: 1px solid var(--rp-detail-line); background: var(--rp-detail-paper); color: var(--rp-detail-muted); text-align: center; }

.rp-roster-section .primary-group {
	margin: 0 0 20px;
	padding: 16px;
	border: 1px solid #d5d9d1;
	border-radius: 4px;
	background: #f1f2ec;
	box-shadow: none;
}

.rp-roster-section .primary-group-title {
	margin: 0 0 14px;
	padding: 0 0 9px;
	border-bottom: 1px solid #ccd2c9;
	color: #34443b;
	font: 600 19px/1.2 Georgia, 'Times New Roman', serif;
	text-align: left;
}

.rp-roster-section .party-group {
	margin: 0 0 16px;
	padding: 13px;
	border: 1px solid #dce0d8;
	border-radius: 3px;
	background: rgba(255, 254, 250, .72);
	box-shadow: none;
}

.rp-roster-section .party-group-title { margin: 0 0 11px; padding-bottom: 7px; border-color: #e2e4dc; color: #56645a; font: 600 14px/1.3 Georgia, 'Times New Roman', serif; }
.rp-roster-section .card { height: 100%; border: 1px solid #dfe1da; border-radius: 3px; background: var(--rp-detail-paper); box-shadow: 0 2px 8px rgba(37, 46, 41, .055); }
.rp-roster-section .card-img-top { width: 100%; height: clamp(170px, 19vw, 260px); object-fit: cover; object-position: center 24%; background: #e8e8df; }
.rp-roster-section .card-body { padding: 14px; }
.rp-roster-section .card-title { margin-bottom: 9px; color: #293a31; font: 600 16px/1.25 Georgia, 'Times New Roman', serif; }
.rp-roster-section .card-text { margin-bottom: 10px; color: #5b655e; font-size: 12px; line-height: 1.55; }
.rp-roster-section .character-info-label { color: #53645a; }
.rp-roster-section .character-info-value { color: #34413a; }
.rp-roster-section .unpartied-characters-section { margin-top: 17px; padding-top: 15px; border-top: 1px solid #d2d7cf; }

.rp-roster-section .primary-group-title { scroll-margin-top: 16px; }

@media (max-width: 767.98px) {
	.rp-detail-page { padding-right: 14px; padding-left: 14px; }
	.rp-detail-heading { flex-direction: column; gap: 12px; }
	.rp-detail-heading h1 { font-size: 27px; }
	.rp-manager-link { align-self: flex-start; }
	.rp-detail-overview .col-12 { min-width: 0; }
	.rp-world-map-card img { max-height: 360px; }
	.rp-roster-section { margin-top: 27px; }
	.rp-roster-heading h2 { font-size: 22px; }
	.rp-roster-section .primary-group { padding: 12px; }
	.rp-roster-section .party-group { padding: 10px; }
	.rp-roster-section .card-img-top { height: 230px; }
}

@media (max-width: 480px) {
	.rp-campaign-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rp-campaign-facts div:nth-child(4) { grid-column: 1 / -1; }
	.rp-party-summary { grid-template-columns: 1fr; }
	.rp-overview-actions .btn { flex: 1 1 auto; }
	.rp-roster-section .card-img-top { height: 250px; }
}
.primary-group {
	margin-top: 40px;
	margin-bottom: 40px;
	padding: 20px;
	border-radius: 10px;
	background-color: #e9ecef; /* Light grey background for primary groups */
	box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.primary-group-title {
	color: #343a40;
	margin-bottom: 30px;
	border-bottom: 3px solid #6c757d; /* Darker border for primary groups */
	padding-bottom: 15px;
	font-size: 2rem;
	font-weight: bold;
	text-align: center;
}
.party-group {
	border: 2px solid #ced4da; /* Slightly darker border for party groups */
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 25px;
	background-color: #f8f9fa; /* Lighter background for party groups */
	box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}
.party-group-title {
	color: #495057;
	margin-bottom: 15px;
	border-bottom: 1px solid #dee2e6;
	padding-bottom: 8px;
	font-size: 1.5rem;
	font-weight: 600;
}
.unpartied-characters-section {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 2px dashed #adb5bd; /* Dashed border for unpartied section */
}
.unpartied-characters-title {
	color: #495057;
	margin-bottom: 15px;
	font-size: 1.5rem;
	font-weight: 600;
}
.card-img-top {
	height: 50vh; /* Adjust as needed */
	object-fit: cover;
	object-position: top;
	border-top-left-radius: calc(0.25rem - 1px);
	border-top-right-radius: calc(0.25rem - 1px);
}
.card {
	background: #ffffff; /* White background for character cards */
	border-radius: 0.25rem;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.card-title {
	font-size: 1.25rem;
	font-weight: bold;
	color: #343a40;
}
.card-text {
	font-size: 0.9rem;
	color: #6c757d;
}
.character-info-label {
	font-weight: 600;
	color: #555;
}
.character-info-value {
	color: #333;
}
#editCharacterModal .modal-body {
	padding-top: 0;
}
#editCharacterModal .form-label {
	font-weight: 600;
	margin-bottom: .25rem;
}
#editCharacterModal .form-control,
#editCharacterModal .form-select {
	margin-bottom: .75rem;
	border-radius: .375rem;
}
#currentPortrait {
	max-width: 150px;
	height: auto;
	border-radius: 8px;
	margin-bottom: 1rem;
	display: block;
}
.class-level-group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}
.class-level-group input {
	flex-grow: 1;
}
.class-level-group .level-input {
	width: 60px; /* Fixed width for level input */
	text-align: center;
}
.class-level-group .btn-group {
	display: flex;
}
.class-level-group .btn-group .btn {
	padding: .25rem .5rem;
	font-size: .875rem;
	line-height: 1.5;
	border-radius: .25rem;
}
.class-level-group .btn-group .btn:first-child {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
.class-level-group .btn-group .btn:last-child {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}
.map-card {
	background-color: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0,0,0,0.1);
	padding: 20px;
	margin-bottom: 30px;
	text-align: center;
	max-width: 500px;
}
.map-card h3 {
	margin-bottom: 10px;
}
.map-card a {
	text-decoration: none;
	color: inherit;
	display: block;
}
.map-card a:hover {
	color: #007bff;
}
.map-card img {
	height: 300px;
	border-radius: 5px;
	margin-top: 15px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}