/* Iwako Pick & Mix */
.ipm {
	--ipm-yellow: #FFD447;
	--ipm-pink: #FF8CB4;
	--ipm-peach: #FFC3A0;
	--ipm-sky: #9ED6FF;
	--ipm-mint: #A9E8B4;
	--ipm-ink: #2E2459;
	--ipm-grape: #5B3FD9;
	--ipm-paper: #FFFDF7;
	--ipm-font: "Baloo 2", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
	font-family: var(--ipm-font);
	color: var(--ipm-ink);
	box-sizing: border-box;
	max-width: none !important; /* width is fitted to the site frame by pick-mix.js */
}
.ipm *, .ipm *::before, .ipm *::after { box-sizing: border-box; }
.ipm button { font-family: inherit; color: inherit; }
/* no box after a mouse click or tap: beats any theme focus/active style (ID selector) */
#ipm *, #ipm *::before, #ipm *::after { -webkit-tap-highlight-color: transparent; }
#ipm *:focus:not(:focus-visible),
#ipm *:active,
#ipm *:focus-within:not(:focus-visible) { outline: 0 !important; outline-offset: 0 !important; }
#ipm img, #ipm img:focus, #ipm img:active { outline: 0 !important; }
#ipm .ipm-chip, #ipm .ipm-card-hit, #ipm .ipm-slot, #ipm img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
#ipm .ipm-chip:focus:not(:focus-visible), #ipm .ipm-chip:active { box-shadow: 2px 2px 0 var(--ipm-ink) !important; }
#ipm .ipm-card-hit:focus:not(:focus-visible), #ipm .ipm-slot:focus:not(:focus-visible),
#ipm .ipm-minus:focus:not(:focus-visible) { box-shadow: none !important; }
#ipm *:focus-visible { outline: 3px solid var(--ipm-grape) !important; outline-offset: 3px !important; }
/* (older rule kept for safety) */
.ipm button:focus:not(:focus-visible), .ipm a:focus:not(:focus-visible),
.ipm img:focus, .ipm .ipm-card-hit:focus:not(:focus-visible) { outline: none !important; box-shadow: none; }
.ipm .ipm-chip:focus:not(:focus-visible) { box-shadow: 2px 2px 0 var(--ipm-ink); }
.ipm .ipm-chip img, .ipm .ipm-card-img img, .ipm .ipm-slot img { outline: none !important; }
.ipm button:focus-visible, .ipm input:focus-visible, .ipm a:focus-visible {
	outline: 3px solid var(--ipm-grape);
	outline-offset: 3px;
}

.ipm-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 40px;
	align-items: start;
}

