/* Tour editor: 4-step layout. Scoped to .ttbm-tour-wizard.ttbm-wz-enabled (set by JS), so without JS the classic tabs still work. */
#ttbm_content.ttbm-tour-wizard:not(.ttbm-wz-enabled) .ttbm-wz-steps,
#ttbm_content.ttbm-tour-wizard:not(.ttbm-wz-enabled) .ttbm-wz-footer {
	display: none;
}

/* ---- Step bar ---- */
.ttbm-tour-wizard .ttbm-wz-steps {
	display: flex;
	align-items: stretch;
	gap: 0;
	padding: 22px 28px 18px;
	background: #fff;
	border-bottom: 1px solid #e5e9f0;
	border-radius: 12px 12px 0 0;
}
.ttbm-tour-wizard .ttbm-wz-step {
	position: relative;
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 12px 0 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	text-align: left;
	color: #8a94a6;
	font: inherit;
	min-width: 0;
}
.ttbm-tour-wizard .ttbm-wz-step:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 52px;
	right: 12px;
	top: 20px;
	height: 2px;
	background: #e2e8f0;
	z-index: 0;
	transition: background .25s ease;
}
.ttbm-tour-wizard .ttbm-wz-step.is-complete:not(:last-child)::after {
	background: var(--ttbm-ed-accent, #2271b1);
}
.ttbm-tour-wizard .ttbm-wz-step__dot {
	position: relative;
	z-index: 1;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e2e8f0;
	color: #64748b;
	font-size: 15px;
	transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.ttbm-tour-wizard .ttbm-wz-step__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	position: relative;
	z-index: 1;
	background: #fff;
	padding-right: 8px;
}
.ttbm-tour-wizard .ttbm-wz-step__label {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: #8a94a6 !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ttbm-tour-wizard .ttbm-wz-step__hint {
	font-size: 12px;
	color: #94a3b8 !important;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ttbm-tour-wizard .ttbm-wz-step:hover .ttbm-wz-step__dot {
	background: #d3e3f4;
	color: var(--ttbm-ed-accent, #2271b1);
}
.ttbm-tour-wizard .ttbm-wz-step.is-active .ttbm-wz-step__label,
.ttbm-tour-wizard .ttbm-wz-step.is-complete .ttbm-wz-step__label {
	color: #1d2b44 !important;
}
.ttbm-tour-wizard .ttbm-wz-step.is-active .ttbm-wz-step__dot,
.ttbm-tour-wizard .ttbm-wz-step.is-complete .ttbm-wz-step__dot {
	background: var(--ttbm-ed-accent, #2271b1);
	color: #fff;
}
.ttbm-tour-wizard .ttbm-wz-step.is-active .ttbm-wz-step__dot {
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--ttbm-ed-accent, rgb(34,113,177)) 16%, transparent);
}
.ttbm-tour-wizard .ttbm-wz-step,
.ttbm-tour-wizard .ttbm-wz-step:hover,
.ttbm-tour-wizard .ttbm-wz-step:focus,
.ttbm-tour-wizard .ttbm-wz-step:active {
	background: transparent !important;
	box-shadow: none;
	border: 0 !important;
	outline: 0;
}
.ttbm-tour-wizard .ttbm-wz-step:focus-visible {
	outline: 2px solid var(--ttbm-ed-accent, #2271b1);
	outline-offset: 4px;
	border-radius: 8px;
}

/* ---- Wizard mode: no left tab list; panes are shown by step, not by legacy .active ---- */
.ttbm-tour-wizard.ttbm-wz-enabled .tabLists.meta-sidebar {
	display: none !important;
}
body.ttbm-modern-edit-page #ttbm_meta_box_panel .ttbm-tour-wizard.ttbm-wz-enabled .ttbmTabs.leftTabs > .tabsContent > .tabsItem[data-tabs] {
	display: none !important;
}
body.ttbm-modern-edit-page #ttbm_meta_box_panel .ttbm-tour-wizard.ttbm-wz-enabled .ttbmTabs.leftTabs > .tabsContent > .tabsItem[data-tabs].ttbm-wz-show {
	display: block !important;
	content-visibility: visible !important;
}
/* Plain panes stacked in one step read as separate sections. */
.ttbm-tour-wizard.ttbm-wz-enabled .tabsContent > .tabsItem.ttbm-wz-show + .tabsItem.ttbm-wz-show:not(.ttbm-wz-acc-pane) {
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid #e5e9f0;
}
.ttbm-tour-wizard.ttbm-wz-enabled .ttbmTabs.leftTabs > .tabsContent {
	min-width: 0;
	overflow: visible; /* legacy overflow:auto would stop the footer sticking */
}

