.memestash-app,
.memestash-app * {
	box-sizing: border-box;
}

.memestash-app {
	font-family: inherit;
	color: #181818;
}

.ms-landing {
	min-height: 60vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ms-landing-card {
	width: 100%;
	max-width: 520px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 24px;
	padding: 28px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.ms-logo-large {
	text-align: center;
	margin-bottom: 24px;
}

.ms-logo-name,
.ms-logo-text {
	font-weight: 800;
	letter-spacing: -0.02em;
}

.ms-logo-name {
	font-size: 30px;
}

.ms-logo-sub {
	color: #666;
	margin-top: 8px;
	font-size: 14px;
}

.ms-landing-actions {
	display: grid;
	gap: 12px;
}

.ms-shell {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px;
}

.ms-topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(12px);
	border: 1px solid #ededed;
	border-radius: 18px;
	padding: 16px;
	display: flex;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.ms-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.ms-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.ms-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ms-logo-icon--large .ms-logo-svg { width: 84px; }

.ms-logo-svg {
  width: 56px;
  height: auto;
  display: block;
  fill: currentColor;
  color: #181818;
}

/* Landing version slightly larger */
.ms-logo-icon--large .ms-logo-svg {
  width: 84px;
}


.ms-logo-text {
	font-size: 24px;
}

.ms-meta-line {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 12px;
	color: #666;
	margin-top: 3px;
}

.ms-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
}

.ms-status-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #d0d0d0;
}

.ms-status.is-warning .ms-status-dot {
	background: #e6a700;
}

.ms-status.is-ok .ms-status-dot {
	background: #2fa35b;
}

.ms-top-actions,
.ms-controls {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.ms-controls {
	margin: 24px 0 20px;
}

.ms-btn {
	border: 0;
	border-radius: 14px;
	padding: 12px 16px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.12s ease, opacity 0.12s ease;
}

.ms-btn:active {
	transform: scale(0.98);
}

.ms-btn-primary {
	background: #181818;
	color: #fff;
}

.ms-btn-light {
	background: #f2f2f2;
	color: #181818;
}

.ms-btn-big {
	padding: 14px 18px;
	font-size: 16px;
	width: 100%;
}

.ms-btn-add-board {
	background: #fff3d8;
	color: #523800;
}

.ms-empty-state {
	background: #fff;
	border: 1px dashed #d7d7d7;
	border-radius: 20px;
	padding: 28px;
	text-align: center;
}

.ms-empty-title {
	font-size: 20px;
	font-weight: 800;
	margin-bottom: 8px;
}

.ms-empty-text {
	color: #666;
	margin-bottom: 16px;
}

.ms-item.is-duplicate {
    border: 2px solid #f5a623;
}

.ms-item.is-duplicate.is-active {
    box-shadow: 0 0 0 3px rgba(245,166,35,0.25);
}

.ms-boards {
	display: grid;
	gap: 12px;
}

.ms-board {
	background: #fff;
	border: 1px solid #ededed;
	border-radius: 20px;
	overflow: hidden;
}

.ms-board-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 14px;
}

.ms-board-toggle {
	appearance: none;
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font: inherit;
	display: flex;
	align-items: center;
	gap: 10px;
	text-align: left;
}

.ms-board-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ms-board-chevron svg {
	transition: transform 0.18s ease;
	transform-origin: 50% 50%;
	color: #666;
}

.ms-board.is-open .ms-board-chevron svg {
	transform: rotate(90deg);
}

.ms-board-title {
	font-size: 18px;
	font-weight: 800;
	word-break: normal;
}

.ms-board-count {
	font-size: 12px;
	color: #666;
	background: #f2f2f2;
	padding: 4px 8px;
	border-radius: 999px;
}

.ms-board-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ms-icon-btn {
	border: 0;
	background: #f5f5f5;
	border-radius: 10px;
	padding: 8px 10px;
	cursor: pointer;
	line-height: 1;
}

.ms-board-drag {
	cursor: grab;
	user-select: none;
	padding: 4px 6px;
	color: #666;
	font-size: 18px;
}

.ms-board-body {
	display: none;
	padding: 0 14px 14px;
	border-top: 1px solid #f0f0f0;
}

.ms-board.is-open .ms-board-body {
	display: block;
}

.ms-board-add-row {
	padding: 12px 0;
}

.ms-board-empty {
	padding: 10px 0 4px;
	color: #666;
	font-size: 14px;
}

.ms-items-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}


.ms-item {
	position: relative;
	border-radius: 18px;
	overflow: hidden;
	background: #f8f8f8;
	border: 1px solid #ededed;
}

/* Hard-square fallback (works everywhere) */
.ms-item::before {
	content: "";
	display: block;
	padding-top: 100%;
}

/* Make the main clickable area fill the square */
.ms-item-main {
	appearance: none;
	border: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	width: 100%;
	position: absolute;
	inset: 0;
	cursor: pointer;
	display: block;
}

/* Image fills the square */
.ms-item-thumb {
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: #ececec;
}