/* ---------- heading + how it works ---------- */
.ipm-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
	gap: 20px 40px;
	align-items: end;
	margin: 0 0 32px;
	padding-bottom: 28px;
	border-bottom: 2px dashed rgba(46, 36, 89, .2);
}
.ipm-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}
.ipm-steps li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 14px;
	background: #fff;
	border: 2px solid var(--ipm-ink);
	border-radius: 16px;
	font-size: .98rem;
	line-height: 1.3;
}
.ipm-steps li:nth-child(1) { background: #FFF3C4; }
.ipm-steps li:nth-child(2) { background: #FFE3EC; }
.ipm-steps li:nth-child(3) { background: #E1F3FF; }
.ipm-step-n {
	flex: 0 0 30px;
	height: 30px;
	display: grid;
	place-items: center;
	background: var(--ipm-ink);
	color: #fff;
	border-radius: 50%;
	font-weight: 800;
	font-size: 1rem;
	padding-top: 2px;
}

.ipm-title {
	font-family: var(--ipm-font);
	font-weight: 800;
	font-size: clamp(2.4rem, 5vw, 3.6rem);
	line-height: 0.95;
	letter-spacing: -0.02em;
	margin: 0 0 10px;
	color: var(--ipm-ink);
}
.ipm-title-price {
	display: inline-block;
	margin-left: 0.3em;
	padding: 0.05em 0.35em 0;
	background: var(--ipm-yellow);
	border-radius: 0.3em;
	transform: rotate(-3deg);
	font-size: 0.62em;
	vertical-align: 0.2em;
}
.ipm-sub {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.45;
	max-width: 52ch;
}

/* ---------- filters ---------- */
.ipm-tools {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	margin-bottom: 22px;
}
.ipm-searchbar {
	position: relative;
	display: flex;
	align-items: center;
	background: #fff;
	border: 3px solid var(--ipm-ink);
	border-radius: 999px;
	box-shadow: 4px 4px 0 var(--ipm-ink);
	transition: box-shadow .15s, transform .15s;
}
.ipm-searchbar:focus-within { box-shadow: 4px 4px 0 var(--ipm-pink); }
.ipm-searchbar-icon { width: 22px; height: 22px; margin-left: 18px; flex: 0 0 auto; color: var(--ipm-ink); }
.ipm .ipm-search {
	flex: 1;
	min-width: 0;
	height: 54px;
	padding: 0 14px;
	border: 0 !important;
	background: transparent;
	font-family: inherit;
	font-size: 1.08rem;
	font-weight: 600;
	color: var(--ipm-ink);
	outline: none !important;
	box-shadow: none !important;
}
.ipm .ipm-search::placeholder { color: rgba(46, 36, 89, .5); font-weight: 500; }
.ipm .ipm-search::-webkit-search-cancel-button { display: none; }
.ipm-search-clear {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	margin-right: 10px;
	border: 2px solid var(--ipm-ink);
	border-radius: 50%;
	background: var(--ipm-yellow);
	font-size: 1.3rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
}
.ipm-search-clear[hidden] { display: none; }
.ipm-count { margin: 0; font-size: .95rem; font-weight: 600; opacity: .75; }
.ipm-tools-label { margin: 4px 0 -4px; font-weight: 800; font-size: 1rem; }
.ipm-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ipm .ipm-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 6px 4px 4px;
	border: 3px solid var(--ipm-ink);
	background: #fff;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 2px 2px 0 var(--ipm-ink);
	transition: background-color .15s, transform .1s;
	white-space: nowrap;
}
.ipm-chip img, .ipm-chip-all-icon {
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	border-radius: 50%;
	object-fit: contain;
	background: var(--ipm-paper);
	border: 2px solid var(--ipm-ink);
	box-sizing: border-box;
}
.ipm-chip-all-icon { display: grid; place-items: center; background: var(--ipm-yellow); font-size: 1.1rem; line-height: 1; }
.ipm-chip-label { padding-top: 2px; }
.ipm-chip-n {
	min-width: 26px;
	padding: 3px 7px 1px;
	background: var(--ipm-paper);
	border: 2px solid var(--ipm-ink);
	border-radius: 999px;
	font-size: .85rem;
	text-align: center;
}
@media (hover: hover) { .ipm .ipm-chip:hover { background: var(--ipm-paper); transform: translateY(-1px); } }
.ipm .ipm-chip[aria-pressed="true"] { background: var(--ipm-ink); color: #fff; }
.ipm .ipm-chip[aria-pressed="true"] .ipm-chip-n { background: var(--ipm-yellow); color: var(--ipm-ink); }
@media (max-width: 640px) {
	.ipm-chips { flex-wrap: nowrap; overflow-x: auto; padding: 2px 4px 8px 2px; margin: 0 -4px; scrollbar-width: thin; }
	.ipm .ipm-chip { flex: 0 0 auto; }
}


/* ---------- eraser cards: chunky like a rubber eraser ---------- */
.ipm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
	gap: 20px 16px;
}
.ipm-card {
	--tint: var(--ipm-yellow);
	--tint-deep: #E8B71F;
	position: relative;
	background: var(--tint);
	border-radius: 22px;
	box-shadow: 0 6px 0 var(--tint-deep);
	transition: transform .18s cubic-bezier(.3,1.6,.5,1), box-shadow .18s;
}
.ipm-tint-pink  { --tint: var(--ipm-pink);  --tint-deep: #E46496; }
.ipm-tint-peach { --tint: var(--ipm-peach); --tint-deep: #EC9C72; }
.ipm-tint-sky   { --tint: var(--ipm-sky);   --tint-deep: #6CB7EC; }
.ipm-tint-mint  { --tint: var(--ipm-mint);  --tint-deep: #74CC86; }
.ipm-tint-yellow{ --tint: var(--ipm-yellow);--tint-deep: #E8B71F; }

.ipm-card-hit {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	padding: 12px 12px 14px;
	border: 0;
	background: none;
	cursor: pointer;
	border-radius: 22px;
	text-align: center;
}
.ipm-card-img {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1;
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
}
.ipm-card-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	transition: transform .25s cubic-bezier(.3,1.6,.5,1);
}
.ipm-plus {
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	padding-top: 2px;
	background: var(--ipm-grape);
	color: #fff;
	border: 2px solid var(--ipm-ink);
	border-radius: 50%;
	font-size: 1.6rem;
	font-weight: 800;
	line-height: 1;
	box-shadow: 2px 2px 0 var(--ipm-ink);
	transition: transform .15s cubic-bezier(.3,1.6,.5,1);
}
@media (hover: hover) { .ipm-card:not(.is-locked):hover .ipm-plus { transform: scale(1.12) rotate(90deg); } }
.ipm-card.is-locked .ipm-plus { display: none; }
.ipm-card-name {
	margin-top: 10px;
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.15;
}
.ipm-card-stock { display: none; }
.ipm-card-stock:not(:empty) {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	padding: 3px 10px 2px 8px;
	background: rgba(255, 255, 255, .75);
	border: 2px solid var(--ipm-ink);
	border-radius: 999px;
	font-size: .78rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ipm-ink);
}
.ipm-card-stock:not(:empty)::before {
	content: "";
	width: 8px;
	height: 8px;
	flex: 0 0 8px;
	border-radius: 50%;
	background: #3FB06A;
}
.ipm-card-stock.is-low { background: #fff; color: #B0174B; border-color: #B0174B; }
.ipm-card-stock.is-low::before { background: #D63F6E; }
.ipm-card-stock.is-out { background: rgba(255, 255, 255, .6); color: rgba(46, 36, 89, .7); border-color: rgba(46, 36, 89, .5); }
.ipm-card-stock.is-out::before { background: #9a96a8; }
@media (hover: hover) {
	.ipm-card:not(.is-locked):hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 9px 0 var(--tint-deep); }
	.ipm-card:not(.is-locked):hover .ipm-card-img img { transform: scale(1.06) rotate(3deg); }
}
.ipm-card:not(.is-locked):active { transform: translateY(4px); box-shadow: 0 2px 0 var(--tint-deep); }
.ipm-card.is-squish { animation: ipm-squish .32s cubic-bezier(.3,1.6,.5,1); }
@keyframes ipm-squish {
	0% { transform: scale(1); }
	35% { transform: scale(1.06, .9); }
	70% { transform: scale(.97, 1.04); }
	100% { transform: scale(1); }
}
.ipm-card.is-locked .ipm-card-hit { cursor: default; }
.ipm-card.is-locked:not(.is-picked) { opacity: .55; }
.ipm-card.is-out { filter: grayscale(.7); }

.ipm-badge:empty, .ipm-card:not(.is-picked) .ipm-minus { display: none; }
.ipm-badge {
	position: absolute;
	top: -10px;
	right: -8px;
	min-width: 42px;
	padding: 4px 10px 1px;
	background: var(--ipm-ink);
	color: #fff;
	font-weight: 800;
	font-size: 1.15rem;
	border-radius: 999px;
	transform: rotate(6deg);
	pointer-events: none;
	animation: ipm-badge .3s cubic-bezier(.3,1.8,.5,1);
}
@keyframes ipm-badge { from { transform: rotate(6deg) scale(.4); } }
.ipm-minus {
	position: absolute;
	top: -10px;
	left: -8px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 2px solid var(--ipm-ink);
	background: #fff;
	font-size: 1.4rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
}
.ipm-empty { grid-column: 1 / -1; font-size: 1.1rem; padding: 30px 0; }

/* ---------- the box ---------- */
.ipm-box {
	position: relative;
	will-change: transform;
	background: var(--ipm-paper);
	border: 3px solid var(--ipm-ink);
	border-radius: 28px;
	padding: 20px 20px 18px;
	box-shadow: 8px 8px 0 var(--ipm-ink);
}
.ipm-box-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ipm-box-title { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1; font-family: var(--ipm-font); color: var(--ipm-ink); }
.ipm-sound {
	border: 0;
	background: none;
	font-size: .9rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	padding: 4px;
}
.ipm-editing { margin: 8px 0 0; padding: 8px 12px; background: var(--ipm-yellow); border: 2px solid var(--ipm-ink); border-radius: 12px; font-size: .95rem; line-height: 1.3; font-weight: 600; }
.ipm-editing[hidden] { display: none; }
.ipm-editing a { color: var(--ipm-ink); }
.ipm-progress { margin: 6px 0 14px; font-size: 1.05rem; line-height: 1.3; min-height: 2.6em; }

.ipm-tray {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 12px;
	padding: 14px;
	background: var(--ipm-sky);
	border-radius: 18px;
	box-shadow: inset 0 4px 0 rgba(46, 36, 89, .15);
	position: relative;
}
.ipm-box.is-full .ipm-tray { background: var(--ipm-mint); animation: ipm-glow 1s ease-out; }
@keyframes ipm-glow { 0% { box-shadow: inset 0 4px 0 rgba(46,36,89,.15), 0 0 0 0 rgba(91,63,217,.5); } 100% { box-shadow: inset 0 4px 0 rgba(46,36,89,.15), 0 0 0 18px rgba(91,63,217,0); } }

.ipm-slot {
	aspect-ratio: 1;
	border: 2px dashed rgba(46, 36, 89, .35);
	border-radius: 12px;
	background: rgba(255, 255, 255, .55);
	display: grid;
	place-items: center;
	padding: 3px;
	overflow: hidden;
	font-weight: 700;
	font-size: .95rem;
	color: rgba(46, 36, 89, .45);
	cursor: default;
}
.ipm-slot.is-filled {
	border: 2px solid var(--ipm-ink);
	background: #fff;
	cursor: pointer;
	position: relative;
}
.ipm-slot.is-filled::after {
	content: "\00d7";
	position: absolute;
	top: 0;
	right: 3px;
	font-size: .9rem;
	line-height: 1;
	color: var(--ipm-ink);
	opacity: 0;
	transition: opacity .15s;
}
@media (hover: hover) { .ipm-slot.is-filled:hover::after { opacity: .7; } }
.ipm-slot img { width: 100%; height: 100%; object-fit: contain; display: block; border: 0 !important; }
.ipm-slot.is-pop { animation: ipm-pop .38s cubic-bezier(.3,1.8,.5,1); }
@keyframes ipm-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.ipm-slot.is-leaving { transition: transform .16s, opacity .16s; transform: scale(.3) rotate(20deg); opacity: 0; }

.ipm-actions { display: flex; gap: 8px; margin: 14px 0 12px; }
.ipm-lucky, .ipm-clear {
	flex: 1;
	padding: 8px 10px 5px;
	border-radius: 999px;
	border: 2px solid var(--ipm-ink);
	background: #fff;
	font-weight: 700;
	font-size: .95rem;
	cursor: pointer;
}
.ipm-lucky { background: var(--ipm-pink); }
.ipm-lucky:disabled, .ipm-clear:disabled { opacity: .4; cursor: default; }

.ipm .ipm-add {
	display: block;
	width: 100%;
	padding: 14px 16px 11px;
	border: 3px solid var(--ipm-ink);
	border-radius: 18px;
	background: #fff;
	color: var(--ipm-ink);
	font-family: inherit;
	font-size: 1.2rem;
	font-weight: 800;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	box-shadow: 0 5px 0 var(--ipm-ink);
	transition: transform .1s, box-shadow .1s;
}
/* progress fill behind the button text */
.ipm .ipm-add[disabled] { cursor: default; box-shadow: 0 5px 0 rgba(46,36,89,.4); border-color: rgba(46,36,89,.4); color: rgba(46,36,89,.7); }
.ipm .ipm-add[disabled]::before {
	content: "";
	position: absolute;
	inset: 0;
	width: var(--fill, 0%);
	background: var(--ipm-yellow);
	opacity: .55;
	z-index: -1;
	transition: width .3s ease;
}
.ipm .ipm-add[disabled] { z-index: 0; }
.ipm .ipm-add:not([disabled]) { background: var(--ipm-grape); color: #fff; border-color: var(--ipm-ink); }
.ipm .ipm-add:not([disabled]):active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ipm-ink); }
.ipm-box.is-full .ipm-add:not([disabled]) { animation: ipm-wiggle .6s .3s ease-in-out; }
@keyframes ipm-wiggle { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-2deg); } 40% { transform: rotate(2deg); } 60% { transform: rotate(-1deg); } 80% { transform: rotate(1deg); } }

.ipm-msg { margin: 10px 0 0; font-weight: 600; color: #B0174B; }
.ipm-msg:empty { display: none; }

/* ---------- added state ---------- */
.ipm-box.is-done > :not(.ipm-done) { display: none; }
.ipm-done { text-align: center; }
.ipm-done-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
.ipm-done-thumbs img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; border: 2px solid var(--ipm-ink); }
.ipm-done-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 14px; line-height: 1.1; }
.ipm .ipm-done .ipm-add { background: var(--ipm-grape); color: #fff; }
.ipm-again {
	margin-top: 12px;
	width: 100%;
	padding: 10px;
	border-radius: 999px;
	border: 2px solid var(--ipm-ink);
	background: var(--ipm-yellow);
	font-weight: 700;
	font-size: 1.05rem;
	cursor: pointer;
}
.ipm-cartlink { display: inline-block; margin-top: 10px; color: var(--ipm-ink); font-weight: 600; }

/* ---------- flying eraser + confetti (outside .ipm) ---------- */
.ipm-ghost {
	position: fixed;
	z-index: 99999;
	object-fit: contain;
	pointer-events: none;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 10px 24px rgba(46, 36, 89, .25);
	will-change: transform;
}
.ipm-confetti {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	z-index: 99998;
	display: none;
}
.ipm-confetti.is-on { display: block; }

/* ---------- shop buttons for singles ---------- */
.ipm-single-cta p { margin: 0 0 10px; font-size: 1.05rem; }
a.ipm-loop-btn { text-align: center; }

/* ---------- tablet & mobile: the box becomes a bottom bar ---------- */
@media (max-width: 1000px) {
	.ipm-head { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 900px) {
	.ipm-box { transform: none !important; }
	.ipm-layout { grid-template-columns: 1fr; gap: 0; padding-bottom: 210px; }
	.ipm-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
	.ipm-box {
		position: fixed;
		left: 8px;
		right: 8px;
		bottom: calc(8px + env(safe-area-inset-bottom, 0px));
		top: auto;
		z-index: 9999;
		padding: 10px 12px 12px;
		border-radius: 22px;
		box-shadow: 0 -4px 0 rgba(46,36,89,.08), 4px 4px 0 var(--ipm-ink);
	}
	.ipm-box-title { font-size: 1.15rem; }
	.ipm-progress { margin: 2px 0 8px; min-height: 0; font-size: .95rem; }
	.ipm-tray { grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 6px; border-radius: 14px; }
	.ipm-slot { border-radius: 8px; font-size: .75rem; padding: 2px; }
	.ipm-slot.is-filled::after { display: none; }
	.ipm-actions { margin: 8px 0; }
	.ipm-lucky, .ipm-clear { font-size: .85rem; padding: 6px 8px 4px; }
	.ipm .ipm-add { padding: 11px 12px 8px; font-size: 1.05rem; }
	.ipm-done-thumbs { grid-template-columns: repeat(10, 1fr); gap: 3px; }
	.ipm-done-title { font-size: 1.2rem; margin-bottom: 8px; }
	.ipm-again { margin-top: 8px; padding: 7px; }
}
@media (max-width: 640px) {
	.ipm-steps { gap: 8px; }
	.ipm-steps li { flex-direction: column; gap: 6px; padding: 10px; font-size: .82rem; }
	.ipm-step-n { flex-basis: auto; width: 26px; height: 26px; font-size: .9rem; }
	.ipm-head { margin-bottom: 22px; padding-bottom: 20px; }
	.ipm-sub { font-size: 1rem; }
}
@media (max-width: 420px) {
	.ipm-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.ipm-title { font-size: 2.3rem; }
	.ipm-plus { width: 32px; height: 32px; font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
	.ipm *, .ipm-ghost { animation: none !important; transition: none !important; }
}

#ipm .ipm-card-img img, #ipm .ipm-slot img, .ipm-done-thumbs img + * , .ipm-ghost { border-width: 0; }
#ipm .ipm-card-img img, #ipm .ipm-slot img { border: 0 !important; }

/* ---------- box size switcher ---------- */
.ipm-sizes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ipm .ipm-size {
	display: grid;
	grid-template-columns: auto auto;
	grid-template-areas: "n p" "e e";
	align-items: baseline;
	column-gap: 10px;
	padding: 8px 16px 6px;
	background: #fff;
	border: 3px solid var(--ipm-ink);
	border-radius: 16px;
	box-shadow: 3px 3px 0 var(--ipm-ink);
	cursor: pointer;
	text-align: left;
	transition: transform .1s, background-color .15s;
}
.ipm-size-n { grid-area: n; font-weight: 800; font-size: 1.05rem; }
.ipm-size-p { grid-area: p; font-weight: 800; font-size: 1.05rem; }
.ipm-size-e { grid-area: e; font-size: .82rem; font-weight: 600; opacity: .75; }
@media (hover: hover) { .ipm .ipm-size:not(.is-current):hover { background: var(--ipm-paper); transform: translateY(-1px); } }
.ipm .ipm-size.is-current { background: var(--ipm-yellow); cursor: default; }
.ipm .ipm-size.is-current .ipm-size-e { opacity: .9; }

/* bigger boxes: same slots as the box of 10, six per row */
.ipm-tray.ipm-tray--wide { grid-template-columns: repeat(6, 1fr); }
.ipm-tray.ipm-tray--tall { max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 900px) {
	/* phones: one row that scrolls sideways, so the bottom bar stays small */
	.ipm-tray.ipm-tray--wide { display: flex; overflow-x: auto; max-height: none; gap: 4px; padding: 6px; scroll-snap-type: x proximity; }
	.ipm-tray.ipm-tray--wide .ipm-slot { flex: 0 0 34px; height: 34px; aspect-ratio: auto; scroll-snap-align: start; }
}

/* free delivery badge under the intro */
.ipm-free {
	display: inline-flex; align-items: center; gap: 8px;
	margin: 14px 0 0; padding: 6px 14px 4px;
	background: #A9E8B4; border: 2px solid var(--ipm-ink); border-radius: 999px;
	font-weight: 800; font-size: .98rem;
}
.ipm-free span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ipm-ink); color: #fff; font-size: .7rem; padding-top: 1px; }

/* search box: the whole bar shows focus (pink shadow), so no inner outline box */
#ipm .ipm-search:focus, #ipm .ipm-search:focus-visible { outline: 0 !important; box-shadow: none !important; }
#ipm .ipm-searchbar:focus-within { box-shadow: 4px 4px 0 var(--ipm-pink); border-color: var(--ipm-ink); }

/* ---------- theme dropdown + search on one row ---------- */
.ipm-filterrow { display: flex; gap: 12px; align-items: stretch; }
.ipm-themebar { position: relative; flex: 0 0 auto; display: flex; }
.ipm .ipm-theme-select {
	appearance: none; -webkit-appearance: none;
	height: 60px; min-width: 200px; max-width: 280px; padding: 0 46px 0 20px; box-sizing: border-box;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%232E2459' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 18px center;
	color: var(--ipm-ink); border: 3px solid var(--ipm-ink); border-radius: 999px; box-shadow: 4px 4px 0 var(--ipm-ink);
	font-family: inherit; font-size: 1.02rem; font-weight: 700; cursor: pointer;
}
.ipm .ipm-theme-select:focus { outline: 0; box-shadow: 4px 4px 0 var(--ipm-pink); }
.ipm-themebar.is-filtered .ipm-theme-select { background-color: var(--ipm-yellow); }
.ipm-filterrow .ipm-searchbar { flex: 1 1 auto; min-width: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) {
	.ipm-filterrow { flex-direction: column; gap: 10px; }
	.ipm .ipm-theme-select { width: 100%; max-width: none; height: 54px; }
}

/* ---------- heading: text left, steps + box sizes right ---------- */
.ipm-head { align-items: start !important; }
.ipm-head-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ipm-head-side .ipm-sizes { margin-top: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ipm-head-side .ipm-size { width: 100%; box-sizing: border-box; }
@media (max-width: 1000px) {
	.ipm-head-side { gap: 14px; }
}

/* size buttons in the side column: stacked so they never cramp */
.ipm-head-side .ipm-size {
	grid-template-columns: 1fr !important; grid-template-areas: "n" "p" "e" !important;
	justify-items: center; text-align: center; row-gap: 1px; padding: 8px 8px 7px !important;
}
.ipm-head-side .ipm-size-n { white-space: nowrap; font-size: .95rem; }
.ipm-head-side .ipm-size-p { white-space: nowrap; font-size: 1.25rem; line-height: 1.1; }
.ipm-head-side .ipm-size-e { white-space: nowrap; }
.ipm-head-side .ipm-sizes { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)) !important; }

.ipm-sizes[hidden] { display: none !important; }

/* sold-out designs: faded, can't be added */
.ipm-card.is-out { filter: grayscale(.55); opacity: .7; }
.ipm-card.is-out .ipm-card-hit { cursor: default; }
.ipm-card-stock.is-out { background: #fff; color: #8A5A00; border-color: #8A5A00; border-style: dashed; }
.ipm-card-stock.is-out::before { background: #F2B035; }

.ipm-head-text .ipm-safety { margin: 14px 0 0; }

/* Pick & Mix: names take two lines' space so stock labels line up */
.ipm-card-name { min-height: 2.3em; display: flex; align-items: flex-start; justify-content: center; }