/* ---- Collapsible cards ---- */
.ttbm-tour-wizard .ttbm-wz-acc {
	display: none;
	margin: 0 0 10px;
}
.ttbm-tour-wizard .ttbm-wz-acc.is-shown {
	display: block;
}
.ttbm-tour-wizard .ttbm-wz-acc__head {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	margin: 0;
	background: #fff;
	border: 1px solid #dfe5ee;
	border-radius: 10px;
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: #1d2b44;
	text-align: left;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ttbm-tour-wizard .ttbm-wz-acc__head:hover,
.ttbm-tour-wizard .ttbm-wz-acc__head:focus {
	background: color-mix(in srgb, var(--ttbm-ed-accent, #2563eb) 5%, #fff) !important;
	color: #1d2b44 !important;
	border-color: var(--ttbm-ed-accent, #2271b1);
	box-shadow: 0 1px 6px color-mix(in srgb, var(--ttbm-ed-accent, rgb(34,113,177)) 12%, transparent);
	outline: 0;
}
.ttbm-tour-wizard .ttbm-wz-acc__head:focus-visible {
	outline: 2px solid var(--ttbm-ed-accent, #2271b1);
	outline-offset: 2px;
}
.ttbm-tour-wizard .ttbm-wz-acc__title,
.ttbm-tour-wizard .ttbm-wz-acc__head span {
	color: inherit !important;
}
.ttbm-tour-wizard .ttbm-wz-acc__icon {
	color: var(--ttbm-ed-accent, #2271b1) !important;
}
.ttbm-tour-wizard .ttbm-wz-acc__icon {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: color-mix(in srgb, var(--ttbm-ed-accent, #2563eb) 9%, #fff);
	color: var(--ttbm-ed-accent, #2271b1);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
}
.ttbm-tour-wizard .ttbm-wz-acc__title {
	flex: 1 1 auto;
}
.ttbm-tour-wizard .ttbm-wz-acc__chev {
	color: #94a3b8;
	transition: transform .2s ease;
}
.ttbm-tour-wizard .ttbm-wz-acc.is-open .ttbm-wz-acc__head {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	border-color: var(--ttbm-ed-accent, #2271b1);
	background: color-mix(in srgb, var(--ttbm-ed-accent, #2563eb) 5%, #fff);
}
.ttbm-tour-wizard .ttbm-wz-acc.is-open .ttbm-wz-acc__chev {
	transform: rotate(180deg);
	color: var(--ttbm-ed-accent, #2271b1);
}
/* The open card's body: attach to its header. The card title replaces the pane's own heading. */
.ttbm-tour-wizard.ttbm-wz-enabled .tabsContent > .ttbm-wz-acc-pane.ttbm-wz-show {
	margin: -10px 0 10px;
	padding: 22px 24px;
	background: #fff;
	border: 1px solid var(--ttbm-ed-accent, #2271b1);
	border-top: 0;
	border-radius: 0 0 10px 10px;
}
.ttbm-tour-wizard .ttbm-wz-acc-pane > h2:first-child {
	display: none;
}

/* ---- Footer ---- */
/* Pinned to the bottom of the viewport while the step is taller than the screen. */
#ttbm_meta_box_panel .ttbm-tour-wizard.ttbm-wz-enabled .ttbmTabs.leftTabs {
	overflow: visible; /* overflow:hidden would stop the footer sticking */
}
.ttbm-tour-wizard .ttbm-wz-footer {
	position: fixed;
	bottom: 0;
	left: 160px; /* admin menu */
	right: 0;
	z-index: 300;
	background: #fff;
	border-top: 1px solid #e2e8f0;
	padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 -2px 10px rgba(0, 0, 0, .05);
}
body.folded .ttbm-tour-wizard .ttbm-wz-footer { left: 36px; }
@media (max-width: 960px) { body.auto-fold .ttbm-tour-wizard .ttbm-wz-footer { left: 36px; } }
@media (max-width: 782px) { .ttbm-tour-wizard .ttbm-wz-footer { left: 0; } }
.ttbm-tour-wizard .ttbm-wz-footer__bar {
	position: absolute;
	top: -1px;
	left: 0;
	right: 0;
	height: 3px;
	background: #e2e8f0;
}
.ttbm-tour-wizard .ttbm-wz-footer__bar span {
	display: block;
	height: 100%;
	width: 25%;
	background: var(--ttbm-ed-accent, #2563eb);
	transition: width .25s ease;
}
.ttbm-tour-wizard .ttbm-wz-footer__inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 16px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
}
.ttbm-tour-wizard .ttbm-wz-footer__center {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-width: 0;
}
.ttbm-tour-wizard .ttbm-wz-step-num {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--ttbm-ed-accent, #2563eb);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}
.ttbm-tour-wizard .ttbm-wz-step-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.ttbm-tour-wizard .ttbm-wz-step-name {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	line-height: 1.2;
}
.ttbm-tour-wizard .ttbm-wz-footer .button {
	min-width: 96px;
	min-height: 38px;
	font-weight: 600;
	border-radius: 8px;
}
.ttbm-tour-wizard .ttbm-wz-footer .ttbm-wz-prev.is-hidden {
	visibility: hidden;
}
.ttbm-tour-wizard .ttbm-wz-progress {
	display: block;
	font-size: 12px;
	color: #94a3b8;
	font-weight: 400;
	line-height: 1.2;
}
/* Leave room so the fixed footer never covers the last fields. */
.ttbm-tour-wizard.ttbm-wz-enabled { padding-bottom: 90px; }

/* ---- Small screens: compact dots, label only for the active step ---- */
@media (max-width: 900px) {
	.ttbm-tour-wizard .ttbm-wz-steps {
		padding: 16px 14px 14px;
	}
	.ttbm-tour-wizard .ttbm-wz-step__hint {
		display: none;
	}
	.ttbm-tour-wizard .ttbm-wz-step__text {
		display: none;
	}
	.ttbm-tour-wizard .ttbm-wz-step.is-active {
		flex: 2 1 0;
	}
	.ttbm-tour-wizard .ttbm-wz-step.is-active .ttbm-wz-step__text {
		display: flex;
	}
	.ttbm-tour-wizard .ttbm-wz-step:not(:last-child)::after {
		left: 48px;
	}
}

/* On small screens core sets overflow-x:hidden on #post-body, which makes it a scroll container and breaks the sticky footer. clip hides overflow without that. */
body.ttbm-tour-edit-page div#post-body.metabox-holder {
	overflow-x: clip;
	overflow-y: visible;
}

/* ---- Step nav inside the page header (centre column, like the event editor) ---- */
/* Connected stepper: numbered dots joined by lines; done steps show a check. The dot's icon
   and the hint line are hidden here; the number comes from a CSS counter. */
#ttbm-admin-page-header .ttbm-wz-steps {
	grid-area: steps;
	justify-self: center;
	display: flex;
	align-items: center;
	gap: 32px;
	min-width: 0;
	max-width: 100%;
	padding: 0;
	margin: 0;
	background: none;
	border: 0;
	border-radius: 0;
	overflow-x: auto;
	scrollbar-width: none;
	counter-reset: ttbm-wz;
}
#ttbm-admin-page-header .ttbm-wz-steps::-webkit-scrollbar { display: none; }
#ttbm-admin-page-header .ttbm-wz-step {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	text-align: left;
	font: inherit;
	min-width: 0;
	color: #475569;
	counter-increment: ttbm-wz;
}
#ttbm-admin-page-header .ttbm-wz-step::after { display: none; }
/* Connector from the previous step: blue once this step is reached. */
#ttbm-admin-page-header .ttbm-wz-step + .ttbm-wz-step::before {
	content: "";
	position: absolute;
	left: -32px;
	top: 50%;
	width: 32px;
	height: 2px;
	margin-top: -1px;
	background: #cbd5e1;
}
#ttbm-admin-page-header .ttbm-wz-step.is-active::before,
#ttbm-admin-page-header .ttbm-wz-step.is-complete::before { background: var(--ttbm-ed-accent, #2563eb); }
#ttbm-admin-page-header .ttbm-wz-step:hover,
#ttbm-admin-page-header .ttbm-wz-step:focus { background: #f1f5f9; box-shadow: none; }
#ttbm-admin-page-header .ttbm-wz-step:focus-visible { outline: 2px solid var(--ttbm-ed-accent, #2563eb); outline-offset: 2px; }
#ttbm-admin-page-header .ttbm-wz-step__dot {
	flex: 0 0 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	box-sizing: border-box;
	border: 2px solid #cbd5e1;
	background: #fff;
	color: #475569;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}
#ttbm-admin-page-header .ttbm-wz-step__dot i { display: none; }
#ttbm-admin-page-header .ttbm-wz-step__dot::before { content: counter(ttbm-wz); }
#ttbm-admin-page-header .ttbm-wz-step:hover .ttbm-wz-step__dot {
	background: #fff;
	color: var(--ttbm-ed-accent, #2563eb);
	border-color: var(--ttbm-ed-accent, #2563eb);
}
#ttbm-admin-page-header .ttbm-wz-step.is-active .ttbm-wz-step__dot {
	background: #fff;
	border-color: var(--ttbm-ed-accent, #2563eb);
	color: var(--ttbm-ed-accent, #2563eb);
}
#ttbm-admin-page-header .ttbm-wz-step.is-complete .ttbm-wz-step__dot {
	background: var(--ttbm-ed-accent, #2563eb);
	border-color: var(--ttbm-ed-accent, #2563eb);
	color: #fff;
	font-size: 12px;
}
#ttbm-admin-page-header .ttbm-wz-step.is-complete .ttbm-wz-step__dot::before {
	content: "\f00c";
	font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", sans-serif;
	font-weight: 900;
}
#ttbm-admin-page-header .ttbm-wz-step__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: none;
	padding: 0;
}
#ttbm-admin-page-header .ttbm-wz-step__label {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	color: #475569 !important;
}
#ttbm-admin-page-header .ttbm-wz-step__hint { display: none; }
#ttbm-admin-page-header .ttbm-wz-step.is-active .ttbm-wz-step__label,
#ttbm-admin-page-header .ttbm-wz-step.is-complete .ttbm-wz-step__label {
	color: #1e293b !important;
}
@media (max-width: 1200px) {
	#ttbm-admin-page-header .ttbm-wz-steps { justify-self: stretch; justify-content: flex-start; }
}
@media (max-width: 600px) {
	#ttbm-admin-page-header .ttbm-wz-steps { gap: 16px; }
	#ttbm-admin-page-header .ttbm-wz-step + .ttbm-wz-step::before { left: -16px; width: 16px; }
	#ttbm-admin-page-header .ttbm-wz-step:not(.is-active) .ttbm-wz-step__text { display: none; }
}
