.tripmems-tour-app,
.tripmems-tour-stops {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    box-sizing: border-box;
}

.tripmems-tour-app * {
    box-sizing: border-box;
}

.tripmems-offline-status {
    max-width: 980px;
    padding: 14px 16px;
    margin: 16px auto;
    border: 1px solid #d8c7a3;
    border-radius: 12px;
    background: #fff8ea;
}

.tripmems-tour-nav-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 14px;
    margin: 0 auto 18px;
    border: 1px solid #d0d5dd;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
}

.tripmems-tour-nav-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.tripmems-tour-nav-copy {
    min-width: 0;
    flex: 1;
}

.tripmems-tour-nav-label {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #667085;
    margin-bottom: 4px;
}

.tripmems-tour-nav-active-line {
    font-size: 18px;
    line-height: 1.25;
    color: #101828;
}

.tripmems-tour-nav-active-line strong {
    font-weight: 900;
}

.tripmems-gps-status {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.35;
    color: #475467;
}

.tripmems-tour-nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.tripmems-nav-compass-block {
    width: 92px;
    text-align: center;
}

.tripmems-compass-placeholder {
    display: block;
    width: 64px;
    margin: 0 auto;
    text-align: center;
}

.tripmems-compass-face {
    position: relative;
    width: 58px;
    height: 58px;
    margin: 0 auto;
    border: 3px solid #d0d5dd;
    border-radius: 50%;
    background: #f9fafb;
}

.tripmems-compass-north {
    position: absolute;
    top: 3px;
    left: 0;
    right: 0;
    text-align: center;
    color: #d92d20;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.tripmems-compass-arrow {
    position: absolute;
    left: 50%;
    top: 54%;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%) rotate(38deg);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 25px solid #1570ef;
}

.tripmems-compass-centre {
    position: absolute;
    left: 50%;
    top: 54%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #101828;
}

.tripmems-compass-unavailable-slash {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 56px;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 999px;
    background: #d92d20;
}

.tripmems-compass-label {
    display: none;
}

.tripmems-nearest-distance {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    color: #101828;
}

.tripmems-gps-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid #d0d5dd;
    background: #f9fafb;
    color: #344054;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tripmems-gps-button {
    min-width: 112px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 900;
    border: 0;
    border-radius: 12px;
    background: #2f5d50;
    color: #fff;
    cursor: pointer;
}

.tripmems-gps-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tripmems-closer-site-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 2px solid #1570ef;
    border-radius: 14px;
    background: #eff8ff;
    color: #1849a9;
    font-size: 14px;
    line-height: 1.35;
}

.tripmems-closer-site-alert[hidden] {
    display: none !important;
}

.tripmems-closer-site-alert button {
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: #1570ef;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.tripmems-gps-results {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.35;
    color: #475467;
}

.tripmems-active-site-card {
    margin: 0 0 20px;
    padding: 16px;
    border: 3px solid #12b76a;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10);
}

.tripmems-site-detail-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tripmems-site-mode-label {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #067647;
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tripmems-site-distance {
    font-size: 13px;
    font-weight: 900;
    color: #344054;
    text-align: right;
}

.tripmems-site-detail-title {
    margin: 0 0 14px;
    font-size: 28px;
    line-height: 1.12;
    color: #101828;
}

.tripmems-site-media-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: #f2f4f7;
    border: 1px solid #eaecf0;
}

.tripmems-stop-image-wrap {
    width: 100%;
    max-width: none;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: #f0f0f0;
}

.tripmems-stop-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tripmems-media-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    min-height: 220px;
    background: linear-gradient(135deg, #f2f4f7, #eaecf0);
    color: #667085;
    font-weight: 900;
}

.tripmems-media-caption {
    padding: 12px 14px;
    min-height: 58px;
    background: #ffffff;
    color: #344054;
    font-size: 15px;
    line-height: 1.35;
}

.tripmems-carousel-hint {
    padding: 9px 14px 11px;
    border-top: 1px solid #eaecf0;
    background: #f9fafb;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.tripmems-audio-card {
    margin: 16px 0 0;
    padding: 15px;
    border-radius: 16px;
    background: #eef6ff;
    border: 1px solid #c7ddff;
}

.tripmems-audio-title {
    font-size: 15px;
    font-weight: 900;
    color: #1849a9;
    margin-bottom: 3px;
}

.tripmems-audio-note {
    font-size: 14px;
    color: #344054;
    margin-bottom: 10px;
}

.tripmems-audio-card .wp-block-audio {
    margin: 0;
}

.tripmems-tour-stops .wp-block-audio audio {
    width: 100%;
    max-width: none;
}

.tripmems-read-story-toggle {
    display: block;
    width: 100%;
    margin: 16px 0 0;
    padding: 14px 16px;
    border: 1px solid #d0d5dd;
    border-radius: 14px;
    background: #ffffff;
    color: #101828;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.tripmems-site-story {
    margin: 12px 0 0;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #eaecf0;
    background: #ffffff;
    color: #344054;
    font-size: 16px;
    line-height: 1.6;
}

.tripmems-other-sites-section {
    margin: 22px 0 0;
}

.tripmems-other-sites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tripmems-other-sites-header h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    color: #101828;
}

.tripmems-icon-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.tripmems-site-list {
    display: grid;
    gap: 12px;
}

.tripmems-site-list-item {
    border: 1px solid #eaecf0;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.tripmems-site-list-item.is-current-active {
    display: none;
}

.tripmems-site-list-button {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 92px;
    padding: 10px;
    border: 0;
    background: #ffffff;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.tripmems-site-list-button:hover,
.tripmems-site-list-button:focus {
    background: #f9fafb;
}

.tripmems-site-thumb-wrap {
    display: block;
    width: 86px;
    height: 72px;
    overflow: hidden;
    border-radius: 12px;
    background: #f2f4f7;
}

.tripmems-site-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tripmems-site-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #667085;
    font-size: 12px;
    font-weight: 900;
}

.tripmems-site-list-text {
    min-width: 0;
}

.tripmems-site-list-title {
    display: block;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 900;
    color: #101828;
}

.tripmems-site-row-distance {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.25;
    color: #667085;
    font-weight: 700;
}

.tripmems-site-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 4px;
}

.tripmems-progress-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #d0d5dd;
    background: #f9fafb;
    opacity: 0.28;
    filter: grayscale(1);
    font-size: 14px;
}

.tripmems-site-list-item.is-been-there .tripmems-been-there-icon,
.tripmems-site-list-item.is-explored .tripmems-explored-icon {
    opacity: 1;
    filter: none;
    background: #ecfdf3;
    border-color: #abefc6;
}

.tripmems-list-expanded-panel {
    padding: 14px;
    border-top: 1px solid #eaecf0;
    background: #fcfcfd;
}

.tripmems-list-expanded-panel[hidden] {
    display: none !important;
}

.tripmems-list-expanded-panel .tripmems-site-detail-title {
    font-size: 23px;
}

.tripmems-list-expanded-panel .tripmems-site-mode-label {
    background: #eff8ff;
    color: #1849a9;
}

.tripmems-nearby-alert {
    padding: 14px;
    border: 2px solid #2f5d50;
    border-radius: 10px;
    background: #fff;
    margin-top: 10px;
}

.tripmems-nearby-alert-title {
    font-size: 18px;
}

