/* PCC Maps — route submission form (Phase 6 redesign). Same
 * self-contained-panel + !important defensive pattern as library.css.
 * Reads tokens from design-tokens.css. */

.pcc-maps-submit {
	max-width: 1280px;
	margin: 0 auto;
	background: var(--pcc-surface);
	color: var(--pcc-ink) !important;
	font-family: var(--pcc-font-body);
	padding: 1.75em;
	border-radius: var(--pcc-radius-lg);
	border: 1px solid var(--pcc-border-light);
	box-shadow: var(--pcc-shadow-frame);
	box-sizing: border-box;
}
.pcc-maps-submit * {
	box-sizing: border-box;
}

.pcc-maps-submit-breadcrumb {
	font-size: 0.85em;
	color: var(--pcc-muted) !important;
	margin-bottom: 0.5em;
}
.pcc-maps-submit-breadcrumb a {
	color: var(--pcc-accent) !important;
	text-decoration: underline;
}

.pcc-maps-submit-title {
	font-family: var(--pcc-font-display);
	font-weight: 700;
	font-size: 1.9em;
	letter-spacing: 0.01em;
	color: var(--pcc-ink) !important;
	margin: 0 0 1.25em;
}

.pcc-maps-login-prompt {
	padding: 1.5em;
	background: var(--pcc-surface-tint-2);
	border-radius: var(--pcc-radius-md);
	text-align: center;
}
.pcc-maps-login-prompt p {
	margin-bottom: 1em;
	color: var(--pcc-ink-80) !important;
}

.pcc-maps-notice {
	padding: 0.9em 1.1em;
	border-radius: var(--pcc-radius-sm);
	margin-bottom: 1.5em;
	color: var(--pcc-ink-80) !important;
}
.pcc-maps-notice-error {
	background: var(--pcc-red-tint);
	border-left: 4px solid var(--pcc-red);
}
.pcc-maps-notice-error ul {
	margin: 0.5em 0 0 1.25em;
}

.pcc-maps-submit-columns {
	display: grid;
	grid-template-columns: 468px 1fr;
	gap: 32px;
	align-items: start;
}

/* --- Left column: file --- */

.pcc-maps-file-empty-lede {
	color: var(--pcc-muted) !important;
	font-size: 0.95em;
	margin: 0 0 1em;
}

.pcc-maps-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.5em;
	padding: 46px 1.5em;
	border: 2px dashed var(--pcc-border);
	border-radius: var(--pcc-radius-lg);
	background: var(--pcc-surface-tint-2);
	cursor: pointer;
	position: relative;
}
.pcc-maps-dropzone.is-dragover {
	border-color: var(--pcc-accent);
	background: var(--pcc-red-tint);
}
.pcc-maps-dropzone-icon {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--pcc-surface);
	border: 1px solid var(--pcc-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4em;
	color: var(--pcc-accent) !important;
	margin-bottom: 0.3em;
}
.pcc-maps-dropzone-title {
	font-family: var(--pcc-font-display);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.9em;
	color: var(--pcc-ink) !important;
}
.pcc-maps-dropzone-hint {
	font-size: 0.85em;
	color: var(--pcc-muted) !important;
}
.pcc-maps-dropzone-choose {
	color: var(--pcc-accent) !important;
	font-weight: 600;
	text-decoration: underline;
}
.pcc-maps-dropzone-note {
	font-size: 0.78em;
	color: var(--pcc-muted-light) !important;
}
.pcc-maps-dropzone input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}
.pcc-maps-dropzone-error {
	margin-top: 0.75em;
	padding: 0.6em 0.9em;
	background: var(--pcc-red-tint);
	color: var(--pcc-red) !important;
	border-radius: var(--pcc-radius-sm);
	font-size: 0.85em;
}

.pcc-maps-file-parsed {
	border: 1px solid var(--pcc-border-light);
	border-radius: var(--pcc-radius-lg);
	overflow: hidden;
}

.pcc-maps-file-confirm {
	display: flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.85em 1em;
	background: var(--pcc-green-tint);
	border-bottom: 1px solid #d9e7df;
}
.pcc-maps-file-confirm-check {
	color: var(--pcc-green) !important;
	font-size: 1.3em;
	line-height: 1;
}
.pcc-maps-file-confirm-name {
	font-weight: 600;
	font-size: 0.9em;
	color: var(--pcc-ink) !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 190px;
}
.pcc-maps-file-confirm-meta {
	font-size: 0.8em;
	color: var(--pcc-muted) !important;
}
.pcc-maps-replace-file {
	margin-left: auto;
	background: none;
	border: none;
	padding: 0;
	font-size: 0.85em;
	font-weight: 600;
	color: var(--pcc-accent) !important;
	text-decoration: underline;
	cursor: pointer;
}

