/* Card designer page */

.is-designer .page--narrow,
.is-designer .entry__content { max-width: none; }
.is-designer .page__title { max-width: 22ch; }

.cd [hidden] { display: none !important; }
.cd .ct [hidden] { display: none !important; }

.cd__form {
	display: grid;
	gap: 2rem;
	align-items: start;
}
@media (min-width: 960px) {
	.cd__form { grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 3rem; }
	.cd__preview { position: sticky; top: 1.2rem; }
}

/* Preview stage */
.cd__preview {
	background: var(--tint);
	border-radius: var(--panel);
	padding: clamp(1.2rem, 3vw, 2rem);
}
.cd__stage { display: grid; place-items: center; min-height: 12rem; }
.cd__stage .cw { width: 100%; }
.cd__stage--l .cw { max-width: 420px; }
.cd__stage--p .cw { max-width: 250px; }
.cd__stage .ct { box-shadow: 0 1px 0 rgba(15, 29, 26, 0.1), 0 22px 34px -18px rgba(15, 29, 26, 0.5); }
.cd__stage .is-empty { opacity: 0.45; }
.cd__note { margin: 1.1rem 0 0; font-size: 0.9rem; color: var(--muted); text-align: center; }

/* Panel */
.cd__panel { min-width: 0; }
.cd__h { font-size: 1.3rem; margin: 2.2rem 0 0.9rem; }
.cd__h:first-child { margin-top: 0; }

.cd__filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }

.cd__tiles {
	list-style: none; margin: 0; padding: 0.3rem;
	display: grid; gap: 0.9rem;
	grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
	max-height: 26rem; overflow-y: auto;
	align-items: end;
}
.cd__tile {
	display: block; width: 100%; padding: 0.45rem 0.45rem 0.6rem;
	background: #fff; border: 2px solid transparent; border-radius: 12px;
	font: inherit; color: inherit; text-align: center; cursor: pointer;
}
.cd__tile:hover { border-color: var(--line); }
.cd__tile[aria-pressed="true"] { border-color: var(--board); box-shadow: 0 0 0 3px rgba(12, 74, 62, 0.15); }
.cd__tile--portrait .cw { max-width: 74px; margin-inline: auto; }
.cd__tile .ct { box-shadow: 0 1px 0 rgba(15, 29, 26, 0.12); }
.cd__tname { display: block; margin-top: 0.4rem; font-size: 0.85rem; font-weight: 600; }

