* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: 0.01em;
    line-height: 1.375;
    font-weight: 400;
}

html {
	touch-action: manipulation;
	overscroll-behavior: none;
	height: 100%;
	overflow: hidden;
}

img {
	max-width: none;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	background: #181920;
	height: 100dvh;
	overflow: hidden;
	overscroll-behavior: none;
	color: #e4e4e7;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	opacity: 0;
}


body.ready {
	opacity: 1;
}

* {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	-moz-user-drag: none;
	-o-user-drag: none;
}

img {
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	-moz-user-drag: none;
	-o-user-drag: none;
	user-drag: none;
}

/* Allow clicks on specific clickable images */
img.profile-email-view,
button img,
.info-btn img {
	pointer-events: auto;
}

/* Allow text selection in inputs */
input, textarea {
	user-select: text;
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
}

/* Allow text selection for set titles in browse tab */
.set-title {
	user-select: text;
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
}

/* Allow text selection in card modal */
.card-modal-container,
.card-modal-container * {
	user-select: text;
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
}

/* Allow text selection in info popups (appended to body, outside modal) */
.info-popup .info-popup-text,
.sources-sub-popup a span {
	user-select: text;
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
}

/* Exclude buttons, arrows, and disclaimer from text selection in card modal */
.info-btn,
.info-btn *,
.modal-arrow,
.modal-arrow *,
.modal-disclaimer {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-touch-callout: none;
}

/* Make modal images draggable as images (not as text) */
.modal-current-image,
.card-modal-img {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-user-drag: auto;
	-khtml-user-drag: auto;
	-moz-user-drag: auto;
	-o-user-drag: auto;
}

/* Subscription edit icon */
.subscription-edit-icon {
	width: 14px;
	height: 14px;
	filter: invert(47%) sepia(77%) saturate(4434%) hue-rotate(335deg) brightness(101%) contrast(101%);
	align-self: center;
}

.topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 20px;
	background: #181920;
	z-index: 100;
}

.search-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: #1e1f28 !important;
	z-index: 9998;
	display: flex;
	align-items: center;
	padding: 0 20px 0 155px;
	gap: 15px;
}

.logo {
	position: fixed;
	left: 10px;
	top: 30px;
	transform: translateY(-50%);
	height: 48px;
	width: auto;
	cursor: pointer;
	z-index: 10016;
	display: block;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.capture-active.camera-live .logo,
.capture-active.camera-live .profile-pic,
.capture-active.camera-live #flashlightBtn {
	opacity: 0.75;
}

.capture-active .topbar {
	background: transparent;
	pointer-events: none;
}
.capture-active .topbar > * {
	pointer-events: auto;
}

@media (max-width: 768px) {
	.logo {
		height: 40px;
	}
}

.topbar-left {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	max-width: calc(100% - 40px);
	top: 50%;
	transform: translate(-50%, -50%);
}

.filter-btn {
	padding: 10px 16px;
	background: none;
	color: #e4e4e7;
	border: none;
	border-radius: 25px;
	cursor: pointer;
	font-size: 14px;
	white-space: nowrap;
	flex-shrink: 0;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.filter-btn img {
	width: 20px;
	height: 20px;
}

.search-icon-btn {
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.close-search-btn {
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.topbar-right {
	position: absolute;
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	gap: 10px;
	align-items: center;
}

.auth-btn {
	padding: 8px 16px;
	border: 1px solid rgba(228, 228, 231, 0.2);
	background: rgba(228, 228, 231, 0.05);
	color: #e4e4e7;
	border-radius: 20px;
	cursor: pointer;
	font-size: 14px;
}

.search-bar {
	width: 100%;
	max-width: 400px;
	min-width: 150px;
	padding: 10px 16px;
	border: none;
	border-radius: 25px;
	background: rgba(228, 228, 231, 0.05);
	color: #e4e4e7;
	font-size: 16px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	opacity: 0.5;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
	outline: none;
}

.search-bar:focus {
	opacity: 1;
}

.search-bar::placeholder {
	color: #71717a;
}


.tab-content {
	display: none;
	height: 100dvh;
	padding-top: 60px;
	padding-bottom: 55px;
}

.tab-content.active {
	display: block;
}

#captureTab {
	padding: 0;
	position: relative;
	overflow: hidden;
}

#video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

*::-webkit-media-controls,
*::-webkit-media-controls-panel,
*::-webkit-media-controls-overlay-play-button,
*::-webkit-media-controls-start-playback-button {
	display: none !important;
	-webkit-appearance: none;
	opacity: 0 !important;
}



.capture-controls {
	position: fixed;
	bottom: 100px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 20px;
	z-index: 50;
}

.capture-controls-left,
.capture-controls-right {
	width: 70px;
	height: 70px;
	position: relative;
}

.capture-controls-right .gallery-btn,
.capture-controls-right .cancel-btn {
	position: absolute;
	top: 0;
	left: 0;
}

.capture-btn {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	border: 3px solid white;
	background: transparent;
	cursor: pointer;
	opacity: 0.75;
	transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.capture-btn.active {
	opacity: 1;
}


.gallery-btn {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	border: none;
	background: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.75;
	transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.cancel-btn {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	border: none;
	background: none;
	color: white;
	font-size: 32px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	text-shadow: 0 0 3px rgba(0,0,0,0.25);
	opacity: 0.75;
	transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.scan-status {
	position: fixed;
	top: 65px;
	left: 50%;
	transform: translateX(-50%) translateY(-10px) scale(0.95);
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: white;
	padding: 12px 24px;
	border-radius: 25px;
	z-index: 50;
	font-weight: 500;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 10px;
}

.scan-status.visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0) scale(1);
}

.zoom-label {
	position: fixed;
	bottom: 185px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.5);
	color: #e4e4e7;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 14px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	font-weight: 500;
	pointer-events: none;
	z-index: 51;
}

.zoom-slider-container {
	position: fixed;
	bottom: 185px;
	left: 50%;
	transform: translateX(-50%);
	width: 200px;
	z-index: 51;
}

.zoom-slider {
	width: 100%;
	-webkit-appearance: none;
	appearance: none;
	height: 4px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
	outline: none;
	cursor: pointer;
}

.zoom-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	background: #e4e4e7;
	border-radius: 50%;
	cursor: pointer;
}

.zoom-slider::-moz-range-thumb {
	width: 18px;
	height: 18px;
	background: #e4e4e7;
	border-radius: 50%;
	cursor: pointer;
	border: none;
}

.camera-quality-status {
	position: fixed;
	bottom: 225px;
	left: 50%;
	transform: translateX(-50%) translateY(10px) scale(0.95);
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: white;
	padding: 10px 20px;
	border-radius: 25px;
	z-index: 51;
	font-size: 14px;
	font-weight: 500;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
	white-space: nowrap;
}

.camera-quality-status.visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0) scale(1);
}

.foil-reminder {
	position: fixed;
	top: 116px;
	left: 12px;
	right: 12px;
	color: rgba(255, 255, 255, 0.4);
	font-size: 12px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	text-align: center;
	pointer-events: none;
	z-index: 51;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.scan-status-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top: 2px solid white;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	flex-shrink: 0;
}


.camera-error {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 20px;
	pointer-events: none;
}

.camera-permission {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

.camera-permission-btn {
	padding: 12px 28px;
	background: rgba(228, 228, 231, 0.08);
	color: #e4e4e7;
	border: 1px solid rgba(228, 228, 231, 0.15);
	border-radius: 25px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	white-space: nowrap;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.camera-permission-error {
	color: #71717a;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.camera-error-message {
	color: #71717a;
	font-size: 14px;
	max-width: 260px;
}

.side-handle {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateX(0) translateY(-50%);
	width: 44px;
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10006;
	touch-action: none;
	opacity: 0.75;
	transition: transform 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
	will-change: transform;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

.side-handle.dragging {
	transition: none;
}

@media (max-width: 768px) {
	.side-handle.open {
		transform: translateX(calc(-100vw + 44px)) translateY(-50%);
	}
}

.side-handle-line {
	width: 4px;
	height: 52px;
	background: rgba(255, 255, 255, 0.75);
	border-radius: 2px;
	opacity: 0.75;
	transition: transform 0.125s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.side-handle.pressing .side-handle-line {
	transform: scaleY(0.88);
	opacity: 1;
	transition: transform 0.125s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.125s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.side-handle-badges {
	position: absolute;
	top: 18px;
	left: 50%;
	width: 0;
	height: 0;
	pointer-events: none;
}

.side-handle-badge {
	position: absolute;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 8px;
	font-weight: 600;
	color: #181920;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
	top: -7.5px;
	left: -7.5px;
	opacity: 0.75;
	transition: transform 0.125s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.125s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.side-handle-badge-success {
	z-index: 1;
}

.side-handle-badge-failed {
	background: #ef4444;
	color: white;
	z-index: 3;
}

.side-handle-badge-processing {
	background: #000;
	z-index: 2;
	color: white;
	overflow: visible;
}

.side-handle-badge-processing::before {
	content: '';
	position: absolute;
	inset: -2px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.15);
	border-top-color: white;
	animation: spin 0.75s linear infinite;
}

/* Used to force-restart the spinner's pseudo-element animation after a
   display:none toggle (iOS WebKit doesn't resume it otherwise). */
.side-handle-badge-processing.anim-restart::before {
	animation: none;
}

.side-handle-badge-spinner {
	display: none;
}

.side-menu {
	position: fixed;
	right: 0;
	top: 0;
	width: 75vw;
	height: 100vh;
	background: #1e1f28;
	transform: translateX(100%);
	transition: transform 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
	z-index: 10005;
	overflow-y: auto;
	padding: 40px 15px 80px 15px;
	will-change: transform;
}

.side-menu.open {
	transform: translateX(0);
}

.side-menu.dragging {
	transition: none;
}

@media (max-width: 768px) {
	.side-menu {
		width: 100vw;
		padding: 100px 20px 80px 64px;
	}
}

.side-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: black;
	opacity: 0;
	pointer-events: none;
	z-index: 150;
	transition: opacity 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
	will-change: opacity;
}

.side-overlay.show {
	opacity: 0.5;
	pointer-events: auto;
}

.side-overlay.dragging {
	transition: none;
}

#browseTab {
	overflow-y: scroll;
	overflow-x: hidden;
	padding: 15px 20px 20px 20px;
	position: fixed;
	top: 60px;
	bottom: 60px;
	left: 0;
	right: 0;
	height: auto;
	box-sizing: border-box;
}
#browseTab::-webkit-scrollbar-thumb { min-height: 60px; }
#collectionTab::-webkit-scrollbar-thumb { min-height: 60px; }

#browseTab::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: #1e1f28;
	z-index: 50;
}

#collectionTab {
	overflow-y: scroll;
	overflow-x: hidden;
	padding: 15px 20px 20px 20px;
	position: fixed;
	top: 60px;
	bottom: 60px;
	left: 0;
	right: 0;
	height: auto;
	box-sizing: border-box;
}

#collectionTab::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: #1e1f28;
	z-index: 50;
}