.pcc-maps-preview-map {
	height: 250px;
	background: var(--pcc-thumb-bg);
	position: relative;
}
.pcc-maps-preview-map svg {
	width: 100%;
	height: 100%;
	display: block;
}
.pcc-maps-preview-map-caption {
	position: absolute;
	left: 12px;
	bottom: 12px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--pcc-ink-80) !important;
	font-size: 0.75em;
	padding: 0.3em 0.7em;
	border-radius: var(--pcc-radius-sm);
}

.pcc-maps-stats-strip {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
}
.pcc-maps-stats-cell {
	padding: 0.9em 1em;
	border-right: 1px solid var(--pcc-border-light);
	display: flex;
	flex-direction: column;
	gap: 0.3em;
}
.pcc-maps-stats-cell:last-child {
	border-right: none;
}
.pcc-maps-stats-label {
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pcc-muted) !important;
}
.pcc-maps-stats-value {
	font-family: var(--pcc-font-display);
	font-size: 1.5em;
	font-weight: 700;
	color: var(--pcc-ink) !important;
}
.pcc-maps-stats-value small {
	font-family: var(--pcc-font-body);
	font-size: 0.55em;
	font-weight: 400;
	color: var(--pcc-muted) !important;
}
.pcc-maps-elevation-sparkline {
	height: 32px;
}
.pcc-maps-elevation-sparkline svg {
	width: 100%;
	height: 100%;
	display: block;
}

.pcc-maps-submit .pcc-maps-field-hint {
	font-size: 0.8em;
	color: var(--pcc-muted-light) !important;
	margin-top: 0.5em;
	display: block;
}

/* --- Right column: details --- */

.pcc-maps-submit-details-column {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.pcc-maps-field {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	margin: 0;
}

.pcc-maps-field label,
.pcc-maps-field-label {
	font-weight: 600;
	font-size: 0.95em;
	color: var(--pcc-ink) !important;
}

.pcc-maps-field-label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
}

.pcc-required {
	color: var(--pcc-red) !important;
}

.pcc-maps-field input[type="text"],
.pcc-maps-field textarea {
	height: 50px;
	padding: 0.6em 0.9em;
	border: 1px solid var(--pcc-border);
	border-radius: var(--pcc-radius-sm);
	font-size: 1em;
	font-family: inherit;
	color: var(--pcc-ink) !important;
	background: var(--pcc-surface);
}
.pcc-maps-field textarea {
	height: 116px;
	resize: vertical;
}
.pcc-maps-field input::placeholder,
.pcc-maps-field textarea::placeholder {
	color: var(--pcc-placeholder) !important;
}

.pcc-maps-field-hint {
	font-size: 0.8em;
	color: var(--pcc-muted-light) !important;
}

.pcc-maps-field-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em;
}
.pcc-maps-field-row > .pcc-maps-field {
	flex: 1 1 220px;
}

/* Ride type segmented (shared visual language with the library filter) */
.pcc-maps-segmented-type {
	display: flex;
	width: 240px;
	background: var(--pcc-segment-track);
	border-radius: var(--pcc-radius-sm);
	padding: 4px;
	gap: 2px;
}
.pcc-maps-segmented-type .pcc-maps-segment {
	flex: 1;
	text-align: center;
	padding: 0.6em;
	border-radius: 5px;
	font-weight: 600;
	font-size: 0.9em;
	color: var(--pcc-muted) !important;
	cursor: pointer;
}
.pcc-maps-segmented-type .pcc-maps-segment input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.pcc-maps-segmented-type .pcc-maps-segment:has(input:checked) {
	background: var(--pcc-surface);
	color: var(--pcc-ink) !important;
	box-shadow: var(--pcc-shadow-segment);
}

/* Difficulty cards */
.pcc-maps-difficulty-suggestion {
	font-weight: 400;
	font-size: 0.85em;
	color: var(--pcc-muted) !important;
}
.pcc-maps-difficulty-suggestion strong {
	color: var(--pcc-accent) !important;
}

.pcc-maps-difficulty-cards {
	display: flex;
	gap: 0.5em;
}
.pcc-maps-difficulty-card {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4em;
	padding: 0.75em 0.5em;
	border: 1.5px solid var(--pcc-border-light);
	border-radius: var(--pcc-radius-sm);
	cursor: pointer;
	text-align: center;
}
.pcc-maps-difficulty-card input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.pcc-maps-difficulty-card span:last-child {
	font-size: 0.85em;
	font-weight: 600;
	color: var(--pcc-ink) !important;
}
.pcc-maps-difficulty-card[data-difficulty-card="green"]:has(input:checked) { background: var(--pcc-green-tint); border-color: var(--pcc-green); }
.pcc-maps-difficulty-card[data-difficulty-card="blue"]:has(input:checked) { background: var(--pcc-blue-tint); border-color: var(--pcc-blue); }
.pcc-maps-difficulty-card[data-difficulty-card="red"]:has(input:checked) { background: var(--pcc-red-tint); border-color: var(--pcc-red); }
.pcc-maps-difficulty-card[data-difficulty-card="black"]:has(input:checked) { background: var(--pcc-black-tint); border-color: var(--pcc-black); }

