.rrm-results-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #222; max-width: 100%; }
.rrm-header h2 { margin-bottom: 0.2em; }
.rrm-header .rrm-meta { color: #666; margin-top: 0; }

.rrm-filters { display: flex; flex-wrap: wrap; gap: .6em; margin: 1em 0; }

.rrm-contact-notice {
	text-align: right;
	font-size: .85em;
	color: #777;
	margin: 0.4em 0 0;
}
.rrm-contact-notice a { color: #777; text-decoration: underline; }
.rrm-contact-notice a:hover { color: #1c2b3a; }
.rrm-filters input, .rrm-filters select {
	padding: .5em .7em; border: 1px solid #ccc; border-radius: 6px; font-size: .95em;
}
.rrm-search { flex: 1; min-width: 200px; }

.rrm-table-scroll { overflow-x: auto; border: 1px solid #e2e2e2; border-radius: 8px; }
.rrm-table { border-collapse: collapse; width: 100%; font-size: .92em; }
.rrm-table thead th {
	background: #1c2b3a; color: #fff; text-align: left; padding: .7em .8em;
	white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.rrm-table th.rrm-sortable { cursor: pointer; user-select: none; }
.rrm-table th.rrm-sortable:after { content: '\21C5'; opacity: .45; margin-left: .35em; font-size: .85em; }
.rrm-table th.rrm-sort-asc:after { content: '\2191'; opacity: 1; }
.rrm-table th.rrm-sort-desc:after { content: '\2193'; opacity: 1; }

.rrm-table tbody td { padding: .55em .8em; border-bottom: 1px solid #eee; vertical-align: middle; }
.rrm-table tbody tr.rrm-row:hover { background: #f7f9fb; cursor: pointer; }
.rrm-table tbody tr.rrm-row.rrm-open { background: #eef4fb; }

.rrm-cat-tag { color: #888; font-size: .85em; margin-left: .3em; }
.rrm-name-cell { font-weight: 600; }
.rrm-expand-icon { display: inline-block; margin-left: .4em; color: #888; transition: transform .15s ease; }
.rrm-row.rrm-open .rrm-expand-icon { transform: rotate(180deg); }

.rrm-cert-link {
	display: inline-block; padding: .35em .8em; background: #1c2b3a; color: #fff !important;
	border-radius: 5px; text-decoration: none; font-size: .85em;
}
.rrm-cert-link:hover { background: #30465e; }

.rrm-photo-link {
	display: inline-block; margin-left: .3em; font-size: 1.1em; text-decoration: none;
	vertical-align: middle;
}

.rrm-splits-btn {
	background: #fff; border: 1px solid #ccc; border-radius: 5px; padding: .3em .6em;
	cursor: pointer; font-size: .85em;
}

.rrm-detail-row td { padding: 0; border-bottom: 2px solid #e2e2e2; }
.rrm-detail-panel { background: #fafbfc; padding: 1.2em; }

.rrm-splits-table { margin-bottom: 1.2em; overflow-x: auto; }
.rrm-splits-table table { border-collapse: collapse; }
.rrm-splits-table th, .rrm-splits-table td { padding: .4em .8em; border: 1px solid #ddd; font-size: .88em; text-align: center; }
.rrm-splits-table th { background: #eef1f4; }

.rrm-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1em; }
.rrm-chart-box { background: #fff; border: 1px solid #e2e2e2; border-radius: 8px; padding: .8em; min-height: 220px; }

.rrm-flag { font-size: 1.2em; margin-right: .2em; }

.rrm-status-badge {
	display: inline-block; padding: .15em .55em; border-radius: 4px; font-size: .8em; font-weight: 700;
	letter-spacing: .03em;
}
.rrm-status-dnf, .rrm-status-dsq, .rrm-status-dq { background: #fde3e3; color: #a3211f; }
.rrm-status-dns { background: #eee; color: #666; }
.rrm-row-dnf { opacity: .8; }

/* Mobile-only "more info" grid shown inside the expandable detail panel;
   hidden on desktop where those fields already have their own columns. */
.rrm-mobile-meta { display: none; }

/* ---------------- Events hub / grid ---------------- */
.rrm-hub { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #222; }
.rrm-notice { color: #666; }

.rrm-hub-filters { display: flex; flex-wrap: wrap; gap: .6em; margin: 0 0 1.4em; }
.rrm-hub-filters select {
	padding: .5em .7em; border: 1px solid #ccc; border-radius: 6px; font-size: .95em; background: #fff;
}

.rrm-event-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.4em;
}

.rrm-event-card {
	display: block; text-decoration: none; color: inherit;
	border: 1px solid #e6e6e6; border-radius: 10px; overflow: hidden;
	background: #fff; transition: box-shadow .15s ease, transform .15s ease;
}
.rrm-event-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.09); transform: translateY(-2px); }

.rrm-event-card-image {
	aspect-ratio: 1 / 1; background: #f2f4f6; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.rrm-event-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rrm-event-card-placeholder { font-size: 2.6em; opacity: .35; }

.rrm-event-card-body { padding: .9em 1em 1.1em; }
.rrm-event-card-title { margin: 0 0 .3em; font-size: 1.05em; line-height: 1.3; color: #1c2b3a; }
.rrm-event-card-meta { margin: 0; font-size: .85em; color: #777; }

@media (max-width: 480px) {
	.rrm-event-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1em; }
}

/* ---------------- Detail view back link / description ---------------- */
.rrm-back-link { margin-bottom: .6em; }
.rrm-back-link a { text-decoration: none; color: #1c2b3a; font-weight: 600; }
.rrm-back-link a:hover { text-decoration: underline; }
.rrm-description { color: #444; margin: .6em 0 0; }

/* ---------------- Photo gallery ---------------- */
.rrm-photo-gallery-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #222; }
.rrm-photo-public-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1em; margin-top: 1.2em;
}
.rrm-photo-public-item {
	display: block; border-radius: 8px; overflow: hidden; border: 1px solid #e6e6e6;
	aspect-ratio: 1 / 1;
}
.rrm-photo-public-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s ease; }
.rrm-photo-public-item:hover img { transform: scale(1.04); }

.rrm-album-entry { margin: .6em 0 0; }
.rrm-album-entry a { text-decoration: none; color: #1c2b3a; font-weight: 600; }
.rrm-album-entry a:hover { text-decoration: underline; }

.rrm-album-item { display: flex; flex-direction: column; }
.rrm-album-caption { font-size: .8em; color: #666; margin: .3em 0 0; text-align: center; }

.rrm-album-pagination {
	display: flex; align-items: center; justify-content: center; gap: 1.2em; margin-top: 1.6em; font-size: .95em;
}
.rrm-album-pagination a { text-decoration: none; color: #1c2b3a; font-weight: 600; }
.rrm-album-pagination a:hover { text-decoration: underline; }
.rrm-album-pagination span { color: #777; }

@media (max-width: 600px) {
	/* Compact raceresult.com-style row: just Rank / Name / Time visible,
	   tap the row to expand a panel with Bib, Cat Rank, Gender, Nat,
	   splits, certificate, and charts - reusing the existing expand/collapse
	   behaviour that already powers the desktop detail row. */
	.rrm-table thead { display: none; }
	.rrm-table, .rrm-table tbody { display: block; width: 100%; }

	.rrm-table tbody tr.rrm-row {
		display: flex;
		align-items: center;
		gap: .7em;
		width: 100%;
		padding: .7em .8em;
		border-bottom: 1px solid #eee;
	}
	.rrm-table tbody tr.rrm-row td { border: none; padding: 0; }

	/* These have dedicated columns on desktop; on mobile they move into
	   the expandable .rrm-mobile-meta panel instead. */
	.rrm-table td[data-col="cat_rank"],
	.rrm-table td[data-col="bib"],
	.rrm-table td[data-col="gender"],
	.rrm-table td[data-col="nat"],
	.rrm-table td[data-col="splits"],
	.rrm-table td[data-col="certificate"] {
		display: none;
	}

	.rrm-table td[data-col="rank"] {
		flex: 0 0 auto;
		min-width: 1.8em;
		font-weight: 700;
		color: #555;
	}
	.rrm-table td[data-col="name"] {
		flex: 1 1 auto;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.rrm-table td[data-col="time"] {
		flex: 0 0 auto;
		font-weight: 600;
		text-align: right;
	}

	.rrm-detail-row { display: block; width: 100%; }
	.rrm-detail-row td { padding: 0; }
	.rrm-detail-panel { padding: 1em; }

	.rrm-mobile-meta {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: .7em 1em;
		margin-bottom: 1em;
	}
	.rrm-mobile-meta-item { display: flex; flex-direction: column; }
	.rrm-mobile-meta-label { font-size: .78em; text-transform: uppercase; letter-spacing: .03em; color: #888; }
	.rrm-mobile-meta-value { font-weight: 600; }
	.rrm-mobile-meta-actions {
		grid-column: 1 / -1;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 1em;
		margin-top: .2em;
	}
	.rrm-mobile-meta-actions .rrm-photo-link { margin-left: 0; }
}