.cards-grid {
	display: flex;
	flex-direction: column;
	gap: 40px;
	width: 100%;
}

.collection-stats-title {
	opacity: 0.125;
	font-size: 36px;
	font-weight: 600;
}

.collection-stats-bar {
	display: flex;
	flex-direction: row;
	gap: 32px;
	padding: 14px 0 0;
}

.stat-row {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.stat-label {
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	color: #71717a;
}

.stats-value {
	font-size: 32px;
	font-weight: 600;
	color: #e4e4e7;
	font-variant-numeric: tabular-nums;
}

#lastScannedSection {
	margin-top: 80px;
}

.stats-price {
	font-size: 32px;
	font-weight: 600;
	color: #fbbf24;
	font-variant-numeric: tabular-nums;
}

.stats-price-row {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
}

.collection-currency-btn {
	background: rgba(228, 228, 231, 0.06);
	border: 1px solid rgba(228, 228, 231, 0.12);
	color: #a1a1aa;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.4px;
	padding: 4px 8px;
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: inherit;
	transition: background 0.15s, color 0.15s;
}

.collection-currency-btn:hover {
	background: rgba(228, 228, 231, 0.12);
	color: #e4e4e7;
}

.collection-currency-caret {
	font-size: 9px;
	opacity: 0.7;
}

#collectionSummary {
	margin-bottom: 80px;
}

.set-section {
	display: flex;
	flex-direction: column;
	gap: 15px;
	width: 100%;
}

.set-title {
	color: #e4e4e7;
	font-size: 20px;
	font-weight: 500;
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

#filterLabel {
	position: fixed;
	top: 66px;
	left: 10px;
	max-width: calc(100vw - 20px);
	background: #272833;
	color: #e4e4e7;
	font-size: 12px;
	padding: 6px 10px;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
	z-index: 99;
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
}

.set-owned-badge {
	display: inline-block;
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.45);
	font-size: 11px;
	font-weight: 600;
	padding: 2px 9px;
	border-radius: 9999px;
	margin-left: 8px;
	vertical-align: middle;
}

.set-progress {
	position: relative;
	height: 22px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 6px;
	margin: 6px 0 10px;
	overflow: hidden;
	max-width: 500px;
}
.set-progress-fill {
	position: absolute;
	top: 0; left: 0; bottom: 0;
	background: #DF3838;
	border-radius: 6px;
}
.set-progress-label {
	position: relative;
	z-index: 1;
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.9);
	line-height: 22px;
	padding-left: 10px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
}

.horizontal-scroll {
	display: flex;
	gap: 15px;
	overflow-x: auto;
	padding-bottom: 10px;
	flex-wrap: nowrap;
}

.set-carousel {
	position: relative;
	width: 100%;
}

.set-carousel-vp {
	overflow: hidden;
	width: calc(100% + 8px);
	margin: -4px;
	padding: 4px;
	position: relative;
}

.set-carousel-track {
	display: flex;
	gap: 15px;
	align-items: start;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.set-carousel-page {
	display: grid;
	grid-template-rows: auto auto;
	grid-auto-flow: column;
	gap: 15px;
	flex-shrink: 0;
	align-content: start;
}

.carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	background: rgba(24, 25, 32, 0.82);
	border: 1px solid rgba(228, 228, 231, 0.15);
	border-radius: 50%;
	width: 30px;
	height: 30px;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s;
}


.carousel-arrow-l { left: 6px; }
.carousel-arrow-r { right: 6px; }


.card-item {
	background: #272833;
	border-radius: 6px;
	padding: 15px;
	aspect-ratio: 2.5/3.5;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
	border: 1px solid rgba(228, 228, 231, 0.05);
	min-width: 140px;
	max-width: 140px;
	flex-shrink: 0;
}

.card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
}
/* Local-blob previews (processing/failed scan tiles) still use background-image. */
.card-item.has-image {
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}
.card-item.rotated-card-thumbnail .card-img { object-fit: contain; }
.card-global.has-image .card-img { mix-blend-mode: luminosity; }

.card-placeholder {
	background: #1e1f28 !important;
	border: none !important;
	cursor: default !important;
	display: flex;
	align-items: center;
	justify-content: center;
}
.card-placeholder .placeholder-q {
	font-size: 48px;
	font-weight: 700;
	color: rgba(228, 228, 231, 0.12);
	user-select: none;
}

.card-global {
	opacity: 0.375;
}
.card-global.has-image {
	background-color: #2a2a2a !important;
}
.card-global:not(.has-image) {
	background: #1e1f28 !important;
}

.card-item.failed {
	opacity: 0.75 !important;
	cursor: pointer !important;
	border: 2px solid #ef4444 !important;
}

.card-item.processing {
	opacity: 0.7 !important;
	cursor: default !important;
	pointer-events: none !important;
}

.card-item::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 80px;
	background: linear-gradient(to top, var(--rc, rgba(0,0,0,0.25)), transparent);
	pointer-events: none;
	z-index: 0;
	display: none;
}

.card-item.has-image::after {
	display: block;
}

.card-item.failed.has-image::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(239, 68, 68, 0.28);
	border-radius: 8px;
	pointer-events: none;
	z-index: 1;
}

.card-item.failed.interrupted {
	border: 2px solid #f59e0b !important;
}

.card-item.failed.interrupted.has-image::before {
	background: rgba(245, 158, 11, 0.28);
}

@keyframes interrupted-bounce {
	0%   { transform: translateY(0) scaleX(1.3) scaleY(0.7); animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0); }
	35%  { transform: translateY(-20px) scaleX(0.88) scaleY(1.12); animation-timing-function: cubic-bezier(0.34, 1, 0.66, 1); }
	65%  { transform: translateY(0) scaleX(1.3) scaleY(0.7); animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0); }
	82%  { transform: translateY(-7px) scaleX(0.94) scaleY(1.06); animation-timing-function: cubic-bezier(0.34, 1, 0.66, 1); }
	100% { transform: translateY(0) scaleX(1.3) scaleY(0.7); }
}

.interrupted-ball {
	position: absolute;
	bottom: 8px;
	right: 7px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #f59e0b;
	transform-origin: bottom center;
	animation: interrupted-bounce 1.1s infinite;
	pointer-events: none;
	z-index: 2;
}

.card-item.rotated-card-thumbnail {
	background-size: contain;
	transform: rotate(90deg);
}

.card-name {
	font-weight: 600;
	font-size: 15px;
	color: #e4e4e7;
	z-index: 1;
	text-align: center;
	margin-top: 8px;
	text-shadow: -1px -1px 0 rgba(0,0,0,0.25), 1px -1px 0 rgba(0,0,0,0.25), -1px 1px 0 rgba(0,0,0,0.25), 1px 1px 0 rgba(0,0,0,0.25);
}

.card-item.has-image .card-name {
	text-align: left;
	margin-top: auto;
	margin-bottom: 4px;
	padding-right: 50px;
}

.card-series {
	font-size: 12px;
	color: #a1a1aa;
	z-index: 1;
	text-align: center;
	margin-top: 4px;
}

.card-item.has-image .card-series {
	text-align: left;
	margin-top: 0;
	margin-bottom: 0;
}

.card-price {
	font-weight: 600;
	color: #fbbf24;
	z-index: 1;
	margin-top: auto;
	text-align: center;
	font-size: 16px;
	font-variant-numeric: tabular-nums;
}

.card-item.has-image .card-price {
	position: absolute;
	bottom: 15px;
	right: 15px;
	margin-top: 0;
}

.card-item.failed {
	opacity: 0.75 !important;
	cursor: pointer !important;
	border: 2px solid #ef4444 !important;
}

.card-item.processing {
	opacity: 0.7 !important;
	cursor: default !important;
	pointer-events: none !important;
}


.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(24, 25, 32, 0.5);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	display: flex;
	height: 60px;
	box-sizing: border-box;
	box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
	z-index: 100;
}

/* iPhone home-indicator (gesture bar): push bottom-anchored UI above it without touching the topbar */
html.ios-home-indicator .bottom-nav {
	height: calc(60px + 34px);
	padding-bottom: 34px;
}
html.ios-home-indicator #browseTab,
html.ios-home-indicator #collectionTab {
	bottom: calc(60px + 34px);
}
html.ios-home-indicator .capture-controls {
	bottom: calc(100px + 34px);
}
.nav-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	color: #71717a;
}

.nav-item.active {
	color: white;
}

.nav-icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.nav-label {
	font-size: 10px;
	margin-top: 2px;
}