.tripmems-gps-link {
    display: inline-block;
    padding: 10px 14px;
    text-decoration: none;
    border-radius: 6px;
    margin-right: 8px;
}

.tripmems-gps-link-primary {
    background: #333;
    color: #fff;
}

.tripmems-gps-dismiss-button {
    padding: 10px 14px;
    border: 1px solid #999;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

/* TripMems / Oursights buy page styling */

.tm-stripe-checkout-box {
	max-width: 720px;
	margin: 32px auto !important;
	background: #ffffff;
	border: 1px solid #e4e4e4;
	border-radius: 20px;
	padding: 30px;
	box-shadow: 0 14px 38px rgba(0, 0, 0, 0.08);
	box-sizing: border-box;
}

.tm-stripe-checkout-box form:first-child {
	margin-top: 0 !important;
	margin-bottom: 28px !important;
}

.tm-stripe-checkout-box form:first-child button {
	display: block !important;
	width: 100%;
	max-width: 380px;
	font-size: 20px !important;
	font-weight: 700 !important;
	padding: 18px 24px !important;
	border-radius: 14px !important;
	background: #111 !important;
	color: #fff !important;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.tm-stripe-checkout-box form:first-child button:hover,
.tm-stripe-checkout-box form:first-child button:focus {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.tm-access-recovery {
	margin-top: 34px !important;
	padding-top: 28px !important;
	border-top: 1px solid #ddd !important;
}

.tm-access-recovery p:first-child {
	font-size: 22px;
	margin-bottom: 12px;
}

.tm-access-recovery p {
	font-size: 18px;
	line-height: 1.4;
}

.tm-access-recovery form {
	display: flex !important;
	gap: 12px !important;
	align-items: stretch !important;
	margin-top: 18px;
}

.tm-access-recovery input[type="email"] {
	flex: 1;
	min-height: 50px;
	font-size: 16px;
	box-sizing: border-box;
	border-radius: 10px !important;
}

.tm-access-recovery button {
	min-height: 50px;
	font-weight: 700;
	border-radius: 10px !important;
	white-space: nowrap;
}

.tm-stripe-checkout-placeholder {
	max-width: 720px;
	margin: 32px auto !important;
	font-size: 18px;
	line-height: 1.45;
	box-sizing: border-box;
}

@media (max-width: 700px) {
    .tripmems-tour-app,
    .tripmems-tour-stops,
    .tripmems-offline-status {
        max-width: none;
        width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .tripmems-tour-nav-header {
        border-radius: 16px;
        margin-bottom: 14px;
        padding: 12px;
    }

    .tripmems-tour-nav-main {
        align-items: flex-start;
        gap: 10px;
    }

    .tripmems-tour-nav-active-line {
        font-size: 16px;
    }

    .tripmems-gps-status {
        font-size: 13px;
    }

    .tripmems-tour-nav-controls {
        flex-direction: column;
        gap: 8px;
    }

    .tripmems-nav-compass-block {
        width: 78px;
    }

    .tripmems-compass-face {
        width: 52px;
        height: 52px;
    }

    .tripmems-gps-button {
        min-width: 88px;
        padding: 10px 11px;
        font-size: 13px;
    }

    .tripmems-active-site-card {
        padding: 12px;
        border-radius: 20px;
    }

    .tripmems-site-detail-title {
        font-size: 25px;
    }

    .tripmems-media-caption {
        font-size: 14px;
    }

    .tripmems-site-list-button {
        grid-template-columns: 76px minmax(0, 1fr) auto;
        gap: 10px;
        min-height: 84px;
        padding: 9px;
    }

    .tripmems-site-thumb-wrap {
        width: 76px;
        height: 64px;
    }

    .tripmems-site-list-title {
        font-size: 15px;
    }

    .tripmems-progress-icon {
        width: 27px;
        height: 27px;
        font-size: 13px;
    }

	.tm-stripe-checkout-box,
	.tm-stripe-checkout-placeholder {
		margin: 24px 14px !important;
		padding: 22px !important;
		border-radius: 18px;
	}

	.tm-stripe-checkout-box form:first-child button {
		max-width: none;
		width: 100%;
		font-size: 19px !important;
	}

	.tm-access-recovery form {
		display: block !important;
	}

	.tm-access-recovery input[type="email"],
	.tm-access-recovery button {
		width: 100%;
		box-sizing: border-box;
		margin-top: 10px;
	}

	.tm-access-recovery button {
		display: block;
	}
}

@media (max-width: 430px) {
    .tripmems-tour-app,
    .tripmems-tour-stops,
    .tripmems-offline-status {
        padding-left: 8px;
        padding-right: 8px;
    }

    .tripmems-site-detail-topline {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .tripmems-site-distance {
        text-align: left;
    }

    .tripmems-site-list-button {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .tripmems-site-icons {
        grid-column: 2;
        justify-content: flex-start;
        padding-left: 0;
    }

    .tripmems-site-thumb-wrap {
        width: 70px;
        height: 60px;
    }
}

/* Step 1B compact mobile tour header overrides */
.tripmems-gps-box.tripmems-tour-nav-header {
    border: 1px solid #d0d5dd !important;
    border-radius: 18px !important;
    padding: 10px 12px !important;
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08) !important;
}

.tripmems-tour-nav-main {
    align-items: center !important;
}

.tripmems-tour-nav-label {
    font-size: 11px !important;
    margin-bottom: 2px !important;
}

.tripmems-tour-nav-active-line {
    font-size: 16px !important;
    line-height: 1.2 !important;
}

.tripmems-gps-status {
    margin: 4px 0 0 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
}

.tripmems-tour-nav-controls {
    align-items: center !important;
    gap: 8px !important;
}

.tripmems-nav-compass-block {
    width: auto !important;
    min-width: 66px !important;
    text-align: center !important;
}

.tripmems-compass-placeholder {
    width: 50px !important;
    margin: 0 auto !important;
}

.tripmems-compass-face {
    width: 46px !important;
    height: 46px !important;
    border-radius: 999px !important;
}

.tripmems-nearest-distance {
    margin-top: 3px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
}

.tripmems-gps-badge {
    margin-top: 3px !important;
    padding: 3px 6px !important;
    font-size: 9px !important;
}

.tripmems-gps-button {
    min-width: 86px !important;
    padding: 9px 10px !important;
    border-radius: 11px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
}

.tripmems-gps-results {
    display: none !important;
}

@media (max-width: 700px) {
    .tripmems-offline-status,
    .tripmems-tour-app {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        margin-left: calc(50% - 50vw + 8px) !important;
        margin-right: calc(50% - 50vw + 8px) !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .tripmems-tour-stops {
        max-width: none !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .tripmems-gps-box.tripmems-tour-nav-header {
        padding: 10px !important;
        margin-bottom: 14px !important;
    }

    .tripmems-tour-nav-main {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 8px !important;
    }

    .tripmems-tour-nav-active-line {
        font-size: 15px !important;
    }

    .tripmems-gps-status {
        font-size: 12px !important;
    }

    .tripmems-tour-nav-controls {
        flex-direction: row !important;
        gap: 6px !important;
    }

    .tripmems-nav-compass-block {
        min-width: 58px !important;
    }

    .tripmems-compass-placeholder {
        width: 44px !important;
    }

    .tripmems-compass-face {
        width: 42px !important;
        height: 42px !important;
    }

    .tripmems-compass-arrow {
        border-left-width: 5px !important;
        border-right-width: 5px !important;
        border-bottom-width: 18px !important;
    }

    .tripmems-compass-unavailable-slash {
        height: 42px !important;
    }

    .tripmems-gps-button {
        min-width: 74px !important;
        padding: 8px 8px !important;
        font-size: 11px !important;
    }

    .tripmems-active-site-card {
        padding: 10px !important;
        border-radius: 18px !important;
    }
}

/* Step 1C: force consistent image/media sizing across all tour sites. */
.tripmap-ignore {}
.tripmems-site-media-carousel,
.tripmems-site-media-carousel * {
    box-sizing: border-box !important;
}

.tripmems-site-media-carousel {
    width: 100% !important;
    max-width: none !important;
    overflow: hidden !important;
}

.tripmems-media-slide,
.tripmems-media-slide.is-current {
    width: 100% !important;
    max-width: none !important;
}

figure.tripmems-stop-image-wrap,
.tripmems-stop-image-wrap.tripmems-media-image-wrap,
.tripmems-site-media-carousel .tripmems-stop-image-wrap {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: clamp(240px, 72vw, 520px) !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #f2f4f7 !important;
}

.tripmems-stop-image-wrap img.tripmems-stop-image,
.tripmems-site-media-carousel img.tripmems-stop-image {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    object-fit: cover !important;
}

.tripmems-media-placeholder {
    width: 100% !important;
    max-width: none !important;
    height: clamp(240px, 72vw, 520px) !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
}

.tripmems-site-thumb-wrap,
.tripmems-site-list-button .tripmems-site-thumb-wrap {
    display: block !important;
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    overflow: hidden !important;
}

.tripmems-site-thumb,
.tripmems-site-thumb-placeholder,
.tripmems-site-list-button img.tripmems-site-thumb {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    object-fit: cover !important;
}

@media (min-width: 701px) {
    figure.tripmems-stop-image-wrap,
    .tripmems-stop-image-wrap.tripmems-media-image-wrap,
    .tripmems-site-media-carousel .tripmems-stop-image-wrap,
    .tripmems-media-placeholder {
        height: 460px !important;
    }
}

@media (max-width: 430px) {
    figure.tripmems-stop-image-wrap,
    .tripmems-stop-image-wrap.tripmems-media-image-wrap,
    .tripmems-site-media-carousel .tripmems-stop-image-wrap,
    .tripmems-media-placeholder {
        height: 70vw !important;
        min-height: 235px !important;
        max-height: 315px !important;
    }

    .tripmems-site-thumb-wrap,
    .tripmems-site-list-button .tripmems-site-thumb-wrap {
        width: 74px !important;
        min-width: 74px !important;
        max-width: 74px !important;
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
    }
}

/* Step 1D: mobile-only equal image frame sizing.
   Fixes mobile Safari cases where active/exploring image frames or thumbnail frames
   can render at different heights even though desktop is correct. */
@media (max-width: 700px) {
    .tripmems-active-site-card .tripmems-site-media-carousel,
    .tripmems-list-expanded-panel .tripmems-site-media-carousel,
    .tripmems-site-detail .tripmems-site-media-carousel {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .tripmems-active-site-card .tripmems-media-slide,
    .tripmems-list-expanded-panel .tripmems-media-slide,
    .tripmems-site-detail .tripmems-media-slide,
    .tripmems-active-site-card .tripmems-media-slide.is-current,
    .tripmems-list-expanded-panel .tripmems-media-slide.is-current,
    .tripmems-site-detail .tripmems-media-slide.is-current {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .tripmems-active-site-card figure.tripmems-stop-image-wrap,
    .tripmems-list-expanded-panel figure.tripmems-stop-image-wrap,
    .tripmems-site-detail figure.tripmems-stop-image-wrap,
    .tripmems-active-site-card .tripmems-stop-image-wrap.tripmems-media-image-wrap,
    .tripmems-list-expanded-panel .tripmems-stop-image-wrap.tripmems-media-image-wrap,
    .tripmems-site-detail .tripmems-stop-image-wrap.tripmems-media-image-wrap,
    .tripmems-active-site-card .tripmems-media-placeholder,
    .tripmems-list-expanded-panel .tripmems-media-placeholder,
    .tripmems-site-detail .tripmems-media-placeholder {
        display: block !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: calc((100vw - 32px) * 0.72) !important;
        min-height: 235px !important;
        max-height: 315px !important;
        aspect-ratio: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border-radius: 0 !important;
        background: #f2f4f7 !important;
    }

    .tripmems-active-site-card .tripmems-stop-image,
    .tripmems-list-expanded-panel .tripmems-stop-image,
    .tripmems-site-detail .tripmems-stop-image,
    .tripmems-active-site-card img.tripmems-stop-image,
    .tripmems-list-expanded-panel img.tripmems-stop-image,
    .tripmems-site-detail img.tripmems-stop-image {
        display: block !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        max-height: none !important;
        object-fit: cover !important;
    }

    .tripmems-site-list-button .tripmems-site-thumb-wrap,
    .tripmems-site-thumb-wrap {
        display: block !important;
        box-sizing: border-box !important;
        width: 74px !important;
        min-width: 74px !important;
        max-width: 74px !important;
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
        overflow: hidden !important;
        flex: 0 0 74px !important;
    }

    .tripmems-site-list-button .tripmems-site-thumb,
    .tripmems-site-list-button img.tripmems-site-thumb,
    .tripmems-site-thumb,
    .tripmems-site-thumb-placeholder {
        display: block !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: cover !important;
    }
}

@media (max-width: 380px) {
    .tripmems-active-site-card figure.tripmems-stop-image-wrap,
    .tripmems-list-expanded-panel figure.tripmems-stop-image-wrap,
    .tripmems-site-detail figure.tripmems-stop-image-wrap,
    .tripmems-active-site-card .tripmems-stop-image-wrap.tripmems-media-image-wrap,
    .tripmems-list-expanded-panel .tripmems-stop-image-wrap.tripmems-media-image-wrap,
    .tripmems-site-detail .tripmems-stop-image-wrap.tripmems-media-image-wrap,
    .tripmems-active-site-card .tripmems-media-placeholder,
    .tripmems-list-expanded-panel .tripmems-media-placeholder,
    .tripmems-site-detail .tripmems-media-placeholder {
        height: calc((100vw - 28px) * 0.72) !important;
        min-height: 225px !important;
        max-height: 292px !important;
    }
}


/* Step 1F: the active site should not appear again in the thumbnail list. */
.tripmems-site-list-item[hidden],
.tripmems-site-list-item.is-current-active {
    display: none !important;
}

/* Step 1G: keep all mobile list thumbnails visually consistent.
   The main image crop/zoom is useful for large media, but thumbnails should
   not inherit per-stop zoom because it makes each thumbnail look like a
   different size on phones. */
.tripmems-site-list-button .tripmems-site-thumb-wrap {
    display: block !important;
    box-sizing: border-box !important;
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: #f2f4f7 !important;
}

.tripmems-site-list-button .tripmems-site-thumb,
.tripmems-site-list-button img.tripmems-site-thumb {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    transform: none !important;
}

@media (max-width: 700px) {
    .tripmems-site-list-button {
        grid-template-columns: 74px minmax(0, 1fr) auto !important;
        align-items: center !important;
    }

    .tripmems-site-list-button .tripmems-site-thumb-wrap {
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
    }
}

@media (max-width: 430px) {
    .tripmems-site-list-button {
        grid-template-columns: 74px minmax(0, 1fr) !important;
    }

    .tripmems-site-icons {
        grid-column: 2 !important;
    }
}

/* Step 1H: hard mobile list/card correction.
   Purpose: force the "Other sites" list to stay a compact clickable thumbnail list
   even when the theme or mobile Safari tries to treat buttons/images as full-width blocks. */
body .tripmems-tour-app .tripmems-other-sites-section {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 760px !important;
    margin: 18px auto 0 !important;
    padding: 0 !important;
}

body .tripmems-tour-app .tripmems-other-sites-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin: 0 2px 10px !important;
}

body .tripmems-tour-app .tripmems-other-sites-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}

body .tripmems-tour-app .tripmems-icon-legend {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    opacity: 0.65 !important;
}

body .tripmems-tour-app .tripmems-site-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body .tripmems-tour-app .tripmems-site-list-item {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 5px 16px rgba(16, 24, 40, 0.07) !important;
}

body .tripmems-tour-app .tripmems-site-list-item[hidden],
body .tripmems-tour-app .tripmems-site-list-item.is-current-active {
    display: none !important;
}

body .tripmems-tour-app button.tripmems-site-list-button,
body .tripmems-tour-app .tripmems-site-list-button {
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr) 52px !important;
    grid-template-areas: "thumb text icons" !important;
    align-items: center !important;
    column-gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 88px !important;
    margin: 0 !important;
    padding: 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #101828 !important;
    text-align: left !important;
    font: inherit !important;
    cursor: pointer !important;
}

body .tripmems-tour-app .tripmems-site-list-button .tripmems-site-thumb-wrap {
    grid-area: thumb !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: #f2f4f7 !important;
}

body .tripmems-tour-app .tripmems-site-list-button img.tripmems-site-thumb,
body .tripmems-tour-app .tripmems-site-list-button .tripmems-site-thumb {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
    transform-origin: center center !important;
}

body .tripmems-tour-app .tripmems-site-list-text {
    grid-area: text !important;
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body .tripmems-tour-app .tripmems-site-list-title {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #101828 !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 850 !important;
    white-space: normal !important;
}

body .tripmems-tour-app .tripmems-site-row-distance {
    display: block !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
    color: #667085 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
}

body .tripmems-tour-app .tripmems-site-icons {
    grid-area: icons !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body .tripmems-tour-app .tripmems-progress-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #d0d5dd !important;
    border-radius: 999px !important;
    background: #f9fafb !important;
    font-size: 12px !important;
    line-height: 1 !important;
    opacity: 0.28 !important;
    filter: grayscale(1) !important;
}

body .tripmems-tour-app .tripmems-site-list-item.is-been-there .tripmems-been-there-icon,
body .tripmems-tour-app .tripmems-site-list-item.is-explored .tripmems-explored-icon {
    opacity: 1 !important;
    filter: none !important;
    background: #ecfdf3 !important;
    border-color: #abefc6 !important;
}

body .tripmems-tour-app .tripmems-list-expanded-panel {
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px !important;
    border-top: 1px solid #eaecf0 !important;
    background: #fcfcfd !important;
}

@media (max-width: 430px) {
    body .tripmems-tour-app .tripmems-other-sites-header h3 {
        font-size: 19px !important;
    }

    body .tripmems-tour-app button.tripmems-site-list-button,
    body .tripmems-tour-app .tripmems-site-list-button {
        grid-template-columns: 82px minmax(0, 1fr) 48px !important;
        column-gap: 10px !important;
        min-height: 80px !important;
        padding: 9px !important;
    }

    body .tripmems-tour-app .tripmems-site-list-button .tripmems-site-thumb-wrap {
        width: 82px !important;
        min-width: 82px !important;
        max-width: 82px !important;
        height: 62px !important;
        min-height: 62px !important;
        max-height: 62px !important;
    }

    body .tripmems-tour-app .tripmems-site-list-title {
        font-size: 15px !important;
    }

    body .tripmems-tour-app .tripmems-site-row-distance {
        font-size: 11px !important;
    }

    body .tripmems-tour-app .tripmems-progress-icon {
        width: 22px !important;
        min-width: 22px !important;
        height: 22px !important;
        min-height: 22px !important;
        font-size: 11px !important;
    }
}


/* Step 2A: image-first expanded view with tappable commentary preview. */
.tripmems-story-shell {
    margin: 16px 0 0;
    border: 1px solid #d0d5dd;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
}

.tripmems-story-shell .tripmems-site-story {
    position: relative;
    margin: 0;
    padding: 14px 16px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #344054;
    font-size: 16px;
    line-height: 1.55;
}

.tripmems-story-shell .tripmems-site-story p:first-child {
    margin-top: 0;
}

.tripmems-story-shell .tripmems-site-story p:last-child {
    margin-bottom: 0;
}

.tripmems-story-shell.is-collapsed .tripmems-site-story {
    max-height: 5.1em;
    overflow: hidden;
}

.tripmems-story-shell.is-collapsed .tripmems-site-story::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.4em;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff 86%);
    pointer-events: none;
}

.tripmems-story-shell.is-open .tripmems-site-story {
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
}

.tripmems-story-shell .tripmems-read-story-toggle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 11px 16px 13px;
    border: 0;
    border-top: 1px solid #eaecf0;
    border-radius: 0;
    background: #ffffff;
    color: #2f5d50;
    font-size: 15px;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.tripmems-story-shell .tripmems-read-story-toggle::after {
    content: "›";
    float: right;
    font-size: 20px;
    line-height: 1;
    transform: rotate(90deg);
}

.tripmems-story-shell.is-open .tripmems-read-story-toggle::after {
    transform: rotate(-90deg);
}

body .tripmems-tour-app .tripmems-list-expanded-panel {
    margin: 8px 8px 14px;
    padding: 14px;
    border: 1px solid #d0d5dd;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.14);
}

body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-detail {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-media-carousel {
    margin-top: 2px;
}

@media (max-width: 600px) {
    body .tripmems-tour-app .tripmems-list-expanded-panel {
        margin: 8px 6px 14px;
        padding: 12px;
        min-height: 56vh;
    }

    body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-detail-title {
        font-size: 24px;
        margin-bottom: 12px;
    }

    body .tripmems-tour-app .tripmems-story-shell .tripmems-site-story {
        font-size: 15px;
        line-height: 1.5;
    }

    body .tripmems-tour-app .tripmems-story-shell.is-collapsed .tripmems-site-story {
        max-height: 4.8em;
    }
}

/* Step 3: true swipeable media carousel using the current main image and existing story text. */
body .tripmems-tour-app .tripmems-site-media-carousel {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 18px !important;
    border: 1px solid #eaecf0 !important;
    background: #f2f4f7 !important;
}

body .tripmems-tour-app .tripmems-carousel-viewport {
    width: 100% !important;
    overflow: hidden !important;
    touch-action: pan-y !important;
}

body .tripmems-tour-app .tripmems-carousel-track {
    display: flex !important;
    width: 100% !important;
    transform: translateX(0);
    transition: transform 260ms ease;
    will-change: transform;
}

body .tripmems-tour-app .tripmems-media-slide {
    display: flex !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex-direction: column !important;
    background: #ffffff !important;
}

body .tripmems-tour-app .tripmems-media-slide:not(.is-current) {
    visibility: visible !important;
}

body .tripmems-tour-app .tripmems-media-text-panel {
    display: flex !important;
    align-items: center !important;
    min-height: 320px !important;
    height: clamp(240px, 72vw, 520px) !important;
    padding: 24px !important;
    background: linear-gradient(135deg, #f9fafb, #eef4ff) !important;
    color: #101828 !important;
}

body .tripmems-tour-app .tripmems-media-text-panel p {
    margin: 0 !important;
    font-size: 19px !important;
    line-height: 1.45 !important;
    font-weight: 750 !important;
}

body .tripmems-tour-app .tripmems-media-caption {
    min-height: 64px !important;
    padding: 12px 14px !important;
    background: #ffffff !important;
    color: #344054 !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
}

body .tripmems-tour-app .tripmems-carousel-control {
    position: absolute !important;
    top: calc(50% - 38px) !important;
    z-index: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border: 1px solid rgba(16, 24, 40, 0.12) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: #101828 !important;
    font-size: 31px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.18) !important;
    cursor: pointer !important;
}

body .tripmems-tour-app .tripmems-carousel-prev {
    left: 10px !important;
}

body .tripmems-tour-app .tripmems-carousel-next {
    right: 10px !important;
}

body .tripmems-tour-app .tripmems-carousel-dots {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 10px 12px 4px !important;
    background: #ffffff !important;
}

body .tripmems-tour-app .tripmems-carousel-dot {
    display: block !important;
    width: 9px !important;
    height: 9px !important;
    min-width: 9px !important;
    min-height: 9px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #d0d5dd !important;
    cursor: pointer !important;
}

body .tripmems-tour-app .tripmems-carousel-dot.is-current {
    width: 22px !important;
    background: #2f5d50 !important;
}

body .tripmems-tour-app .tripmems-carousel-hint {
    padding: 6px 14px 10px !important;
    border-top: 0 !important;
    background: #ffffff !important;
    color: #667085 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-align: center !important;
}

@media (max-width: 700px) {
    body .tripmems-tour-app .tripmems-carousel-control {
        width: 36px !important;
        height: 36px !important;
        font-size: 28px !important;
    }

    body .tripmems-tour-app .tripmems-carousel-prev {
        left: 8px !important;
    }

    body .tripmems-tour-app .tripmems-carousel-next {
        right: 8px !important;
    }

    body .tripmems-tour-app .tripmems-media-text-panel {
        height: calc((100vw - 32px) * 0.72) !important;
        min-height: 235px !important;
        max-height: 315px !important;
        padding: 18px !important;
    }

    body .tripmems-tour-app .tripmems-media-text-panel p {
        font-size: 17px !important;
        line-height: 1.42 !important;
    }

    body .tripmems-tour-app .tripmems-media-caption {
        min-height: 58px !important;
        font-size: 14px !important;
    }
}


/* Step 4: GPS/manual active-site control. A closer site is only a candidate until the visitor taps Go. */
body .tripmems-tour-app .tripmems-gps-box.tripmems-tour-nav-header.has-closer-site {
    border-color: #1570ef !important;
}

body .tripmems-tour-app .tripmems-closer-site-alert {
    align-items: center !important;
    border-color: #1570ef !important;
    background: #eff8ff !important;
    color: #1849a9 !important;
}

body .tripmems-tour-app .tripmems-closer-site-help {
    display: block !important;
    margin-top: 3px !important;
    color: #475467 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
}

body .tripmems-tour-app .tripmems-closer-site-alert button {
    white-space: nowrap !important;
    min-width: 58px !important;
}

@media (max-width: 430px) {
    body .tripmems-tour-app .tripmems-closer-site-alert {
        gap: 8px !important;
        padding: 9px 10px !important;
        font-size: 13px !important;
    }

    body .tripmems-tour-app .tripmems-closer-site-alert button {
        padding: 8px 13px !important;
        font-size: 13px !important;
    }
}

/* Step 6A: GPS refresh tuning. */
.tripmems-gps-last-updated {
    margin: 3px 0 0 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    color: #667085 !important;
}

.tripmems-gps-last-updated[hidden] {
    display: none !important;
}

.tripmems-gps-button-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    align-items: stretch !important;
}

.tripmems-gps-refresh-button {
    min-width: 86px !important;
    padding: 8px 10px !important;
    border: 1px solid #98a2b3 !important;
    border-radius: 11px !important;
    background: #ffffff !important;
    color: #344054 !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    cursor: pointer !important;
}

.tripmems-gps-refresh-button[hidden] {
    display: none !important;
}

@media (max-width: 700px) {
    .tripmems-gps-button-group {
        gap: 4px !important;
    }

    .tripmems-gps-refresh-button {
        min-width: 74px !important;
        padding: 7px 8px !important;
        font-size: 11px !important;
    }
}


/* Step 7I: keep the expandable commentary visually connected to the media carousel. */
body .tripmems-tour-app .tripmems-site-media-carousel + .tripmems-story-shell {
    margin-top: 8px;
}

body .tripmems-tour-app .tripmems-story-shell + .tripmems-audio-card {
    margin-top: 14px;
}

/* Step 8D: keep public carousel image frame matched to the admin crop/edit frame.
   Admin crop preview is 4:3, so the visitor-facing carousel image area should also be 4:3.
   This prevents crops that look correct in admin from shifting in the tour UX. */
body .tripmems-tour-app .tripmems-site-media-carousel figure.tripmems-stop-image-wrap,
body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-stop-image-wrap.tripmems-media-image-wrap,
body .tripmems-tour-app .tripmems-active-site-card .tripmems-site-media-carousel figure.tripmems-stop-image-wrap,
body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-media-carousel figure.tripmems-stop-image-wrap,
body .tripmems-tour-app .tripmems-site-detail .tripmems-site-media-carousel figure.tripmems-stop-image-wrap,
body .tripmems-tour-app .tripmems-media-placeholder {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 4 / 3 !important;
}

body .tripmems-tour-app .tripmems-site-media-carousel img.tripmems-stop-image,
body .tripmems-tour-app .tripmems-active-site-card .tripmems-site-media-carousel img.tripmems-stop-image,
body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-media-carousel img.tripmems-stop-image,
body .tripmems-tour-app .tripmems-site-detail .tripmems-site-media-carousel img.tripmems-stop-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Step 8E: desktop carousel ratio correction.
   The mobile frame was already correct. On desktop, older height rules could still force
   the carousel image into a wide/short frame. This desktop override keeps the public
   carousel image frame matched to the 4:3 admin crop frame. */
@media (min-width: 701px) {
    body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-carousel-viewport,
    body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-carousel-track,
    body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-media-slide,
    body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-media-slide.is-current {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-media-slide > figure.tripmems-stop-image-wrap.tripmems-media-image-wrap,
    body .tripmems-tour-app .tripmems-active-site-card .tripmems-site-media-carousel .tripmems-media-slide > figure.tripmems-stop-image-wrap.tripmems-media-image-wrap,
    body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-media-carousel .tripmems-media-slide > figure.tripmems-stop-image-wrap.tripmems-media-image-wrap,
    body .tripmems-tour-app .tripmems-site-detail .tripmems-site-media-carousel .tripmems-media-slide > figure.tripmems-stop-image-wrap.tripmems-media-image-wrap,
    body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-media-placeholder {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: calc(min(100vw - 64px, 980px) * 0.75) !important;
        min-height: 360px !important;
        max-height: 735px !important;
        aspect-ratio: 4 / 3 !important;
        overflow: hidden !important;
    }

    body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-media-slide > figure.tripmems-stop-image-wrap.tripmems-media-image-wrap > img.tripmems-stop-image,
    body .tripmems-tour-app .tripmems-active-site-card .tripmems-site-media-carousel .tripmems-media-slide > figure.tripmems-stop-image-wrap.tripmems-media-image-wrap > img.tripmems-stop-image,
    body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-media-carousel .tripmems-media-slide > figure.tripmems-stop-image-wrap.tripmems-media-image-wrap > img.tripmems-stop-image,
    body .tripmems-tour-app .tripmems-site-detail .tripmems-site-media-carousel .tripmems-media-slide > figure.tripmems-stop-image-wrap.tripmems-media-image-wrap > img.tripmems-stop-image {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        object-fit: cover !important;
    }
}

/* Step 8F: robust 4:3 carousel frame for desktop and mobile.
   The earlier desktop height used unsupported CSS math in some browsers.
   This padding-ratio method forces the public carousel image frame to match the admin crop frame. */
body .tripmems-tour-app .tripmems-site-media-carousel figure.tripmems-stop-image-wrap.tripmems-media-image-wrap,
body .tripmems-tour-app .tripmems-active-site-card .tripmems-site-media-carousel figure.tripmems-stop-image-wrap.tripmems-media-image-wrap,
body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-media-carousel figure.tripmems-stop-image-wrap.tripmems-media-image-wrap,
body .tripmems-tour-app .tripmems-site-detail .tripmems-site-media-carousel figure.tripmems-stop-image-wrap.tripmems-media-image-wrap {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-top: 75% !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #f0f0f0 !important;
    aspect-ratio: auto !important;
}

body .tripmems-tour-app .tripmems-site-media-carousel figure.tripmems-stop-image-wrap.tripmems-media-image-wrap > img.tripmems-stop-image,
body .tripmems-tour-app .tripmems-active-site-card .tripmems-site-media-carousel figure.tripmems-stop-image-wrap.tripmems-media-image-wrap > img.tripmems-stop-image,
body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-media-carousel figure.tripmems-stop-image-wrap.tripmems-media-image-wrap > img.tripmems-stop-image,
body .tripmems-tour-app .tripmems-site-detail .tripmems-site-media-carousel figure.tripmems-stop-image-wrap.tripmems-media-image-wrap > img.tripmems-stop-image {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
}

body .tripmems-tour-app .tripmems-site-media-carousel .tripmems-media-placeholder,
body .tripmems-tour-app .tripmems-active-site-card .tripmems-site-media-carousel .tripmems-media-placeholder,
body .tripmems-tour-app .tripmems-list-expanded-panel .tripmems-site-media-carousel .tripmems-media-placeholder,
body .tripmems-tour-app .tripmems-site-detail .tripmems-site-media-carousel .tripmems-media-placeholder {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
}

/* Step 9A: dedicated teaser/full-story display. */
body .tripmems-tour-app .tripmems-story-shell.is-collapsed .tripmems-site-story-preview {
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 2px !important;
}

body .tripmems-tour-app .tripmems-story-shell.is-collapsed .tripmems-site-story-preview::after {
    display: none !important;
}

body .tripmems-tour-app .tripmems-story-shell.is-collapsed .tripmems-site-story-full {
    display: none !important;
}

body .tripmems-tour-app .tripmems-story-shell.is-open .tripmems-site-story-preview {
    display: none !important;
}

body .tripmems-tour-app .tripmems-story-shell.is-open .tripmems-site-story-full {
    display: block !important;
}


/* Step 9D: preserve paragraph spacing from the visual full-story editor. */
body .tripmems-tour-app .tripmems-story-shell .tripmems-site-story-full p {
    margin: 0 0 1em !important;
}

body .tripmems-tour-app .tripmems-story-shell .tripmems-site-story-full p:last-child {
    margin-bottom: 0 !important;
}

body .tripmems-tour-app .tripmems-story-shell .tripmems-site-story-full ul,
body .tripmems-tour-app .tripmems-story-shell .tripmems-site-story-full ol {
    margin: 0.75em 0 1em 1.4em !important;
    padding-left: 1.2em !important;
}

body .tripmems-tour-app .tripmems-story-shell .tripmems-site-story-full li {
    margin: 0.35em 0 !important;
}

/* Step 10A: make the tour page behave like a dedicated app shell, not a normal WordPress page. */
body:has(.tripmems-tour-app) {
    background: #ffffff;
}

body:has(.tripmems-tour-app) header,
body:has(.tripmems-tour-app) footer,
body:has(.tripmems-tour-app) .wp-block-template-part,
body:has(.tripmems-tour-app) .wp-site-blocks > header,
body:has(.tripmems-tour-app) .wp-site-blocks > footer,
body:has(.tripmems-tour-app) .site-header,
body:has(.tripmems-tour-app) .site-footer,
body:has(.tripmems-tour-app) #site-header,
body:has(.tripmems-tour-app) #site-footer,
body:has(.tripmems-tour-app) .wp-block-navigation,
body:has(.tripmems-tour-app) .wp-block-site-title,
body:has(.tripmems-tour-app) .wp-block-site-logo {
    display: none !important;
}

body:has(.tripmems-tour-app) .wp-block-post-title,
body:has(.tripmems-tour-app) .entry-title,
body:has(.tripmems-tour-app) .page-title,
body:has(.tripmems-tour-app) main > h1:first-child,
body:has(.tripmems-tour-app) .wp-site-blocks main h1:first-child {
    display: none !important;
}

body:has(.tripmems-tour-app) .wp-site-blocks,
body:has(.tripmems-tour-app) main,
body:has(.tripmems-tour-app) .wp-block-group,
body:has(.tripmems-tour-app) .entry-content,
body:has(.tripmems-tour-app) .wp-block-post-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body:has(.tripmems-tour-app) .entry-content,
body:has(.tripmems-tour-app) .wp-block-post-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body:has(.tripmems-tour-app) .wp-site-blocks {
    min-height: 100vh;
}

body:has(.tripmems-tour-app) .tripmems-offline-status {
    margin-top: 10px;
}

body:has(.tripmems-tour-app) .tripmems-tour-app {
    padding: 0 12px 28px;
}

@media (max-width: 700px) {
    body:has(.tripmems-tour-app) .tripmems-tour-app {
        padding-left: 8px;
        padding-right: 8px;
    }

    body:has(.tripmems-tour-app) .tripmems-offline-status {
        margin-left: 8px;
        margin-right: 8px;
    }
}


/* Step 10B: compact tour app status/navigation header. */
body:has(.tripmems-tour-app) .tripmems-offline-status {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    max-width: calc(100% - 24px) !important;
    min-height: 0 !important;
    padding: 6px 11px !important;
    margin: 8px auto 8px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    color: #7a4b00 !important;
    background: #fff8ea !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-app {
    padding-top: 0 !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-header {
    padding: 8px 10px !important;
    margin-bottom: 10px !important;
    border-radius: 14px !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08) !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-main {
    align-items: center !important;
    gap: 8px !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-label {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-active-line {
    font-size: 14px !important;
    line-height: 1.25 !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-status {
    margin: 2px 0 0 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-status:empty {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-last-updated {
    margin-top: 2px !important;
    font-size: 11px !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-controls {
    gap: 8px !important;
}

body:has(.tripmems-tour-app) .tripmems-nav-compass-block {
    width: auto !important;
    min-width: 82px !important;
}

body:has(.tripmems-tour-app) .tripmems-compass-placeholder {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-nearest-distance {
    font-size: 12px !important;
    line-height: 1.2 !important;
    margin: 0 0 3px !important;
    white-space: nowrap !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-badge {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 0 !important;
    padding: 3px 7px !important;
    border-radius: 999px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-button-group {
    gap: 5px !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-button,
body:has(.tripmems-tour-app) .tripmems-gps-refresh-button {
    min-height: 34px !important;
    min-width: 0 !important;
    padding: 7px 10px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
}

body:has(.tripmems-tour-app) .tripmems-closer-site-alert {
    margin-top: 8px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
}

body:has(.tripmems-tour-app) #tripmems-gps-results:empty {
    display: none !important;
}

@media (max-width: 700px) {
    body:has(.tripmems-tour-app) .tripmems-offline-status {
        margin-left: 8px !important;
        margin-right: 8px !important;
    }

    body:has(.tripmems-tour-app) .tripmems-tour-nav-header {
        padding: 8px !important;
        margin-bottom: 8px !important;
    }

    body:has(.tripmems-tour-app) .tripmems-tour-nav-controls {
        align-items: flex-end !important;
    }

    body:has(.tripmems-tour-app) .tripmems-nearest-distance {
        font-size: 11px !important;
    }

    body:has(.tripmems-tour-app) .tripmems-gps-button,
    body:has(.tripmems-tour-app) .tripmems-gps-refresh-button {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }
}


/* Step 10C: acknowledged offline status and minimal GPS header. */
body:has(.tripmems-tour-app) .tripmems-offline-status {
    gap: 8px !important;
    margin-bottom: 6px !important;
}

body:has(.tripmems-tour-app) .tripmems-offline-status.is-ready:not(.is-acknowledged) {
    color: #067647 !important;
    background: #ecfdf3 !important;
    border-color: #abefc6 !important;
}

body:has(.tripmems-tour-app) .tripmems-offline-status.is-acknowledged {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    justify-content: center !important;
    padding: 0 !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    border-radius: 999px !important;
    color: #067647 !important;
    background: #ecfdf3 !important;
    border-color: #abefc6 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

body:has(.tripmems-tour-app) .tripmems-offline-ack {
    border: 0 !important;
    border-radius: 999px !important;
    padding: 4px 9px !important;
    background: #067647 !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
}

body:has(.tripmems-tour-app) .tripmems-offline-status.is-error {
    color: #b42318 !important;
    background: #fef3f2 !important;
    border-color: #fecdca !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-header {
    padding: 7px 9px !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-copy {
    min-width: 0 !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-copy:has(.tripmems-gps-status:empty) .tripmems-gps-last-updated[hidden] {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-copy:has(.tripmems-gps-status:empty) {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-active-line,
body:has(.tripmems-tour-app) .tripmems-tour-nav-label {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-status {
    color: #344054 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-last-updated {
    color: #667085 !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

body:has(.tripmems-tour-app) .tripmems-nav-compass-block .tripmems-nearest-distance {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-controls {
    margin-left: auto !important;
}

@media (max-width: 700px) {
    body:has(.tripmems-tour-app) .tripmems-tour-nav-main {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    body:has(.tripmems-tour-app) .tripmems-tour-nav-copy {
        flex: 1 1 auto !important;
    }

    body:has(.tripmems-tour-app) .tripmems-tour-nav-controls {
        flex: 0 0 auto !important;
    }
}


/* Step 10D: restore compact compass, keep GPS text from duplicating, and support offline acknowledgement. */
body:has(.tripmems-tour-app) .tripmems-tour-nav-copy {
    flex: 0 1 auto !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-main {
    justify-content: flex-end !important;
}

body:has(.tripmems-tour-app) .tripmems-compass-placeholder {
    display: block !important;
    width: 46px !important;
    margin: 0 auto 3px !important;
}

body:has(.tripmems-tour-app) .tripmems-compass-face {
    width: 42px !important;
    height: 42px !important;
    border-width: 3px !important;
}

body:has(.tripmems-tour-app) .tripmems-compass-arrow {
    border-left-width: 5px !important;
    border-right-width: 5px !important;
    border-bottom-width: 18px !important;
}

body:has(.tripmems-tour-app) .tripmems-compass-centre {
    width: 7px !important;
    height: 7px !important;
}

body:has(.tripmems-tour-app) .tripmems-compass-north {
    font-size: 9px !important;
}

body:has(.tripmems-tour-app) .tripmems-compass-unavailable-slash {
    height: 42px !important;
}

body:has(.tripmems-tour-app) .tripmems-nav-compass-block {
    min-width: 64px !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-status:empty {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-status:not(:empty) {
    display: block !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-last-updated {
    color: #667085 !important;
}

@media (max-width: 700px) {
    body:has(.tripmems-tour-app) .tripmems-tour-nav-main {
        gap: 6px !important;
    }

    body:has(.tripmems-tour-app) .tripmems-tour-nav-controls {
        gap: 6px !important;
    }

    body:has(.tripmems-tour-app) .tripmems-nav-compass-block {
        min-width: 58px !important;
    }
}

/* Step 10E: Tour loaded acknowledgement modal and minimal header cleanup. */
body:has(.tripmems-tour-app) .tripmems-offline-status.tripmems-tour-loaded-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 22px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(16, 24, 40, 0.48) !important;
    color: #101828 !important;
    box-shadow: none !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-loaded-card {
    width: min(360px, calc(100vw - 44px)) !important;
    padding: 22px 20px 18px !important;
    border: 1px solid #d0d5dd !important;
    border-radius: 22px !important;
    background: #fff !important;
    box-shadow: 0 20px 60px rgba(16, 24, 40, 0.28) !important;
    text-align: center !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-loaded-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    margin-bottom: 10px !important;
    border-radius: 999px !important;
    color: #067647 !important;
    background: #ecfdf3 !important;
    border: 1px solid #abefc6 !important;
    font-size: 24px !important;
    font-weight: 900 !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-loaded-card h2 {
    margin: 0 0 6px !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    color: #101828 !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-loaded-card p {
    margin: 0 0 16px !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
    color: #475467 !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-loaded-card .tripmems-offline-ack {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 88px !important;
    padding: 9px 18px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #101828 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
}

body:has(.tripmems-tour-app) .tripmems-offline-status.is-acknowledged:not(.tripmems-tour-loaded-modal) {
    position: fixed !important;
    top: 8px !important;
    left: 8px !important;
    z-index: 80 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    color: #067647 !important;
    background: #ecfdf3 !important;
    border: 1px solid #abefc6 !important;
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.12) !important;
    font-size: 15px !important;
    font-weight: 900 !important;
}

body:has(.tripmems-tour-app) .tripmems-gps-last-updated {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-copy:has(.tripmems-gps-status:empty) {
    display: none !important;
}

body:has(.tripmems-tour-app) .tripmems-tour-nav-main {
    justify-content: flex-end !important;
}

body:has(.tripmems-tour-app) .tripmems-compass-placeholder,
body:has(.tripmems-tour-app) .tripmems-compass-face {
    display: block !important;
}

/* Step 10F: center tour-loaded modal on mobile and keep acknowledgement check inside the tour header. */
#tripmems-gps-box.tripmems-tour-nav-header {
    position: relative !important;
}

#tripmems-offline-status.tripmems-tour-loaded-modal {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 999999 !important;
    display: grid !important;
    place-items: center !important;
    width: 100vw !important;
    max-width: none !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: auto !important;
    margin: 0 !important;
    padding: 20px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(16, 24, 40, 0.52) !important;
    color: #101828 !important;
    box-shadow: none !important;
    transform: none !important;
}

#tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-loaded-card {
    width: min(360px, calc(100vw - 40px)) !important;
    max-width: 360px !important;
    margin: 0 auto !important;
    padding: 22px 20px 18px !important;
    border: 1px solid #d0d5dd !important;
    border-radius: 22px !important;
    background: #fff !important;
    box-shadow: 0 20px 60px rgba(16, 24, 40, 0.28) !important;
    text-align: center !important;
}

#tripmems-gps-box.tripmems-tour-nav-header > #tripmems-offline-status.is-acknowledged:not(.tripmems-tour-loaded-modal) {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    z-index: 5 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    color: #067647 !important;
    background: #ecfdf3 !important;
    border: 1px solid #abefc6 !important;
    box-shadow: none !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
}

#tripmems-gps-box.tripmems-tour-nav-header > #tripmems-offline-status.is-acknowledged:not(.tripmems-tour-loaded-modal) .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 700px) {
    #tripmems-offline-status.tripmems-tour-loaded-modal {
        padding: 18px !important;
        align-items: center !important;
        justify-items: center !important;
    }

    #tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-loaded-card {
        width: min(340px, calc(100vw - 36px)) !important;
    }
}


/* Step 10G: Tour ready modal starts location or lets visitor continue manually. */
#tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-ready-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-top: 16px !important;
}

#tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-ready-start,
#tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-ready-not-now {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 10px 18px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
}

#tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-ready-start {
    border: 0 !important;
    background: #101828 !important;
    color: #fff !important;
}

#tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-ready-not-now {
    border: 1px solid #d0d5dd !important;
    background: #fff !important;
    color: #344054 !important;
}

#tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-offline-ack {
    display: none !important;
}

@media (max-width: 520px) {
    #tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-ready-actions {
        flex-direction: column !important;
    }

    #tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-ready-start,
    #tripmems-offline-status.tripmems-tour-loaded-modal .tripmems-tour-ready-not-now {
        width: 100% !important;
    }
}

/* Step 11B: static per-site map image, no live public map dependency. */
.tripmems-site-map-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.tripmems-site-map-button:hover,
.tripmems-site-map-button:focus {
    border-color: #98a2b3;
    background: #f9fafb;
}

.tripmems-static-map-overlay[hidden] {
    display: none !important;
}

.tripmems-static-map-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(16, 24, 40, 0.64);
}

.tripmems-static-map-card {
    width: min(760px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    padding: 14px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 72px rgba(16, 24, 40, 0.34);
    overflow: auto;
}

.tripmems-static-map-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.tripmems-static-map-card-header h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.tripmems-static-map-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #fff;
    color: #101828;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.tripmems-static-map-frame {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid #d0d5dd;
    border-radius: 16px;
    background: #eef2f6;
    overflow: hidden;
}

.tripmems-static-map-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tripmems-static-map-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .tripmems-static-map-overlay {
        align-items: center;
        padding: 12px;
    }

    .tripmems-static-map-card {
        width: calc(100vw - 20px);
        padding: 10px;
        border-radius: 18px;
    }

    .tripmems-static-map-card-header h3 {
        font-size: 16px;
    }
}

/* Step 11I: make saved static map overlay a true modal and keep it compact. */
.tripmems-static-map-overlay[hidden] {
    display: none !important;
}

.tripmems-static-map-overlay:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 18px !important;
    background: rgba(16, 24, 40, 0.68) !important;
    box-sizing: border-box !important;
}

.tripmems-static-map-card {
    width: min(620px, calc(100vw - 36px)) !important;
    max-width: 620px !important;
    max-height: calc(100vh - 36px) !important;
    max-height: calc(100dvh - 36px) !important;
    padding: 12px !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 24px 72px rgba(16, 24, 40, 0.38) !important;
    overflow: auto !important;
    box-sizing: border-box !important;
}

.tripmems-static-map-card-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-bottom: 10px !important;
}

.tripmems-static-map-card-header h3 {
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
}

.tripmems-static-map-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    border: 1px solid #d0d5dd !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #101828 !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

.tripmems-static-map-close:hover,
.tripmems-static-map-close:focus {
    border-color: #98a2b3 !important;
    background: #f9fafb !important;
    outline: 3px solid rgba(21, 112, 239, 0.18) !important;
}

.tripmems-static-map-frame {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    max-height: min(64vh, 520px) !important;
    max-height: min(64dvh, 520px) !important;
    border: 1px solid #d0d5dd !important;
    border-radius: 14px !important;
    background: #eef2f6 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.tripmems-static-map-frame img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
}

.tripmems-static-map-open,
.tripmems-static-map-open body {
    overflow: hidden !important;
}

@media (max-width: 600px) {
    .tripmems-static-map-overlay:not([hidden]) {
        padding: 12px !important;
        align-items: center !important;
    }

    .tripmems-static-map-card {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100dvh - 24px) !important;
        padding: 10px !important;
        border-radius: 16px !important;
    }

    .tripmems-static-map-card-header h3 {
        font-size: 16px !important;
    }

    .tripmems-static-map-close {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        font-size: 32px !important;
    }

    .tripmems-static-map-frame {
        max-height: 68dvh !important;
    }
}


/* Step 11J: mobile/reopen fix for saved static map modal. */
.tripmems-static-map-overlay:not([hidden]),
.tripmems-static-map-overlay.is-open {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 2147483000 !important;
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    min-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    height: 100vh !important;
    min-height: 100vh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)) 12px !important;
    margin: 0 !important;
    background: rgba(16, 24, 40, 0.72) !important;
    box-sizing: border-box !important;
}

.tripmems-static-map-card {
    position: relative !important;
    width: min(620px, calc(100vw - 24px)) !important;
    width: min(620px, calc(100dvw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-width: calc(100dvw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0 auto !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.tripmems-static-map-open,
.tripmems-static-map-open body,
body.tripmems-static-map-open-body {
    overflow: hidden !important;
    touch-action: none !important;
}

.tripmems-static-map-close {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    font-size: 34px !important;
}

@media (max-width: 600px) {
    .tripmems-static-map-overlay:not([hidden]),
    .tripmems-static-map-overlay.is-open {
        align-items: center !important;
        justify-items: center !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .tripmems-static-map-card {
        width: calc(100vw - 20px) !important;
        width: calc(100dvw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-width: calc(100dvw - 20px) !important;
        border-radius: 16px !important;
    }

    .tripmems-static-map-frame {
        max-height: 64vh !important;
        max-height: 64dvh !important;
    }
}