.ms-item-text-inner {
	position: relative;
	width: 100%;
	height: 100%;
	padding: 12px;
	background: linear-gradient(135deg, #f9f9f9, #ebebeb);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	text-align: left;
}

.ms-item-text-title {
	font-weight: 800;
	line-height: 1.2;
	word-break: normal;
	text-align: center;
}

.ms-item-actions {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 8px;
	display: none;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 14px;
	box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.ms-item.is-active .ms-item-actions {
	display: flex;
}

.ms-item-drag {
	cursor: grab;
	user-select: none;
	font-size: 18px;
	color: #666;
	padding: 4px 6px;
}

.ms-item-action-btn {
	border: 0;
	background: #181818;
	color: #fff;
	border-radius: 12px;
	padding: 8px 12px;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}

.ms-item-action-danger {
	background: #a32424;
}

.ms-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 9999;
}

.ms-modal {
	width: 100%;
	max-width: 440px;
	background: #fff;
	border-radius: 20px;
	padding: 20px;
	box-shadow: 0 16px 40px rgba(0,0,0,0.2);
}

.ms-modal-title {
	font-size: 20px;
	font-weight: 800;
	margin-bottom: 16px;
}

.ms-modal-body {
	display: grid;
	gap: 14px;
}

.ms-modal-label {
	display: grid;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
}

.ms-input {
	width: 100%;
	border: 1px solid #d9d9d9;
	background: #fff;
	border-radius: 12px;
	padding: 12px 14px;
	font: inherit;
}

.ms-modal-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 18px;
}

.ms-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%) translateY(10px);
	background: #181818;
	color: #fff;
	padding: 12px 16px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 10000;
}

.ms-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

@media (min-width: 720px) {
	.ms-items-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.ms-topbar {
		padding: 14px;
	}

	.ms-top-actions {
		width: 100%;
	}

	.ms-top-actions .ms-btn {
		flex: 1 1 calc(50% - 5px);
	}

	.ms-logo-text {
		font-size: 22px;
	}

	.ms-board-title {
		font-size: 17px;
	}
}

.ms-app-logo-outside {
  text-align: center;
  margin-bottom: 18px;
}

.ms-logo-text-large {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
}

/* Broken link highlight */
.ms-item.is-broken {
	outline: 2px solid #d63638; /* WP red-ish */
	outline-offset: 2px;
}

/* Preview failed highlight (amber-ish) */
.ms-item.is-preview-failed {
	outline: 2px solid #dba617;
	outline-offset: 2px;
}

/* Preview row */
.ms-item-preview {
	display: flex;
	gap: 10px;
	align-items: center;
}

.ms-item-preview-thumb {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background-size: cover;
	background-position: center;
	background-color: rgba(255,255,255,0.08);
	flex: 0 0 auto;
}

.ms-item-preview-thumb.is-empty {
	background-image: none;
}

.ms-item-preview {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	width: 100%;
}

.ms-item-preview-title {
	flex: 1 1 auto;
	min-width: 0;
	line-height: 1.25;
	font-weight: 600;

	white-space: normal;
	overflow: hidden;
	word-break: break-word;
	overflow-wrap: anywhere;
}

/* Badges */

.ms-item-badge {
	margin-top: 8px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(255,255,255,0.08);
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.ms-item-badge--broken {
	background: rgba(214,54,56,0.15);
}

.ms-item-badge--loading {
	background: rgba(219,166,23,0.15);
}

.ms-board-header {
	position: relative;
}

/* Invisible overlay used as a drop target, only shown during drag */
.ms-board-dropzone {
	position: absolute;
	inset: 0;
	display: none;
	z-index: 5;
}

/* Show drop target only while dragging items */
body.ms-dragging-item .ms-board-dropzone {
	display: block;
}

/* Optional: subtle hint while dragging */
body.ms-dragging-item .ms-board-header {
	outline: 1px dashed rgba(0,0,0,0.15);
	outline-offset: -6px;
	border-radius: 16px;
}

/* Rotating moustache */
.ms-spin {
	width: 16px;
	height: 16px;
	animation: ms-rot 0.9s linear infinite;
}

.ms-item-text-inner--topleft {
	align-items: flex-start;
	justify-content: flex-start;
	text-align: left;
}

.ms-item-barcode .ms-item-text-inner {
	padding: 14px;
	background: var(--ms-card-bg, #ffffff);
	color: var(--ms-card-fg, inherit);
}

.ms-barcode-title {
	font-weight: 800;
	line-height: 1.2;
	margin-bottom: 10px;
	width: 100%;
}

.ms-barcode-preview {
	width: 100%;
	height: 46px;
	display: flex;
	align-items: flex-end;
	gap: 1px;
	opacity: 0.95;
	margin-bottom: 10px;
	overflow: hidden;
}

.ms-barcode-preview .ms-bar {
	display: inline-block;
	height: 46px;
	background: var(--ms-bar-color, #111);
	border-radius: 1px;
}

.ms-barcode-preview .ms-gap {
	display: inline-block;
	height: 46px;
	background: transparent;
}

.ms-barcode-digits {
	font-size: 12px;
	letter-spacing: 0.08em;
	opacity: 0.85;
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ms-barcode-scan-wrap {
	display: grid;
	gap: 10px;
}

.ms-barcode-scan {
	width: 100%;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 14px;
	padding: 10px;
	overflow: hidden;
}

#ms-barcode-svg {
	width: 100%;
	height: auto;
	display: block;
}

.ms-barcode-scan-code {
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.08em;
}

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