.loading-spinner {
	position: fixed;
	bottom: 80px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 100;
	pointer-events: none;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(228, 228, 231, 0.1);
	border-top: 4px solid #DF3838;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@keyframes spinPulse {
	0%   { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
	50%  { transform: rotate(100deg); animation-timing-function: cubic-bezier(0.8, 0, 0.6, 1); }
	100% { transform: rotate(360deg); }
}

.modal-edge-tracer {
	position: fixed;
	top: -4px;
	left: -200px;
	width: 80px;
	height: 2px;
	background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
	offset-rotate: auto;
	offset-distance: 0%;
	animation: modalEdgeTrace 1.6s linear infinite;
	pointer-events: none;
	z-index: 10020;
}

@keyframes modalEdgeTrace {
	from { offset-distance: 0%; }
	to   { offset-distance: 100%; }
}

.card-modal-fade {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 10006;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.375s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.375s;
}

.card-modal-fade.show {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.375s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0s;
}

.card-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10007;
	overflow-y: auto;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(100vh);
	transition: transform 0.375s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.375s;
	user-select: auto;
	-webkit-user-select: auto;
}

.card-modal-overlay.show {
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition: transform 0.375s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0s;
}

.card-modal-container {
	width: 100%;
	max-width: 500px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
}

.card-modal-close-wrapper {
	position: sticky;
	top: 0;
	height: 0;
	width: 100%;
	z-index: 10007;
	pointer-events: none;
}

.card-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: rgba(0, 0, 0, 0.125);
	border: none;
	color: white;
	font-size: 28px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
	user-select: none;
	-webkit-user-select: none;
	pointer-events: auto;
}


.modal-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	width: 100%;
}

.modal-image-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.4);
	z-index: 2;
}