/* Fields */
.cd__grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cd__grid { grid-template-columns: 1fr 1fr; } }
.cd__f { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.cd__f input[type="text"],
.cd__f input[type="tel"],
.cd__f input[type="email"],
.cd__f input[type="url"],
.cd__f input[type="number"] {
	font: inherit; font-weight: 400; color: var(--ink);
	padding: 0.7rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
.cd__f input[type="file"] { font: inherit; font-weight: 400; padding: 0.45rem 0; max-width: 100%; }
.cd__f input:focus-visible { outline: 3px solid var(--board); outline-offset: 1px; }
.cd__f--handle { margin-top: 1rem; }
.cd__f--qty { margin-top: 1rem; max-width: 9rem; }
.cd__handle { display: flex; align-items: stretch; font-weight: 400; }
.cd__prefix {
	display: inline-flex; align-items: center; padding: 0 0.7rem; background: var(--tint);
	border: 1.5px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px;
	font-size: 0.9rem; color: var(--muted); white-space: nowrap;
}
.cd__handle input { border-radius: 0 10px 10px 0 !important; min-width: 0; }
.cd__hint { font-weight: 400; font-size: 0.88rem; color: var(--muted); }
.cd__hint.is-ok { color: #0a6b4a; }
.cd__hint.is-bad { color: #b3261e; }
#row-logo.is-off input { opacity: 0.5; }

.cd__colors { display: flex; flex-wrap: wrap; gap: 0.9rem 1.2rem; align-items: end; }
.cd__colors label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.95rem; }
.cd__colors input[type="color"] { width: 3.2rem; height: 2.6rem; padding: 0.15rem; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.cd__reset { font: inherit; background: none; border: 0; color: var(--board); text-decoration: underline; cursor: pointer; padding: 0.5rem 0; }

/* Products */
.cd__products { border: 0; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.cd__prod {
	display: grid; grid-template-columns: auto 1fr auto; gap: 0.2rem 0.8rem; align-items: center;
	padding: 0.85rem 1rem; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
}
.cd__prod:has(input:checked) { border-color: var(--board); box-shadow: 0 0 0 3px rgba(12, 74, 62, 0.12); }
.cd__prod input { width: 1.1rem; height: 1.1rem; accent-color: var(--board); }
.cd__pname { font-weight: 600; }
.cd__pprice { font-family: var(--f-display); font-weight: 700; }

.cd__error { margin: 1.2rem 0 0; padding: 0.8rem 1rem; background: #fdecea; color: #7a1710; border-radius: 10px; }
.cd__submit { margin-top: 1.4rem; width: 100%; justify-content: center; font-size: 1.1rem; padding: 1rem 1.4rem; }
@media (min-width: 640px) { .cd__submit { width: auto; min-width: 14rem; } }

@media (prefers-reduced-motion: reduce) {
	.cd * { transition: none !important; }
}

/* Mode switch and own-artwork upload */
.cd__modes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.4rem; }
.cd__lead { margin: 0 0 1rem; max-width: 60ch; }
.cd__spec { border-collapse: collapse; width: 100%; max-width: 38rem; margin: 0 0 1.2rem; font-size: 0.93rem; }
.cd__spec th, .cd__spec td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); font-weight: 400; }
.cd__spec th { font-weight: 600; }
.cd__f select { font: inherit; font-weight: 400; padding: 0.7rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.cd__upl {
	width: 100%; display: grid; place-items: center; text-align: center;
	background: #fff; border: 2px dashed var(--line); border-radius: 14px; color: var(--muted); overflow: hidden;
}
.cd__upl--l { max-width: 420px; aspect-ratio: 89.348 / 57.298; }
.cd__upl--p { max-width: 250px; aspect-ratio: 57.298 / 89.348; }
.cd__upl p { margin: 0; padding: 1rem; font-size: 0.95rem; }
.cd__upl img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cd__reorder { margin: 0 0 1.4rem; padding: 0.9rem 1.1rem; background: var(--tint); border-radius: 12px; max-width: 60ch; }

/* Chat designer */
.chat { border: 1.5px solid var(--line); border-radius: 16px; background: #fff; padding: 1rem; margin-bottom: 1.4rem; }
.chat__log { display: flex; flex-direction: column; gap: 0.6rem; max-height: 24rem; overflow-y: auto; padding: 0.2rem; scroll-behavior: smooth; }
.chat__b { max-width: 88%; padding: 0.65rem 0.9rem; border-radius: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.chat__b--bot { align-self: flex-start; background: var(--tint); border-bottom-left-radius: 4px; }
.chat__b--me { align-self: flex-end; background: var(--board); color: #fff; border-bottom-right-radius: 4px; }
.chat__b.is-typing { opacity: 0.6; letter-spacing: 0.15em; }
.chat__quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; min-height: 0.5rem; }
.chat__send { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.chat__send input { flex: 1; min-width: 0; font: inherit; padding: 0.7rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; }
.chat__send input:focus-visible { outline: 3px solid var(--board); outline-offset: 1px; }
.chat__tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 0.7rem; padding: 0.2rem; align-items: end; }
.chat__tiles .cd__tile { background: var(--tint); }
.chat__tiles .cd__tile--portrait .cw { max-width: 88px; margin-inline: auto; }
.chat__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.cd__wa { margin: 0.9rem 0 0; }
.cd [hidden] { display: none !important; }
