/* Prevent pull-to-refresh on mobile browsers */
html, body {
	overscroll-behavior-y: contain;
}

/* Flex row: [arrow][viewport][arrow] */
.tabs-strip-container
{
	display: flex;
	align-items: center;
	gap: .25rem;
}

/* Arrows: constant touch target (44x44), visually disabled when needed */
.tabs-scroll-btn
{
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bs-body-color);
	opacity: .9;
}

	.tabs-scroll-btn[disabled]
	{
		opacity: .35;
		pointer-events: none; /* disabled buttons should not intercept clicks */
	}

.flex-center
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.tabs-scroll-btn svg
{
	width: 20px;
	height: 20px;
	display: block;
}

/* Viewport fills the remaining space and scrolls horizontally */
.tabs-strip-container .tabs-scroll-viewport
{
	flex: 1 1 auto;
	overflow-x: auto;
	overflow-y: hidden;
	-ms-overflow-style: none; /* hide scrollbar (legacy) */
	scrollbar-width: none; /* Firefox */
	padding: 0.2em 0.2em 0 0.2em;
}

	.tabs-strip-container .tabs-scroll-viewport::-webkit-scrollbar
	{
		display: none;
	}

/* Tabs look */
.tabs-strip-container .nav-tabs
{
	white-space: nowrap;
	border-bottom: 1px solid var(--bs-border-color);
	gap: .25rem;
}

	.tabs-strip-container .nav-tabs .nav-link
	{
		display: block;
		border: 1px solid var(--bs-border-color);
		background-color: var(--bs-tertiary-bg, #f8f9fa);
		color: var(--bs-body-color);
		border-top-left-radius: .375rem;
		border-top-right-radius: .375rem;
		border-bottom: none;
		outline: none;
	}

		.tabs-strip-container .nav-tabs .nav-link:not(.active):hover
		{
			background-color: var(--bs-secondary-bg, #f1f3f5);
		}

		.tabs-strip-container .nav-tabs .nav-link.active
		{
			background-color: var(--bs-body-bg);
			border-color: var(--bs-border-color) var(--bs-border-color) transparent;
		}


.drag-handle
{
	touch-action: none;
	-ms-touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	cursor: grab;
}

	.drag-handle:active
	{
		cursor: grabbing;
	}

/* Optional ghost/chosen styles */
.sortable-ghost
{
	opacity: .85;
}

.sortable-chosen
{
	transform: scale(.98);
}

/* If you wrap lists in a scroll container later: */
/*.scroll-container
{
	overscroll-behavior: contain;
}*/

/* Prevent scroll chaining & enable momentum scrolling only where needed */
.tabs-strip-container .tabs-scroll-viewport,
.records-list
{
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* Reusable icon-only button (“ghost”): transparent background, solid icon */
.icon-btn
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px; /* Apple’s min touch target */
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent; /* stays nice in dark mode */
	color: var(--icon-color, var(--bs-body-color)); /* solid icon via currentColor */
	border-radius: .375rem;
	line-height: 1;
}

	/* Subtle hover/focus states that follow theme */
	.icon-btn:hover
	{
		background-color: var(--bs-tertiary-bg, rgba(0,0,0,.04));
	}

	.icon-btn:focus-visible
	{
		outline: 0;
		box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb, 13,110,253), .25);
	}

	/* Size SVGs nicely inside */
	.icon-btn svg
	{
		width: 18px;
		height: 18px;
		display: block;
	}

/* Colour variants (use Bootstrap variables) */
.icon-primary
{
	--icon-color: var(--bs-primary);
}

.icon-warning
{
	--icon-color: var(--bs-warning);
}

.icon-danger
{
	--icon-color: var(--bs-danger);
}

.icon-muted
{
	--icon-color: var(--bs-secondary-color);
}

/* Drag handle: solid icon, bigger hit area, touch-friendly */
.drag-handle
{
	/* icon-btn traits + handle-specific tweaks */
	width: 44px;
	height: 44px;
	color: var(--icon-color, var(--bs-secondary-color));
	cursor: grab;
	touch-action: none; /* critical for touch DnD */
	-ms-touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

	.drag-handle:active
	{
		cursor: grabbing;
	}

	.drag-handle:hover
	{
		background-color: var(--bs-tertiary-bg, rgba(0,0,0,.04));
	}

/* Keep your Sortable visuals */
.sortable-ghost
{
	opacity: .85;
}

.sortable-chosen
{
	transform: scale(.98);
}

.tabs-strip-container .tabs-scroll-viewport,
.records-list { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }


/* Right-side drawer */
.drawer
{
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: min(420px, 90vw);
	background: var(--bs-body-bg);
	border-left: 1px solid var(--bs-border-color);
	box-shadow: -8px 0 24px rgba(0,0,0,.08);
	transform: translateX(100%);
	transition: transform .22s ease-in-out;
	z-index: 1050;
	display: flex;
	flex-direction: column;
}

	.drawer.open
	{
		transform: translateX(0);
	}

.drawer-header
{
	padding: .75rem 1rem;
	border-bottom: 1px solid var(--bs-border-color);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.drawer-body
{
	padding: 1rem;
	overflow: auto;
	flex: 1 1 auto;
}

.drawer .list-group-item.disabled
{
	opacity: .5;
	cursor: not-allowed;
}

button:disabled
{
	cursor: not-allowed;
}

/* Move to Caz.Apps.Brand sometime*/
.form-check-input-secondary{
	--bs-form-check-bg: var(--bs-secondary-bg);
	--bs-form-check-border-color: var(--bs-secondary-color);
}

/* Loading progress text for startup messages */
.loading-progress-text {
	position: absolute;
	top: 60%;
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 14px;
	color: var(--bs-body-color, #333);
	display: none;
	max-width: 80%;
	padding: 0 20px;
}

#app {
	position: relative;
}

.duplicate-item
{
	background-color: lightyellow;
}

/* Reusable horizontal-scroll toolbar pattern (no visible scrollbar) */
.toolbar-scroll-container {
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-ms-overflow-style: none;
	width: 100%;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
}

.toolbar-scroll-container::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.toolbar-scroll-inner {
	display: inline-flex;
	width: max-content;
	min-width: max-content;
}

.toolbar-scroll-inner > * {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* Display container for showing connect records */
.display-container {
	padding: 0.5rem;
	width: 100%;
}

/* Horizontal rule segment divider for multi-line content */
.segment-divider {
	margin: 0.5rem 0;
	border: 0;
	border-top: 1px solid var(--bs-border-color, #dee2e6);
	opacity: 0.5;
}

/* QR code display: illustrative size for introduction/help pages */
.qr-intro {
	width: 30%;
	max-width: 150px;
	min-width: 100px;
	margin: 1rem auto;
	display: block;
}

/* QR code display: responsive full-display with max constraint for desktop */
.qr-display {
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
	display: block;
}

/* Ensure SVG QR codes scale responsively */
.qr-intro svg,
.qr-display svg {
	width: 100%;
	height: auto;
	display: block;
}