.card-modal-images {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.card-modal-img {
	width: 180px;
	height: 252px;
	border-radius: 15px;
	object-fit: cover;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.card-modal-info {
	display: flex;
	flex-direction: column;
	gap: 15px;
	min-width: 350px;
}

.card-modal-title {
	color: #e4e4e7;
	font-size: 24px;
	font-weight: 600;
	margin-bottom: 20px;
}

.card-modal-detail {
	color: #e4e4e7;
	margin-bottom: 12px;
	font-size: 15px;
	display: flex;
	flex-direction: column;
	gap: 5px;
}


.card-modal-value {
	color: #e4e4e7;
	font-weight: 500;
	font-size: 16px;
	word-wrap: break-word;
}

.card-modal-price {
	color: #fbbf24;
	font-size: 32px;
	font-weight: 600;
	margin: 20px 0;
}


.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: 10000;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.modal.show {
	display: flex;
}

.modal-content {
	background: #1e1f28;
	border-radius: 15px;
	padding: 25px;
	width: 320px;
	aspect-ratio: 2.5/3.5;
	position: relative;
	border: 1px solid rgba(228, 228, 231, 0.1);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
}

.modal-close {
	position: absolute;
	top: 30px;
	right: 20px;
	background: none;
	border: none;
	color: white;
	font-size: 28px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: opacity 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.modal-image-container {
	position: relative;
	width: 100%;
	max-width: 400px;
	height: 38vh;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.modal-image-mirror {
	flex: 1 1 0;
	min-width: 0;
	height: 100%;
	object-fit: cover;
	transform: scaleX(-1);
	filter: blur(4px) saturate(115%);
	clip-path: inset(0);
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}
/* Seam side stays fully opaque so the mirror meets the main image with no gap.
   Fade only on the outer edge (modal padding side) — that also clips the blur halo. */
.modal-image-mirror--left { object-position: 0 50%; }
.modal-image-mirror--right { object-position: 100% 50%; }

.modal-image-wrapper {
	flex: 0 1 auto;
	position: relative;
	height: 100%;
	max-width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-current-image {
	height: 100%;
	width: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

@media (min-width: 600px) {
	.modal-image-container {
		max-width: 380px;
		height: 42vh;
	}
}


.modal-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.125);
	border: none;
	color: white;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	opacity: 1;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.modal-arrow-left {
	left: -52px;
}

.modal-arrow-right {
	right: -52px;
}

.modal-collection-row {
	display: flex;
	justify-content: flex-end;
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
	padding: 8px 8px 0;
}

.modal-collection-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	opacity: 1;
	transition: opacity 0.15s;
}


.modal-collection-btn img {
	width: 22px;
	height: 22px;
	display: block;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

/* On small screens, make image edge-to-edge and move arrows inside */
@media (max-width: 768px) {
	.modal-image-container {
		max-width: 100%;
		height: 62.5vh;
	}

	.modal-image-wrapper {
		width: auto;
		border-radius: 0 !important;
		border-left: none !important;
		border-right: none !important;
	}

	.modal-arrow-left {
		left: 15px;
	}

	.modal-arrow-right {
		right: 15px;
	}
}

.modal-images {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-shrink: 0;
	height: calc(100vh - 60px - 40px);
	box-sizing: border-box;
}

.modal-image {
	width: 100%;
	height: calc((100% - 8px) / 2);
	border-radius: 4px;
	object-fit: cover;
}

.fullscreen-image-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.95);
	z-index: 10008;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s 0.3s, pointer-events 0s 0.3s;
}

.fullscreen-image-overlay.show {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s 0s, pointer-events 0s 0s;
}

.fullscreen-image-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	max-height: 100%;
}

.fullscreen-image-overlay img {
	height: 100vh;
	width: auto;
	max-width: 100vw;
	object-fit: contain;
	user-select: none;
	-webkit-user-select: none;
	-webkit-user-drag: auto;
	transition: opacity 0.2s ease;
}

.fullscreen-back-btn {
	position: absolute;
	top: 15px;
	right: 15px;
	background: rgba(0, 0, 0, 0.125);
	border: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10009;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.fullscreen-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.125);
	border: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10009;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.fullscreen-arrow-left {
	left: -52px;
}

.fullscreen-arrow-right {
	right: -52px;
}

@media (max-width: 768px) {
	.fullscreen-arrow-left {
		left: 15px;
	}
	.fullscreen-arrow-right {
		right: 15px;
	}
}

.fullscreen-edge-zone {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 80px;
	z-index: 10008;
}

.fullscreen-edge-left {
	left: 0;
}

.fullscreen-edge-right {
	right: 0;
}

@media (max-width: 768px) {
	.modal-images {
		height: calc(100vh - 60px - 40px);
	}
}

.info-btn {
	background: none;
	border: none;
	color: #a1a1aa;
	font-size: 16px;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
}


.info-popup {
	animation: popupSlideIn 0.2s ease;
}

@keyframes popupSlideIn {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.modal-title {
	color: #e4e4e7;
	font-size: clamp(20px, 4.5vw, 27px);
	font-weight: 600;
	margin-bottom: 15px;
}

.modal-genre {
	color: #a1a1aa;
	font-size: clamp(12px, 2.5vw, 14px);
	font-weight: 600;
	margin-top: -16px;
	margin-bottom: 15px;
	text-transform: capitalize;
}

.modal-genre:empty {
	display: none;
}

.modal-detail {
	color: #e4e4e7;
	margin-bottom: 10px;
	font-size: clamp(15px, 2.8125vw, 17px);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.modal-label {
	color: #a1a1aa;
	font-weight: 500;
	font-size: clamp(11px, 2.25vw, 14px);
	text-transform: uppercase;
	letter-spacing: 0.0625em;
}

.modal-label-key {
	color: #d99a5b;
}

.modal-value {
	color: #e4e4e7;
	font-weight: 500;
	font-size: clamp(15px, 2.8125vw, 18px);
}

.modal-description {
	color: #d4d4d8;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(228, 228, 231, 0.2);
	font-size: clamp(14px, 2.8125vw, 16px);
	line-height: 1.625;
}

.modal-disclaimer {
	color: #71717a;
	opacity: 0.5;
	font-size: 12px;
	margin-top: 20px;
	text-align: center;
}

.modal-price-big {
	color: #fbbf24;
	font-size: clamp(27px, 5.625vw, 36px);
	font-weight: 600;
	margin: 15px 0;
	font-variant-numeric: tabular-nums;
	/* Keep visual height/line consistent whether the content is a short "?" or a long price */
	min-height: 1.2em;
	line-height: 1.2;
}

.card-price.comp, .modal-price-big.comp {
	color: #fb923c;
}

.modal-comp-label {
	color: #fb923c;
	font-size: 12px;
	font-weight: 600;
	margin-top: -12px;
	margin-bottom: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.modal-info {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px;
	overflow-y: auto;
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
}

.legal-modal {
	display: flex;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0);
	z-index: 10025;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.375s cubic-bezier(0.4,0.0,0.2,1), visibility 0s 0.375s, background 0.375s cubic-bezier(0.4,0.0,0.2,1);
	pointer-events: none;
}
.legal-modal.show {
	opacity: 1;
	visibility: visible;
	background: rgba(0,0,0,0.85);
	transition: opacity 0.375s cubic-bezier(0.4,0.0,0.2,1), visibility 0s 0s, background 0.375s cubic-bezier(0.4,0.0,0.2,1);
	pointer-events: auto;
}
.legal-modal-content {
	background: #1e1f28;
	border-radius: 8px;
	width: 100%;
	max-width: 520px;
	max-height: 80vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	position: relative;
	transform: scale(0.95);
	transition: transform 0.375s cubic-bezier(0.4,0.0,0.2,1);
}
.legal-modal.show .legal-modal-content { transform: scale(1); }
.legal-modal-header {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: #1e1f28;

	border-radius: 8px 8px 0 0;
	z-index: 1;
}
.legal-modal-header-title { color: #e4e4e7; font-size: 16px; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell; }
.legal-modal-close {
	background: rgba(228,228,231,0.08);
	border: none;
	color: #e4e4e7;
	font-size: 22px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: opacity 0.2s;
}
.legal-modal-body { padding: 20px 24px 32px; }
.terms-updated { color: #52525b; font-size: 12px; margin: 0 0 20px; }
.terms-heading { color: #a1a1aa; font-size: 13px; font-weight: 500; margin: 16px 0 4px; }
.terms-p { color: #71717a; font-size: 13px; margin: 0; }

.auth-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: auto;
	/* SVG fallback: radial-gradient(ellipse at center, rgba(24,25,32,0.85) 0%, rgba(24,25,32,0) 70%), #181920 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='115'%3E%3Crect x='22' y='5' width='36' height='50' rx='5' ry='5' transform='rotate(-15 40 30)' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Crect x='-18' y='60' width='36' height='50' rx='5' ry='5' transform='rotate(-15 0 85)' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Crect x='62' y='60' width='36' height='50' rx='5' ry='5' transform='rotate(-15 80 85)' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E") repeat; background-size: auto, clamp(80px, 10vw, 160px) clamp(115px, 14.375vw, 230px); */
	background: transparent;
	z-index: 10020;
	align-items: stretch;
	justify-content: center;
}

.auth-modal.show {
	display: flex;
}

body:has(#authModal.show) #logo {
	opacity: 0;
	pointer-events: none;
}

#verifyCodeModal {
	z-index: 10011;
}
#verifyCodeModal .auth-modal-content {
	pointer-events: auto;
}

.auth-modal-content {
	background: transparent;
	pointer-events: none;
	width: 100%;
	height: 100%;
	max-width: 500px;
	border: none;
	box-sizing: border-box;
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 0 20px;
}
.auth-center-group,
.auth-bottom-group,
.auth-lang-row {
	pointer-events: auto;
}
.auth-title-area {
	position: absolute;
	top: min(37.5vh, calc(50vh - 150px));
	left: 20px;
	right: 20px;
	transform: translateY(-100%);
	text-align: center;
}
.auth-center-group {
	position: absolute;
	top: 50vh;
	left: 20px;
	right: 20px;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
}
.auth-bottom-group {
	position: absolute;
	bottom: max(12.5vh, 20px);
	left: 20px;
	right: 20px;
}

.auth-modal-title {
	color: #e4e4e7;
	font-size: 24px;
	font-weight: 600;
	margin: 0;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.auth-inputs {
	margin-bottom: 20px;
	width: 100%;
}

.auth-input {
	width: 100%;
	padding: 12px 18px;
	margin-bottom: 15px;
	border: 1px solid transparent;
	background: rgba(39, 40, 51, 0.5);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
	color: #DFDFDF;
	border-radius: 9999px;
	font-size: 16px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	filter: brightness(0.875);
	outline: none;
	transition: border-color 0.25s cubic-bezier(0.4,0.0,0.2,1),
	            color 0.25s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.5s cubic-bezier(0.4,0.0,0.2,1),
	            filter 0.5s cubic-bezier(0.4,0.0,0.2,1);
}

/* Press feedback (JS toggles .pressing on mousedown/touchstart, removes on release).
   Inputs use a subtle 1.025 scale — full-width fields look excessive with bigger pops. */
.auth-input.pressing {
	transform: scale(1.025);
	filter: none;
	transition: border-color 0.125s cubic-bezier(0.4,0.0,0.2,1),
	            color 0.125s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.125s cubic-bezier(0.4,0.0,0.2,1),
	            filter 0.125s cubic-bezier(0.4,0.0,0.2,1);
}


.otp-digit {
	width: 48px;
	height: 48px;
	text-align: center;
	font-size: 24px;
	font-weight: 600;
	color: #e4e4e7;
	background: #272833;
	border: none;
	border-radius: 6px;
	outline: none;
	caret-color: transparent;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}
.otp-digit:focus {
	outline: 2px solid white;
	outline-offset: 2px;
}
.otp-digit:disabled {
	opacity: 0.35;
	transition: opacity 0.2s;
}

.auth-input:focus {
	border-color: transparent;
	color: #DFDFDF;
	filter: none;
	outline: 2px solid #DF3838;
	outline-offset: 2px;
}

.auth-input::placeholder {
	color: #6F6F6F;
}
.auth-input:focus::placeholder {
	color: #A7A7A7;
}

.auth-submit {
	width: 100%;
	padding: 12px;
	background: #DF3838;
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 500;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	cursor: pointer;
	transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.auth-submit:disabled {
	filter: brightness(0.5);
	cursor: default;
	transition: filter 0.5s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.5s cubic-bezier(0.4,0.0,0.2,1);
}
/* Tapping the disabled button: scale up like normal + lift the dim by 12.5% (so it shows
   62.5% brightness instead of 50%). Still no opacity change, still solid. */
.auth-submit:disabled:active {
	filter: brightness(0.625);
	transition: filter 0.125s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.125s cubic-bezier(0.4,0.0,0.2,1);
}

.auth-lang-row {
	position: absolute;
	bottom: 4vh;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	align-items: center;
}
.auth-lang-row .lang-dropdown {
	width: auto;
}
.auth-lang-row .lang-dropdown-menu {
	width: 160px;
	left: 50%;
	/* Combine the horizontal centering with the vertical-scale appear animation —
	   CSS only allows one transform value per rule, so we have to declare both transforms
	   together at this specificity (otherwise the base rule's scaleY gets clobbered). */
	transform: translateX(-50%) scaleY(0.8);
}
.auth-lang-row .lang-dropdown-menu.show {
	transform: translateX(-50%) scaleY(1);
}
.auth-lang-row .lang-plain-btn {
	color: #DFDFDF;
}

.lang-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 15px 0;
}

.lang-field-label {
	color: #71717a;
	font-size: 12px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	font-weight: 500;
	text-transform: uppercase;
}

.lang-plain-btn {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	color: #e4e4e7;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	font-size: 14px;
	font-weight: 600;
}

.lang-btn-arrow {
	color: #71717a;
	font-size: 16px;
	display: inline-block;
	transition: transform 0.25s;
}

.lang-plain-btn.open .lang-btn-arrow {
	transform: rotate(180deg);
}

.lang-dropdown {
	position: relative;
	width: 160px;
}

.lang-dropdown-menu {
	display: flex;
	flex-direction: column;
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 8px;
	width: 100%;
	max-height: 200px;
	overflow-y: auto;
	scrollbar-width: none;
	background: rgba(24, 25, 32, 0.4);
	-webkit-backdrop-filter: blur(24px) saturate(160%);
	backdrop-filter: blur(24px) saturate(160%);
	border: none;
	border-radius: 24px;
	z-index: 10015;
	box-shadow: 0 10px 40px rgba(0,0,0,0.25);
	/* Smooth appear: vertically collapsed by default, expands downward from the button.
	   Using scaleY only (not full scale) so the animation matches the vertical orientation
	   of the language list inside — items stack vertically, the menu opens vertically. */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: scaleY(0.8);
	transform-origin: top center;
	transition: opacity 0.25s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.25s cubic-bezier(0.4,0.0,0.2,1),
	            visibility 0s 0.25s;
}
.lang-dropdown-menu::-webkit-scrollbar { display: none; }
.lang-dropdown-menu.show {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: scaleY(1);
	transition: opacity 0.25s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.25s cubic-bezier(0.4,0.0,0.2,1),
	            visibility 0s 0s;
}
/* When the menu opens upward, the scale should grow from the bottom edge instead of the top */
.lang-dropdown-menu.lang-dropdown-menu--up {
	top: auto;
	bottom: 100%;
	margin-top: 0;
	margin-bottom: 8px;
	transform-origin: bottom center;
}

.lang-dropdown-item {
	display: flex;
	align-items: center;
	height: 40px;
	padding: 0 16px;
	background: transparent;
	border: none;
	color: #e4e4e7;
	font-size: 14px;
	cursor: pointer;
	text-align: left;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	width: 100%;
	box-sizing: border-box;
	flex-shrink: 0;
}
.lang-dropdown-item--active { color: #fbbf24; }
.lang-dropdown-item--selected { background: rgba(228,228,231,0.2); }

.currency-dropdown {
    position: relative;
}
.currency-dropdown-btn {
    background: none;
    border: none;
    opacity: 0.25;
    cursor: pointer;
    color: #e4e4e7;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: opacity 0.15s;
}
.currency-dropdown-btn:hover { opacity: 0.5; }

.auth-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: rgba(0, 0, 0, 0.4);
	border: none;
	color: white;
	font-size: 24px;
	width: 35px;
	height: 35px;
	border-radius: 50%;
	cursor: pointer;
}

.profile-pic {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #5b5f7d;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 600;
	font-size: 18px;
	text-align: center;
	cursor: pointer;
	transition: box-shadow 0.3s ease, opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.profile-pic.dropdown-active {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.profile-dropdown {
	position: absolute;
	top: 60px;
	right: 20px;
	background: #1e1f28;
	border-radius: 10px;
	padding: 15px;
	min-width: 200px;
	border: 1px solid rgba(228, 228, 231, 0.1);
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: scale(0.95);
	transform-origin: top right;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), 
	            transform 0.2s cubic-bezier(0.4, 0.0, 0.2, 1),
	            visibility 0s 0.2s;
}

.profile-dropdown.show {
	opacity: 1;
	transform: scale(1);
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), 
	            transform 0.2s cubic-bezier(0.4, 0.0, 0.2, 1),
	            visibility 0s 0s;
}

.profile-email {
	color: #e4e4e7;
	font-size: 14px;
	margin-bottom: 15px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.profile-email-text {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.profile-email-view {
	width: 18px;
	height: 18px;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s;
	flex-shrink: 0;
	pointer-events: auto;
}


.profile-dropdown-divider {
	height: 1px;
	background: rgba(228, 228, 231, 0.1);
	margin: 12px 0;
}

.settings-btn {
	width: 100%;
	padding: 8px;
	background: #272833;
	color: #e4e4e7;
	border: none;
	border-radius: 6px 6px 0 0;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	margin-top: 20px;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.logout-btn {
	width: 100%;
	padding: 8px;
	background: rgba(239, 68, 68, 0.8);
	color: white;
	border: none;
	border-radius: 0 0 6px 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}



.settings-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #1e1f28;
	z-index: 10010;
	flex-direction: column;
}

.delete-account-btn {
	display: block;
	margin: 24px auto 60px;
	background: transparent;
	color: #ef4444;
	border: 1px solid rgba(239, 68, 68, 0.4);
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.delete-account-btn:hover { background: rgba(239, 68, 68, 0.08); }

.delete-account-modal {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	z-index: 10050;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.delete-account-modal.show { display: flex; }
.delete-account-card {
	background: #1e1f2a;
	color: #e4e4e7;
	border-radius: 12px;
	padding: 24px;
	max-width: 420px;
	width: 100%;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.delete-account-card h3 { margin: 0 0 12px; color: #ef4444; font-size: 18px; }
.delete-account-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #d4d4d8; }
.delete-account-card input {
	width: 100%;
	padding: 10px 12px;
	background: rgba(228, 228, 231, 0.06);
	border: 1px solid rgba(228, 228, 231, 0.15);
	border-radius: 8px;
	color: #e4e4e7;
	font-size: 14px;
	font-family: inherit;
	outline: none;
	box-sizing: border-box;
	margin-bottom: 16px;
}
.delete-account-actions { display: flex; gap: 10px; justify-content: flex-end; }
.delete-account-actions button {
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: none;
}
#deleteAccountCancel { background: rgba(228, 228, 231, 0.1); color: #e4e4e7; }
#deleteAccountConfirm { background: #ef4444; color: #fff; }
#deleteAccountConfirm:disabled { background: rgba(239, 68, 68, 0.3); cursor: not-allowed; }

.settings-modal, .settings-modal * {
	font-weight: 400;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.settings-modal.show {
	display: flex;
}

.settings-main-close {
	background: none;
	border: none;
	color: #e4e4e7;
	font-size: 32px;
	cursor: pointer;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	transition: background 0.2s;
	line-height: 1;
}


.settings-modal-title {
	color: #e4e4e7;
	font-size: 20px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.settings-header {
	padding: 0 20px;
	border-bottom: 1px solid rgba(228, 228, 231, 0.1);
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 16px;
	height: 60px;
	flex-shrink: 0;
}

.settings-content {
	flex: 1;
	padding: 30px 40px 40px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.settings-section {
	display: block;
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
}

.settings-section > * + *,
.settings-section + .settings-section {
	margin-top: 12px;
}

.settings-section > .lang-field {
	padding: 0;
}
.settings-section > .lang-field + .lang-field {
	margin-top: 12px;
}

/* Eraser (inline fix) mode */
.eraser-check {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 8px;
	vertical-align: middle;
	white-space: nowrap;
}
.eraser-circle {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid rgba(228, 228, 231, 0.45);
	background: transparent;
	cursor: pointer;
	box-sizing: border-box;
	transition: background 0.15s, border-color 0.15s;
}
.eraser-check.flagged .eraser-circle {
	background: #ef4444;
	border-color: #ef4444;
	position: relative;
}
.eraser-check.flagged .eraser-circle::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: 2px solid #fff;
	border-top: none;
	border-left: none;
	transform: rotate(45deg);
}
.eraser-arrow {
	display: none;
	background: rgba(228, 228, 231, 0.08);
	border: none;
	color: #e4e4e7;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	font-size: 14px;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	align-items: center;
	justify-content: center;
}
.eraser-check.flagged .eraser-arrow {
	display: inline-flex;
}
.eraser-check.forced .eraser-circle {
	opacity: 0.5;
	cursor: default;
}
.eraser-check.forced .eraser-arrow {
	display: none;
}
.eraser-arrow.has-note {
	background: #fff;
	color: #181920;
}
/* Placeholder rows shown in eraser mode for fields the card is missing — label dimmed via
   opacity (no children), value dimmed via color so the .eraser-check inside it stays sharp
   (CSS opacity stacks down and a child can't be more opaque than its parent). */
.eraser-missing .modal-label { opacity: 0.4; }
.eraser-missing .modal-value { color: rgba(228, 228, 231, 0.4); }
#eraserNotePopup {
	position: absolute;
	z-index: 10020;
	background: #1e1f2a;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 8px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
	width: min(260px, 80vw);
}
#eraserNotePopup input {
	width: 100%;
	padding: 8px 10px;
	background: rgba(228, 228, 231, 0.05);
	border: none;
	border-radius: 6px;
	color: #e4e4e7;
	font-size: 13px;
	font-family: inherit;
	outline: none;
	box-sizing: border-box;
}
#eraserImageOverlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 4;
	border-radius: inherit;
	transition: background 0.18s;
}
#eraserImageOverlay.selected {
	background: rgba(239, 68, 68, 0.55);
}
.eraser-image-label {
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-align: center;
	padding: 0 16px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
	pointer-events: none;
}
#eraserFloater {
	position: fixed;
	bottom: 80px;
	left: 50%;
	transform: translateX(-50%);
	background: #1e1f2a;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	padding: 8px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 10010;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
#eraserFloaterHint {
	position: fixed;
	bottom: 56px;
	left: 50%;
	transform: translateX(-50%);
	color: #a1a1aa;
	font-size: 12px;
	line-height: 1.3;
	text-align: center;
	max-width: 80vw;
	pointer-events: none;
	z-index: 10010;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
}
.eraser-floater-cancel,
.eraser-floater-send {
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	cursor: pointer;
	padding: 0;
}
.eraser-floater-cancel {
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.7);
	font-size: 16px;
}
.eraser-floater-send {
	background: #ef4444;
}

#collectionDeletePopup {
	position: fixed;
	bottom: 80px;
	left: 50%;
	transform: translateX(-50%);
	background: #1e1f2a;
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 999px;
	padding: 8px 8px 8px 18px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 5000;
	box-shadow: 0 4px 24px rgba(0,0,0,0.25);
	white-space: nowrap;
}
#collectionDeleteCount {
	color: rgba(255,255,255,0.75);
	font-size: 14px;
}
.collection-delete-trash-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(239,68,68,0.15);
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	cursor: pointer;
	padding: 0;
}
.collection-delete-cancel-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.08);
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	cursor: pointer;
	padding: 0;
	color: rgba(255,255,255,0.7);
	font-size: 16px;
}
.card-delete-check {
	display: none;
	position: absolute;
	bottom: 8px;
	right: 8px;
	width: 22px;
	height: 22px;
	border-radius: 4px;
	border: 2px solid rgba(255,255,255,0.6);
	background: rgba(0,0,0,0.35);
	z-index: 2;
	pointer-events: none;
	box-sizing: border-box;
}
#collectionCardsGrid.delete-mode .card-delete-check, .delete-mode .card-delete-check { display: block; }
#collectionCardsGrid.delete-mode .card-item, .delete-mode .card-item { cursor: default; }
.card-item.delete-selected .card-delete-check {
	background: #6366f1;
	border-color: #6366f1;
}
.card-item.delete-selected .card-delete-check::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 6px;
	height: 11px;
	border: 2px solid #fff;
	border-top: none;
	border-left: none;
	transform: rotate(45deg);
}
.collection-action-section {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	padding: 12px 20px;
	margin: 40px -20px 0 -20px;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.collection-info-title {
	color: #e4e4e7;
	opacity: 0.125;
	font-size: 28px;
	font-weight: 600;
	margin: 0 0 16px;
	text-align: left;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
}

/* Hide collection-tab floaters whenever the user is on a different tab. */
body:not(:has(#collectionTab.active)) #collectionDeletePopup,
body:not(:has(#collectionTab.active)) #widgetEditBar {
	display: none !important;
}

.collection-widget-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 8px;
}

.collection-widget {
	position: relative;
	width: 160px;
	min-height: 78px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 12px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	box-sizing: border-box;
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.collection-widget-title {
	color: #a1a1aa;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.collection-widget-value {
	color: #e4e4e7;
	font-size: 20px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 6px;
}

.collection-widget-handle, .collection-widget-x {
	display: none;
}

.collection-widget-grid.editing .collection-widget {
	padding-left: 28px;
	cursor: grab;
	user-select: none;
	touch-action: none;
}
.collection-widget-grid.editing .collection-widget.dragging {
	cursor: grabbing;
	opacity: 0.85;
	z-index: 5;
	box-shadow: 0 8px 24px rgba(0,0,0,0.35);
	transition: none;
}
.collection-widget-grid.editing .collection-widget-handle {
	display: flex;
	flex-direction: column;
	gap: 3px;
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
}
.collection-widget-handle span {
	width: 12px;
	height: 2px;
	background: rgba(255,255,255,0.4);
	border-radius: 1px;
}
.collection-widget-grid.editing .collection-widget-x {
	display: flex;
	position: absolute;
	top: 6px;
	right: 6px;
	width: 22px;
	height: 22px;
	align-items: center;
	justify-content: center;
	background: rgba(239,68,68,0.15);
	border: none;
	border-radius: 50%;
	color: #ef4444;
	font-size: 14px;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

#widgetEditBar {
	position: fixed;
	bottom: 80px;
	left: 50%;
	transform: translateX(-50%);
	background: #1e1f2a;
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 999px;
	padding: 8px;
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 5000;
	box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.widget-edit-bar-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,0.08);
	color: #e4e4e7;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	padding: 0;
}
.widget-edit-bar-cancel { background: rgba(239,68,68,0.18); color: #ef4444; }
.widget-edit-bar-save { background: rgba(34,197,94,0.18); color: #22c55e; }

.collection-widget[data-widget-key="total_value"] .collection-widget-price { color: #fbbf24; }
.collection-widget.display-only { cursor: pointer; }
.collection-widget.display-only .collection-currency-btn { pointer-events: none; opacity: 0.7; }
.add-widget-empty { color: #71717a; text-align: center; padding: 24px 0; font-size: 14px; flex: 0 0 100%; width: 100%; }

/* Add-widget modal: title centered at top, widgets fill from top-left across full width. */
#addWidgetModal .filter-modal-content { justify-content: flex-start; }
#addWidgetModal .filter-modal-title {
	position: relative;
	top: auto;
	left: auto;
	transform: none;
	text-align: center;
	margin: 0 0 16px;
	width: 100%;
}
#addWidgetModal .filter-modal-inner { padding: 24px 20px; max-width: none; margin: 0; }
#addWidgetModal #addWidgetList {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-start;
}

.widget-edit-bar-close { background: rgba(255,255,255,0.12); color: #e4e4e7; }
.collection-delete-mode-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px;
	padding: 7px 12px;
	cursor: pointer;
	gap: 7px;
	color: rgba(255,255,255,0.6);
	font-size: 13px;
}

.consent-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.7);
	z-index: 10007;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.consent-box {
	background: #1c1c27;
	border: 1px solid rgba(228,228,231,0.12);
	border-radius: 16px;
	padding: 24px;
	max-width: 340px;
	width: 100%;
}
.consent-images {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
}
.consent-img {
	flex: 1;
	height: 130px;
	object-fit: contain;
	border-radius: 8px;
	background: rgba(228,228,231,0.05);
}
.consent-title {
	font-size: 16px;
	font-weight: 600;
	color: #e4e4e7;
	margin: 0 0 8px;
}
.consent-desc {
	font-size: 13px;
	color: #a1a1aa;
	margin: 0 0 16px;
	line-height: 1.5;
}
.consent-always-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #a1a1aa;
	margin-bottom: 20px;
	cursor: pointer;
}
.consent-btns {
	display: flex;
	gap: 10px;
}
.consent-btn {
	flex: 1;
	padding: 11px 0;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
	transition: opacity 0.15s;
}
.consent-btn-decline {
	background: rgba(228,228,231,0.08);
	color: #a1a1aa;
	border: 1px solid rgba(228,228,231,0.1);
}
.consent-btn-allow {
	background: #DF3838;
	color: #fff;
	border: none;
}

.settings-section-title {
	color: #e4e4e7;
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 20px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	text-align: left;
}

.subscription-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #1e1f28;
	z-index: 10020;
	padding: 20px;
	overflow-y: auto;
	overflow-x: hidden;
	flex-direction: column;
	visibility: hidden;
}

.subscription-modal.show {
	display: flex;
	visibility: visible;
}

/* Subscription gate state — when account exists but no active subscription */
body.subscription-gate-active .topbar { z-index: 10025; background: transparent; }
body.subscription-gate-active .profile-dropdown { z-index: 10026; }
body.subscription-gate-active .subscription-modal {
	background: transparent;
	justify-content: center;
	gap: 28px;
}
body.subscription-gate-active .subscription-header,
body.subscription-gate-active #subscriptionClose,
body.subscription-gate-active #settingsBtn,
body.subscription-gate-active #devToolsBtn,
body.subscription-gate-active .profile-dropdown-divider,
body.subscription-gate-active #searchIconBtn,
body.subscription-gate-active #filterBtn,
body.subscription-gate-active #flashlightBtn { display: none !important; }

.subscription-header {
	text-align: center;
	margin-bottom: 30px;
	flex-shrink: 0;
	padding-top: 60px;
}

.subscription-carousel {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
}

.subscription-close {
	position: fixed;
	top: 20px;
	right: 20px;
	background: none;
	border: none;
	color: #e4e4e7;
	font-size: 32px;
	cursor: pointer;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	z-index: 10012;
}


.subscription-title {
	color: #e4e4e7;
	font-size: clamp(24px, 5vw, 42px);
	font-weight: 600;
	margin-bottom: 10px;
}

.subscription-subtitle {
	color: #a1a1aa;
	font-size: clamp(14px, 3vw, 18px);
}

.subscription-plan-container > .carousel-arrow {
	position: absolute;
	top: 70%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	width: 48px;
	height: 48px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.subscription-plan-container > .carousel-arrow:active {
	transform: translateY(-50%) scale(1.125);
}

.subscription-plan-container > .carousel-arrow-left { left: -55px; }
.subscription-plan-container > .carousel-arrow-right { right: -55px; }


.carousel-arrow:disabled {
	opacity: 0.3;
	cursor: default;
}

.subscription-plan-container {
	position: relative;
	width: 100%;
	max-width: 400px;
	min-height: 410px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.subscription-plan {
	position: absolute;
	padding: 10px 5px;
	text-align: center;
	width: 100%;
	opacity: 0;
	transform: translateX(0);
	pointer-events: none;
	transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: visible;
}

.subscription-plan.active {
	opacity: 1;
	transform: translateX(0);
	pointer-events: auto;
}

.subscription-plan.exit-left {
	opacity: 0;
	transform: translateX(-30%);
}

.subscription-plan.exit-right {
	opacity: 0;
	transform: translateX(30%);
}

.subscription-plan.from-right {
	opacity: 0;
	transform: translateX(30%);
	transition: none;
}

.subscription-plan.from-left {
	opacity: 0;
	transform: translateX(-30%);
	transition: none;
}

.plan-button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.plan-name {
	color: #e4e4e7;
	font-size: 28px;
	font-weight: 600;
	margin-bottom: 15px;
}

.plan-price {
	color: #DF3838;
	font-size: 48px;
	font-weight: 600;
	margin-bottom: 10px;
}

.plan-period {
	color: #a1a1aa;
	font-size: 16px;
	margin-bottom: 20px;
}

.plan-divider {
	height: 1px;
	background: rgba(228, 228, 231, 0.1);
	margin-bottom: 20px;
}

.plan-comparison-title {
	color: #a1a1aa;
	font-size: 13px;
	font-weight: 500;
	text-transform: uppercase;
	margin-bottom: 15px;
}

.plan-features {
	list-style: none;
	margin-bottom: 0;
	text-align: left;
}

.plan-benefit {
	color: #e4e4e7;
	padding: 4px 0;
	font-size: 15px;
	position: relative;
	padding-left: 16px;
}
.plan-benefit::before {
	content: "•";
	position: absolute;
	left: 2px;
	color: #71717a;
}

.plan-cost {
	color: #fca5a5;
	padding: 4px 0;
	font-size: 15px;
}

.plan-scan-bullets {
	margin: 8px 0 4px 18px;
	font-size: 13px;
	color: #a1a1aa;
	line-height: 1.55;
}
.plan-scan-bullets > div {
	font-weight: 600;
	color: #e4e4e7;
}
.plan-scan-bullets > div > span {
	font-weight: 400;
	color: #71717a;
}

.plan-button {
	display: block;
	width: 100%;
	max-width: 400px;
	margin: 24px auto 0;
	padding: 15px;
	background: #DF3838;
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
}


@media (max-width: 768px) {
	.subscription-modal {
		padding: 15px;
	}
	
	.subscription-header {
		margin-bottom: 20px;
		padding-top: 50px;
	}
	
	.subscription-carousel {
		gap: 10px;
	}

	.carousel-arrow {
		padding: 8px;
	}

	.subscription-plan-container > .carousel-arrow-left { left: -35px; }
	.subscription-plan-container > .carousel-arrow-right { right: -35px; }
	
	.subscription-plan {
		padding: 20px 18px;
	}
	
	.subscription-plan-container {
		max-width: 85%;
		min-height: 420px;
	}
	
	.plan-name {
		font-size: 22px;
		margin-bottom: 12px;
	}
	
	.plan-price {
		font-size: 36px;
		margin-bottom: 8px;
	}
	
	.plan-period {
		font-size: 14px;
		margin-bottom: 15px;
	}
	
	.plan-comparison-title {
		font-size: 11px;
		margin-bottom: 12px;
	}
	
	.plan-benefit,
	.plan-cost {
		padding: 6px 0;
		font-size: 13px;
	}
	
	.plan-divider {
		margin-bottom: 15px;
	}
}

.payment-options-modal {
	display: flex;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0);
	backdrop-filter: blur(0px);
	-webkit-backdrop-filter: blur(0px);
	z-index: 10030;
	align-items: center;
	justify-content: center;
	padding: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.375s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s 0.375s, background 0.375s cubic-bezier(0.4, 0.0, 0.2, 1), backdrop-filter 0.375s cubic-bezier(0.4, 0.0, 0.2, 1), -webkit-backdrop-filter 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
	pointer-events: none;
}

.payment-options-modal.show {
	opacity: 1;
	visibility: visible;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: opacity 0.375s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s 0s, background 0.375s cubic-bezier(0.4, 0.0, 0.2, 1), backdrop-filter 0.375s cubic-bezier(0.4, 0.0, 0.2, 1), -webkit-backdrop-filter 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
	pointer-events: auto;
}

.payment-options-content {
	background: transparent;
	width: 100%;
	max-width: 500px;
	padding: 20px;
	position: relative;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.payment-options-close {
	position: fixed;
	top: 15px;
	right: 15px;
	background: rgba(0, 0, 0, 0.125);
	border: none;
	color: white;
	font-size: 28px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}


.payment-options-title {
	color: #e4e4e7;
	font-size: 24px;
	font-weight: 600;
	margin-bottom: 6px;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	padding-top: 20px;
}

.payment-options-plan-info {
	color: #a1a1aa;
	font-size: 16px;
	text-align: center;
	margin-bottom: 24px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.account-action-btn {
	width: auto;
	padding: 10px 20px;
	background: #272833;
	color: #e4e4e7;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	margin-right: 10px;
	margin-bottom: 10px;
	transition: all 0.2s;
}


.account-field {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 15px;
	background: #272833;
	border-radius: 8px;
	max-width: 100%;
}

.account-field .account-edit-btn {
	margin-left: -8px;
}

.account-field-label {
	color: #a1a1aa;
	font-size: 14px;
	flex-shrink: 0;
}

.account-field-value {
	color: #e4e4e7;
	font-size: 14px;
}

.account-edit-btn {
	width: 32px;
	height: 32px;
	padding: 6px;
	background: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: opacity 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.7;
	flex-shrink: 0;
}


.account-edit-icon {
	width: 18px;
	height: 18px;
}

.account-field-subscription {
	background: transparent !important;
	padding: 0 !important;
}

.account-field-subscription .account-edit-icon {
	filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(2098%) hue-rotate(329deg) brightness(104%) contrast(101%);
	opacity: 1;
}

.prompt-modal {
	display: flex;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0);
	z-index: 10031;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.375s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s 0.375s, background 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
	pointer-events: none;
}

.prompt-modal.show {
	opacity: 1;
	visibility: visible;
	background: rgba(0, 0, 0, 0.85);
	transition: opacity 0.375s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s 0s, background 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
	pointer-events: auto;
}

.prompt-modal-content {
	background: #1e1f28;
	border-radius: 8px;
	padding: 30px;
	width: 400px;
	max-width: 90%;
	transform: scale(0.95);
	transition: transform 0.375s cubic-bezier(0.4, 0.0, 0.2, 1);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.prompt-modal.show .prompt-modal-content {
	transform: scale(1);
}

.prompt-modal-title {
	color: #e4e4e7;
	font-size: 20px;
	font-weight: 500;
	margin-bottom: 20px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.prompt-input {
	width: 100%;
	padding: 12px;
	margin-bottom: 15px;
	border: none;
	background: #272833;
	color: #e4e4e7;
	border-radius: 8px;
	font-size: 14px;
}

.prompt-input::placeholder {
	color: #71717a;
}

.prompt-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.prompt-btn {
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: opacity 0.2s;
}

.prompt-btn-cancel {
	background: #272833;
	color: #e4e4e7;
}

.prompt-btn-confirm {
	background: linear-gradient(135deg, #8b5cf6, #6366f1);
	color: white;
}


.filter-modal {
	display: flex;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #1e1f28;
	z-index: 10010;
	visibility: hidden;
	transform: translateY(100%);
	transition: transform 0.375s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.375s;
	pointer-events: none;
}

.filter-modal.show {
	visibility: visible;
	transform: translateY(0);
	transition: transform 0.375s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0s;
	pointer-events: auto;
}

.filter-modal-content {
	background: #1e1f28;
	border-radius: 16px 16px 0 0;
	width: 100%;
	height: 100%;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow-y: auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
}

.filter-modal-close {
	position: absolute;
	top: calc(env(safe-area-inset-top, 0px) + 16px);
	right: 20px;
}

.filter-modal-inner {
	max-width: 500px;
	width: 100%;
	margin: 0 auto;
	padding: 20px 20px 24px;
	position: relative;
}

.filter-reset-btn {
	position: absolute;
	top: 30px;
	left: 20px;
	background: none;
	border: none;
	border-radius: 6px;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}


.filter-reset-btn.spinning img {
	animation: spin360 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes spin360 {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(-360deg);
	}
}


.filter-modal-title {
	color: #e4e4e7;
	font-size: 24px;
	font-weight: 600;
	position: absolute;
	top: 30px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	text-align: center;
	white-space: nowrap;
}

.filter-group {
	margin-bottom: 25px;
	position: relative;
}

.filter-group:first-of-type {
	margin-top: 74px;
}

.filter-label {
	color: #a1a1aa;
	font-size: 14px;
	margin-bottom: 10px;
	display: block;
}

.filter-input {
	width: 100%;
	padding: 12px;
	border: none;
	background: rgba(228, 228, 231, 0.05);
	color: #e4e4e7;
	border-radius: 8px;
	font-size: 14px;
	opacity: 0.75;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
	outline: none;
}

.filter-input:focus {
	opacity: 1;
}

.filter-input::placeholder {
	color: #71717a;
}

.rarity-dropdown-btn {
	width: 100%;
	padding: 12px 16px;
	background: rgba(228, 228, 231, 0.05);
	color: #e4e4e7;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	opacity: 0.75;
}

.rarity-dropdown-btn:focus,
.rarity-dropdown-btn.active {
	opacity: 1;
}


.rarity-dropdown-menu {
	display: none;
	flex-direction: column;
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 8px;
	width: 100%;
	background: #1e1f28;
	border: 1px solid rgba(228, 228, 231, 0.1);
	border-radius: 6px;
	overflow: visible;
	z-index: 10015;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.rarity-dropdown-menu.show {
	display: flex;
}

.rarity-dropdown-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: transparent;
	border: none;
	color: #e4e4e7;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.2s;
	text-align: left;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	width: 100%;
	box-sizing: border-box;
}


.rarity-checkbox-box {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(228, 228, 231, 0.3);
	border-radius: 3px;
	background: transparent;
	flex-shrink: 0;
	transition: all 0.2s;
}

.rarity-checkbox-box.checked {
	background: white;
	border-color: white;
}

.price-slider {
	margin: 20px 0;
	position: relative;
	height: 40px;
}

.price-slider-track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 4px;
	background: rgba(228, 228, 231, 0.1);
	border-radius: 2px;
	transform: translateY(-50%);
}

.price-slider-range {
	position: absolute;
	top: 50%;
	height: 4px;
	background: white;
	border-radius: 2px;
	transform: translateY(-50%);
}

.price-slider-handle {
	position: absolute;
	top: 50%;
	width: 20px;
	height: 20px;
	background: white;
	border: 3px solid white;
	border-radius: 50%;
	cursor: pointer;
	transform: translate(-50%, -50%);
	transition: transform 0.1s;
}


.price-slider-handle:active {
	transform: translate(-50%, -50%) scale(0.95);
}

.price-slider-popup {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.9);
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	white-space: nowrap;
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	opacity: 0;
	transition: opacity 0.2s;
}

.price-slider-popup.show {
	opacity: 1;
}

.price-inputs {
	display: flex;
	gap: 10px;
	margin-top: 15px;
}

.price-inputs input {
	flex: 1;
}

.filter-actions {
	display: flex;
	gap: 10px;
	margin-top: 30px;
	justify-content: center;
}

.filter-apply {
	padding: 12px 32px;
	background: rgba(228, 228, 231, 0.08);
	color: white;
	border: none;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
}

.filter-apply:disabled {
	cursor: default;
}

.side-menu-title {
	color: #71717a;
	font-size: 14px;
	text-align: center;
	font-weight: 500;
	padding-top: 30px;
}

.scan-category-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 0 10px 0;
	border-bottom: 1px solid rgba(228, 228, 231, 0.1);
}

.scan-category-title-row .scan-category-title {
	padding: 0;
	border-bottom: none;
}

.side-menu-trash-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	opacity: 0.5;
	transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
	flex-shrink: 0;
}


.side-menu-empty {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	color: #71717a;
	padding: 20px;
	width: 100%;
	box-sizing: border-box;
}

.side-menu-empty-icon {
	font-size: 48px;
	margin-bottom: 15px;
	opacity: 0.5;
}

.side-menu-empty-text {
	font-size: 16px;
	margin-bottom: 8px;
}

#tokenUsageWrap {
	padding: 14px 16px 20px;
}

.token-bar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 7px;
}

.token-bar-label {
	font-size: 12px;
	color: #a1a1aa;
}

.token-bar-pct {
	font-size: 12px;
	color: #a1a1aa;
}

.token-bar-track {
	height: 4px;
	background: rgba(228,228,231,0.1);
	border-radius: 2px;
	overflow: hidden;
	position: relative;
}

.token-bar-balance-section {
	position: absolute;
	top: 0; right: 0; bottom: 0;
	background: rgba(251, 191, 36, 0.25);
	transition: width 0.3s ease;
}

.token-bar-divider {
	position: absolute;
	top: -1px; bottom: -1px;
	width: 2px;
	background: #fbbf24;
	transition: left 0.3s ease;
	z-index: 2;
}

.token-bar-fill {
	height: 100%;
	background: #DF3838;
	border-radius: 2px;
	width: 0%;
	transition: width 0.3s ease;
	position: relative;
	z-index: 1;
}

.token-bar-fill-balance {
	position: absolute;
	top: 0; bottom: 0;
	background: #fbbf24;
	transition: width 0.3s ease, left 0.3s ease;
	z-index: 1;
}

.token-bar-reset {
	font-size: 12px;
	color: #a1a1aa;
}

.extra-balance-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 12px;
	gap: 8px;
}

.extra-balance-label {
	font-size: 12px;
	color: #a1a1aa;
}

#extraBalanceValue {
	color: #e4e4e7;
	font-weight: 500;
}

.extra-balance-btn {
	background: rgba(228,228,231,0.08);
	border: 1px solid rgba(228,228,231,0.1);
	border-radius: 6px;
	color: #e4e4e7;
	font-size: 12px;
	padding: 5px 10px;
	cursor: pointer;
	font-family: inherit;
}

.extra-balance-btn:active { background: rgba(228,228,231,0.16); }

.billing-source-label {
	font-size: 12px;
	color: #a1a1aa;
	margin-top: 6px;
}

.billing-source-label #billingSourceText { color: #e4e4e7; }
.billing-source-label.balance #billingSourceText { color: #DF3838; }

.topup-amount-row {
	display: flex;
	align-items: center;
	background: rgba(228,228,231,0.05);
	border: 1px solid rgba(228,228,231,0.1);
	border-radius: 8px;
	padding: 12px 14px;
	margin-bottom: 8px;
}

.topup-amount-prefix {
	color: #a1a1aa;
	font-size: 18px;
	margin-right: 6px;
}

.topup-amount-input {
	background: transparent;
	border: none;
	outline: none;
	color: #e4e4e7;
	font-size: 18px;
	flex: 1;
	font-family: inherit;
	min-width: 0;
}

.topup-credit-hint {
	color: #a1a1aa;
	font-size: 13px;
	text-align: center;
	margin-bottom: 14px;
}

.waiver-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 14px;
	padding: 0 4px;
	color: #a1a1aa;
	font-size: 12px;
	line-height: 1.4;
}