.pcc-maps-difficulty-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
}

/* Cafe stops (unchanged visual language from Phase 5) */
.pcc-maps-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	font-size: 0.9em;
	color: var(--pcc-ink-80) !important;
}

.pcc-maps-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

#pcc-submit-cafe-stops-rows {
	display: flex;
	flex-direction: column;
	gap: 0.6em;
	margin-bottom: 0.6em;
}

#pcc-submit-add-cafe-stop {
	align-self: flex-start;
}

.pcc-cafe-stop-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	padding: 0.6em;
	background: var(--pcc-surface-tint-2);
	border-radius: var(--pcc-radius-sm);
}
.pcc-cafe-stop-row input[type="text"] {
	padding: 0.45em 0.6em;
	border: 1px solid var(--pcc-border);
	border-radius: 4px;
	flex: 1 1 160px;
	color: var(--pcc-ink) !important;
	background: var(--pcc-surface);
	height: auto;
}
.pcc-maps-toggle-coords {
	background: none;
	border: none;
	color: var(--pcc-accent) !important;
	font-size: 0.85em;
	cursor: pointer;
	padding: 0.3em 0.2em;
}
.pcc-remove-cafe-stop {
	background: none;
	border: none;
	color: var(--pcc-red) !important;
	font-size: 1.2em;
	line-height: 1;
	cursor: pointer;
	padding: 0 0.3em;
}
.pcc-cafe-stop-coords {
	display: flex;
	gap: 0.5em;
	width: 100%;
}
.pcc-cafe-stop-coords input {
	max-width: 140px;
}
.pcc-cafe-stop-coords[hidden] {
	display: none;
}

/* Publish toggle */
.pcc-maps-publish-toggle {
	display: flex;
	align-items: flex-start;
	gap: 0.9em;
	padding: 1em;
	background: var(--pcc-surface-tint-2);
	border-radius: var(--pcc-radius-md);
	cursor: pointer;
}
.pcc-maps-publish-toggle input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.pcc-maps-toggle-switch {
	flex: none;
	width: 44px;
	height: 26px;
	border-radius: 999px;
	background: var(--pcc-border);
	position: relative;
	margin-top: 0.15em;
	transition: background 0.15s ease;
}
.pcc-maps-toggle-switch::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(34, 51, 58, 0.3);
	transition: transform 0.15s ease;
}
.pcc-maps-publish-toggle input:checked + .pcc-maps-toggle-switch {
	background: var(--pcc-accent);
}
.pcc-maps-publish-toggle input:checked + .pcc-maps-toggle-switch::after {
	transform: translateX(18px);
}
.pcc-maps-toggle-text {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
	font-size: 0.9em;
}
.pcc-maps-toggle-text strong {
	color: var(--pcc-ink) !important;
}
.pcc-maps-toggle-text span {
	font-size: 0.85em;
	color: var(--pcc-muted) !important;
}

.pcc-maps-submit-actions {
	display: flex;
	align-items: center;
	gap: 1em;
	margin: 0;
}
.pcc-maps-submit-note {
	font-size: 0.85em;
	color: var(--pcc-muted-light) !important;
}

@media (max-width: 900px) {
	.pcc-maps-submit {
		padding: 1.1em;
		padding-bottom: 5.5em; /* room for the sticky action bar below */
	}
	.pcc-maps-submit-columns {
		grid-template-columns: 1fr;
		gap: 18px;
	}
	.pcc-maps-field-row {
		flex-direction: column;
		gap: 1em;
	}
	.pcc-maps-segmented-type {
		width: 100%;
	}
	.pcc-maps-difficulty-cards {
		flex-wrap: wrap;
	}
	.pcc-maps-difficulty-card {
		flex: 1 1 40%;
	}
	.pcc-maps-stats-strip {
		grid-template-columns: 1fr 1fr;
	}
	.pcc-maps-stats-cell:nth-child(3) {
		grid-column: 1 / -1;
		border-right: none;
		border-top: 1px solid var(--pcc-border-light);
	}

	/* Sticky "Publish route" bar — the toggle/note stay inline, only
	 * the primary action pins to the bottom within thumb's reach. */
	.pcc-maps-submit-actions {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 40;
		background: var(--pcc-surface);
		border-top: 1px solid var(--pcc-border-light);
		padding: 0.85em 1.1em;
		box-shadow: 0 -4px 14px rgba(34, 51, 58, 0.08);
	}
	.pcc-maps-submit-actions [data-pcc-publish-submit] {
		flex: 1;
		text-align: center;
	}
	.pcc-maps-submit-note {
		display: none;
	}
}
