/* ─────────────────────────────────────
   Desktop: centered dialog
   ───────────────────────────────────── */
.modal.memory-collection {
	width: 460px;
	max-width: 90vw;
	max-height: 70vh;
	border-radius: 16px;
}

/* ─────────────────────────────────────
   Mobile: bottom sheet (≤812px)
   z-index.css already sets position:fixed; bottom:0; left:0; width:100%
   on .modal-container .modal at this breakpoint.
   We just refine the collection-specific styles.
   ───────────────────────────────────── */
@media screen and (max-width: 812px) {
	.modal.memory-collection {
		width: 100%;
		max-width: 100%;
		max-height: 75vh;
		border-radius: 20px 20px 0 0;
		animation: sheetSlideUp 0.3s ease;
	}
	@keyframes sheetSlideUp {
		from { transform: translateY(100%); }
		to   { transform: translateY(0); }
	}
	/* Hide drag handle on desktop */
	.collection-sheet-handle {
		display: block;
	}
}
@media screen and (min-width: 813px) {
	.collection-sheet-handle {
		display: none;
	}
}

/* ── Bottom Sheet Layout ── */
.collection-overview.collection-tab:not(.force-hide) {
	display: flex !important;
	flex-direction: column;
	height: 100%;
}

/* ── Bottom Sheet Header ── */
.collection-sheet-header {
	padding: 12px 16px 0;
	flex-shrink: 0;
}
.collection-sheet-handle {
	width: 40px;
	height: 4px;
	background: #ddd;
	border-radius: 2px;
	margin: 0 auto 12px;
}
.collection-sheet-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	border-bottom: 1px solid #f0f0f0;
}
.collection-sheet-title {
	font-family: 'Montserrat';
	font-size: 18px;
	font-weight: 700;
	color: #1a1a1a;
}
.collection-sheet-close {
	font-size: 22px;
	color: #999;
	cursor: pointer;
	padding: 4px;
	border-radius: 50%;
	transition: background 0.15s;
}
.collection-sheet-close:hover {
	background: #f0f0f0;
}

/* ── Memory Preview (compact) ── */
.collection-sheet-memory-preview {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	gap: 10px;
	flex-shrink: 0;
}
.collection-sheet-memory-thumb {
	width: 44px;
	height: 44px;
	min-width: 44px;
	border-radius: 8px;
	background-size: cover;
	background-position: center;
	background-color: #f4f4f4;
}
.collection-sheet-memory-title {
	font-family: 'Montserrat';
	font-size: 14px;
	font-weight: 600;
	color: #333;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ── New Collection Row ── */
.collection-sheet-new {
	padding: 0 16px 8px;
	flex-shrink: 0;
}
.collection-sheet-new-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	cursor: pointer;
}
.collection-sheet-new-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: #fee8df;
	display: flex;
	align-items: center;
	justify-content: center;
}
.collection-sheet-new-icon span {
	font-size: 22px;
	color: #f37442;
}
.collection-sheet-new-label {
	font-family: 'Montserrat';
	font-size: 15px;
	font-weight: 600;
	color: #f37442;
}
.collection-sheet-input-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
}
.collection-sheet-input {
	flex: 1;
	font-family: 'SFProText', sans-serif;
	font-size: 15px;
	padding: 10px 12px;
	border: 1.5px solid #e0e0e0;
	border-radius: 10px;
	outline: none;
	transition: border-color 0.2s;
	box-sizing: border-box;
}
.collection-sheet-input:focus {
	border-color: #f37442;
}
.collection-sheet-create-btn {
	font-family: 'Montserrat';
	font-size: 14px;
	font-weight: 600;
	padding: 10px 16px;
	border: none;
	border-radius: 10px;
	background: #f37442;
	color: white;
	cursor: pointer;
	white-space: nowrap;
	transition: opacity 0.15s;
}
.collection-sheet-create-btn:disabled {
	background: #ccc;
	cursor: default;
}

/* ── Collections List ── */
.collection-sheet-list-wrapper {
	flex: 1;
	overflow-y: auto;
	padding: 4px 0 16px;
	min-height: 0;
	-webkit-overflow-scrolling: touch;
}
.collection-sheet-list {
	display: flex;
	flex-direction: column;
}
.collection-sheet-empty {
	text-align: center;
	padding: 32px 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* ── Collection Row ── */
.collection-sheet-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	cursor: pointer;
	transition: background 0.12s;
}
.collection-sheet-row:active {
	background: #f5f5f5;
}

/* ── Row Thumbnail ── */
.collection-sheet-row-thumb {
	flex-shrink: 0;
}
.collection-sheet-row-img {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	background-size: cover;
	background-position: center;
	background-color: #f0f0f0;
}
.collection-sheet-row-img-empty {
	display: flex;
	align-items: center;
	justify-content: center;
}
.collection-sheet-row-img-empty span {
	font-size: 24px;
	color: #ccc;
}

/* ── Row Text ── */
.collection-sheet-row-info {
	flex: 1;
	min-width: 0;
}
.collection-sheet-row-name {
	font-family: 'Montserrat';
	font-size: 15px;
	font-weight: 600;
	color: #1a1a1a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.collection-sheet-row-count {
	font-family: 'SFProText', sans-serif;
	font-size: 13px;
	color: #999;
	margin-top: 2px;
}

/* ── Row Checkmark ── */
.collection-sheet-row-check {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid #ddd;
	background: white;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
}
.collection-sheet-row-check span {
	font-size: 18px;
	color: transparent;
	transition: color 0.2s;
}
.collection-sheet-row.already-added .collection-sheet-row-check {
	background: #f37442;
	border-color: #f37442;
}
.collection-sheet-row.already-added .collection-sheet-row-check span {
	color: white;
}

/* ── Saving state on row ── */
.collection-sheet-row.saving {
	pointer-events: none;
	opacity: 0.6;
}

/* ── Toast ── */
.collection-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: white;
	padding: 10px 20px;
	border-radius: 24px;
	font-family: 'SFProText', sans-serif;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 10000;
	box-shadow: 0 4px 12px rgba(0,0,0,0.2);
	animation: toastSlideUp 0.3s ease;
	white-space: nowrap;
}
.collection-toast-icon {
	font-size: 18px;
	color: #4caf50;
}
@keyframes toastSlideUp {
	from { opacity: 0; transform: translateX(-50%) translateY(20px); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


.collection-sheet-load-more {
    display: block;
    margin: 12px auto;
    padding: 10px 20px;
    min-height: 44px;
    border: 1px solid #ea794c;
    border-radius: 8px;
    background: white;
    color: #a64b29;
    cursor: pointer;
}
.collection-sheet-load-more[hidden] { display: none; }
[data-collection-sheet-status] { text-align: center; }