.waiver-row label {
	flex: 1;
	cursor: default;
}

.waiver-checkbox {
	width: 22px;
	height: 22px;
	cursor: pointer;
	background: rgba(228,228,231,0.05);
	border-radius: 4px;
	opacity: 0.5;
	transition: opacity 0.2s, background 0.2s;
	flex-shrink: 0;
	margin-top: 1px;
}

.waiver-checkbox.checked {
	background: white;
	opacity: 1;
}

.redeem-link-btn {
	display: block;
	margin: 14px auto 0;
	background: none;
	border: none;
	color: #DF3838;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: underline;
	font-family: inherit;
}

.code-row {
	background: rgba(228,228,231,0.05);
	border: 1px solid rgba(228,228,231,0.1);
	border-radius: 8px;
	padding: 10px 12px;
	font-family: 'Courier New', monospace;
	font-size: 13px;
	color: #e4e4e7;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.code-row-code {
	font-weight: 600;
	letter-spacing: 1px;
}

.code-row-status {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
	font-size: 12px;
	color: #a1a1aa;
}

.code-row.used .code-row-code { color: #71717a; text-decoration: line-through; }
.code-row.expired { opacity: 0.5; }

.side-menu-empty-subtext {
	font-size: 13px;
	opacity: 0.7;
}

#scannedCards {
	display: flex;
	flex-direction: column;
	gap: 30px;
}

.scan-category {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.scan-category-title {
	color: #a1a1aa;
	font-size: 14px;
	font-weight: 500;
	text-transform: uppercase;
	margin: 0;
	padding: 0;
}

.scan-category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 15px;
}

.card-item.failed {
	opacity: 0.75;
	cursor: pointer;
	border: 2px solid #ef4444 !important;
}

.card-item.failed.interrupted {
	border: 2px solid #f59e0b !important;
}

.card-item.processing {
	opacity: 0.75;
	cursor: default;
	pointer-events: none;
	overflow: hidden;
}

.card-item.processing .processing-label {
	position: absolute !important;
	inset: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin: 0 !important;
	padding: 0 !important;
	text-align: center !important;
	font-weight: 400 !important;
	animation: processingPulse 1s ease-in-out infinite;
	z-index: 2;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.card-name {
	white-space: normal;
	overflow: visible;
	overflow-wrap: normal;
	word-break: normal;
}


.card-elapsed {
	position: absolute;
	top: 8px;
	left: 8px;
	font-size: 10px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.5);
	z-index: 2;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif, Oxygen-Sans, Ubuntu, Cantarell;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

@keyframes processingPulse {
	0%, 100% { opacity: 0.5; }
	50%       { opacity: 1; }
}

.side-menu .card-item .card-content {
	display: flex;
	flex-direction: column;
	position: absolute;
	inset: 0;
	padding: 15px;
	z-index: 1;
	animation: cardContentEnter 0.25s cubic-bezier(0.4, 0.0, 0.2, 1) both;
}

@keyframes cardContentEnter {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.card-item.processing::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 40%;
	z-index: 1;
	background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.09) 50%, transparent 100%);
	animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
	0%   { top: -40%; background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.09) 50%, transparent 100%); }
	50%  { background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%); }
	100% { top: 100%; background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.09) 50%, transparent 100%); }
}

.text-shimmer {
	position: relative;
	display: inline-block;
	overflow: hidden;
}
.text-shimmer::after {
	content: '';
	position: absolute;
	top: 0;
	left: -60%;
	width: 60%;
	height: 100%;
	background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100%);
	animation: textShimmer 1.5s ease-in-out infinite;
	pointer-events: none;
}
@keyframes textShimmer {
	0%   { left: -60%; }
	100% { left: 110%; }
}

@media (max-width: 600px) {
	.scan-category-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
}

.notification-container {
	position: fixed;
	top: 75px;
	right: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	z-index: 99999;
	pointer-events: none;
}

.notification {
	background: rgba(24, 25, 32, 0.95);
	border: 1px solid rgba(228, 228, 231, 0.1);
	border-radius: 8px;
	padding: 14px 18px;
	font-size: 14px;
	font-weight: 500;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	animation: notifSlideIn 0.3s ease forwards;
	max-width: 320px;
	word-wrap: break-word;
	pointer-events: auto;
}

.notification.hiding {
	animation: notifSlideOut 0.3s ease forwards;
}

.notification.error {
	color: #DF3838;
	border-color: rgba(255, 85, 85, 0.2);
}

.notification.success {
	color: #22c55e;
	border-color: rgba(34, 197, 94, 0.2);
}

.notification.warning {
	color: #e4e4e7;
	border-color: rgba(228, 228, 231, 0.2);
}

@keyframes notifSlideIn {
	from {
		opacity: 0;
		transform: translateX(20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes notifSlideOut {
	from {
		opacity: 1;
		transform: translateX(0);
	}
	to {
		opacity: 0;
		transform: translateX(20px);
	}
}

#termsDiv { justify-content: flex-start; }


#termsText {
	transition: opacity 0.2s;
}



/* ============================================
   Standardized press / release feedback
   - Resting state for buttons that previously had opacity:1 (default) gets dimmed to 0.875.
   - Buttons with a specific resting opacity (e.g. .capture-btn at 0.75) keep their value.
   - All listed buttons share the same scale + transition timing on press/release.
   ============================================ */

/* Group A — buttons whose default opacity was 1: dim the resting state via brightness */
.filter-btn,
.search-icon-btn,
.close-search-btn,
.camera-permission-btn,
.card-modal-close,
.modal-close,
.modal-arrow,
.fullscreen-back-btn,
.fullscreen-arrow,
.legal-modal-close,
.modal-collection-btn,
.settings-btn,
.logout-btn,
.payment-options-close,
.filter-reset-btn,
.settings-main-close,
.carousel-arrow,
.collection-currency-btn,
.nav-item,
#forgotPasswordBtn,
.auth-submit,
.plan-button,
#authToggle,
#authBackBtn,
#verifyCodeBackBtn,
.card-item {
	filter: brightness(0.875);
}

/* All press-anim buttons (Group A + Group B) share scale(1) at rest + 0.5s release timing */
.filter-btn,
.search-icon-btn,
.close-search-btn,
.camera-permission-btn,
.card-modal-close,
.modal-close,
.modal-arrow,
.fullscreen-back-btn,
.fullscreen-arrow,
.legal-modal-close,
.modal-collection-btn,
.settings-btn,
.logout-btn,
.payment-options-close,
.filter-reset-btn,
.settings-main-close,
.carousel-arrow,
.collection-currency-btn,
.nav-item,
#forgotPasswordBtn,
.capture-btn,
.gallery-btn,
.cancel-btn,
.profile-email-view,
.side-menu-trash-btn,
.auth-submit,
.plan-button,
#authToggle,
#authBackBtn,
#verifyCodeBackBtn,
.card-item {
	transform: scale(1);
	transition: filter 0.5s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.5s cubic-bezier(0.4,0.0,0.2,1);
}

/* Press: full brightness + scale up to 1.125, fast 0.125s in */
.filter-btn:active,
.search-icon-btn:active,
.close-search-btn:active,
.camera-permission-btn:active,
.card-modal-close:active,
.modal-close:active,
.modal-arrow:active,
.fullscreen-back-btn:active,
.fullscreen-arrow:active,
.legal-modal-close:active,
.modal-collection-btn:active,
.settings-btn:active,
.logout-btn:active,
.payment-options-close:active,
.filter-reset-btn:active,
.settings-main-close:active,
.carousel-arrow:active,
.collection-currency-btn:active,
.nav-item:active,
#forgotPasswordBtn:active,
.capture-btn:active,
.gallery-btn:active,
.cancel-btn:active,
.profile-email-view:active,
.side-menu-trash-btn:active,
#authToggle:active,
#authBackBtn:active,
#verifyCodeBackBtn:active {
	filter: brightness(1);
	transform: scale(1.125);
	transition: filter 0.125s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.125s cubic-bezier(0.4,0.0,0.2,1);
}
.card-item:active {
	filter: brightness(1);
	transform: scale(1.025);
	transition: filter 0.125s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.125s cubic-bezier(0.4,0.0,0.2,1);
}
.card-placeholder,
.card-placeholder:active {
	filter: none !important;
	transform: none !important;
	cursor: default !important;
}

/* Auth submit gets a softer 1.025 scale on press (matches the input scale). */
.auth-submit:active,
.plan-button:active {
	filter: brightness(1);
	transform: scale(1.025);
	transition: filter 0.125s cubic-bezier(0.4,0.0,0.2,1),
	            transform 0.125s cubic-bezier(0.4,0.0,0.2,1);
}

/* The forgot-password link is full-width with left-aligned text, so the default centered
   transform-origin makes the scale grow rightward into the empty space — looks lopsided.
   Anchor to the left edge so it scales out from where the text actually starts. */
#forgotPasswordBtn {
	transform-origin: 0 50%;
}

@keyframes _authSlideIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}
.auth-animate-in { animation: _authSlideIn 0.38s cubic-bezier(0.4, 0, 0.2, 1) backwards; }

/* Bottom nav: scale only the icon, not the entire nav-item (so the label stays in place).
   The shared rule above gives .nav-item the opacity transition; we cancel its transform
   here and apply the scale to .nav-icon instead. */
.nav-item, .nav-item:active {
	transform: none;
}
.nav-icon {
	transform: scale(1);
	transition: transform 0.5s cubic-bezier(0.4,0.0,0.2,1);
}
.nav-item:active .nav-icon {
	transform: scale(1.125);
	transition: transform 0.125s cubic-bezier(0.4,0.0,0.2,1);
}
