/* =========================================================
   Webitjo Invitations — the studio editor
   ========================================================= */

.wjs {
	--wjs-ink: #1B1A17;
	--wjs-muted: #857E72;
	--wjs-gold: #B8944F;
	--wjs-line: rgba(27, 26, 23, .13);
	--wjs-surface: #FFFDF9;
}

/* ---------- top bar ---------- */

.wjs-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--wjs-line);
}

.wjs-bar .wjd-back { margin: 0; }

.wjs-bar-mid {
	display: flex;
	align-items: center;
	gap: 7px;
	flex: 1;
	min-width: 0;
	font-size: .86rem;
	color: var(--wjs-muted);
}

.wjs-bar-title { color: var(--wjs-ink); }
.wjs-bar-sep { opacity: .5; }

.wjs-saved {
	margin-inline-start: auto;
	font-size: .76rem;
	color: var(--wjs-gold);
	opacity: 0;
	transition: opacity .3s ease;
}

.wjs-saved.is-on { opacity: 1; }

.wjs-bar-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.wjs-msg {
	margin: 0 0 14px;
	min-height: 1.2em;
	font-size: .88rem;
	color: var(--wjs-gold);
}

.wjs-msg.is-error { color: #A33A2E; }
.wjs-msg.is-ok { color: #2F4F4A; }

/* ---------- split layout ---------- */

.wjs-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 26px;
	align-items: start;
}

/* ---------- accordion sections ---------- */

.wjs-form { display: grid; gap: 11px; }

.wjs-sec {
	border: 1px solid var(--wjs-line);
	border-radius: 15px;
	background: var(--wjs-surface);
	overflow: hidden;
}

.wjs-sec > summary {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 15px 19px;
	font-size: .96rem;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.wjs-sec > summary::-webkit-details-marker { display: none; }

.wjs-sec > summary::after {
	content: '+';
	margin-inline-start: auto;
	color: var(--wjs-muted);
	font-size: 1.1rem;
	line-height: 1;
}

.wjs-sec[open] > summary::after { content: '−'; }

.wjs-sec[open] > summary { border-bottom: 1px solid var(--wjs-line); }

.wjs-sec.is-locked > summary { color: var(--wjs-muted); }

.wjs-lock {
	padding: 2px 9px;
	border-radius: 999px;
	background: rgba(184, 148, 79, .17);
	color: #8A6A22;
	font-size: .68rem;
}

.wjs-sec-body {
	display: grid;
	gap: 15px;
	padding: 19px;
}

.wjs-hr {
	margin: 4px 0;
	border: 0;
	border-top: 1px solid var(--wjs-line);
}

/* ---------- fields ---------- */

.wjs-f { display: block; }

.wjs-f > span {
	display: block;
	margin-bottom: 6px;
	font-size: .84rem;
	color: var(--wjs-muted);
}

.wjs-f > span em {
	font-style: normal;
	color: var(--wjs-gold);
	font-size: .92em;
}

.wjs-f input[type="text"],
.wjs-f input[type="tel"],
.wjs-f input[type="url"],
.wjs-f input[type="date"],
.wjs-f input[type="time"],
.wjs-f input[type="number"],
.wjs-f input[type="datetime-local"],
.wjs-f select,
.wjs-f textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--wjs-line);
	border-radius: 10px;
	background: #fff;
	color: var(--wjs-ink);
	font: inherit;
	font-size: .92rem;
	line-height: 1.6;
}

.wjs-f textarea {
	resize: vertical;
	min-height: 74px;
	line-height: 1.85;
}

.wjs-f input:focus,
.wjs-f select:focus,
.wjs-f textarea:focus {
	outline: none;
	border-color: var(--wjs-gold);
}

.wjs-f small {
	display: block;
	margin-top: 5px;
	color: var(--wjs-muted);
	font-size: .76rem;
	line-height: 1.6;
}

.wjs-f-narrow input { max-width: 120px; }

.wjs-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 13px;
	align-items: end;
}

.wjs-hint {
	margin: 0;
	color: var(--wjs-muted);
	font-size: .8rem;
	line-height: 1.7;
}

.wjs-hint a { color: var(--wjs-gold); }

/* ---------- toggles ---------- */

.wjs-toggle {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: .89rem;
	cursor: pointer;
}

.wjs-toggle input {
	flex: none;
	width: 17px;
	height: 17px;
	accent-color: var(--wjs-gold);
}

.wjs-toggle-inline { padding-bottom: 11px; }

.wjs-toggles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
	gap: 9px;
}

.wjs-mini-toggle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: .78rem;
	color: var(--wjs-muted);
	white-space: nowrap;
	cursor: pointer;
}

.wjs-mini-toggle input { accent-color: var(--wjs-gold); }

/* ---------- repeaters ---------- */

.wjs-rep { display: grid; gap: 8px; }

.wjs-rep:empty { display: none; }

.wjs-rep-row {
	display: flex;
	align-items: center;
	gap: 7px;
}

.wjs-rep-row input[type="text"],
.wjs-rep-row input[type="tel"],
.wjs-rep-row input[type="time"],
.wjs-rep-row select {
	min-width: 0;
	padding: 9px 12px;
	border: 1px solid var(--wjs-line);
	border-radius: 9px;
	background: #fff;
	color: var(--wjs-ink);
	font: inherit;
	font-size: .86rem;
}

.wjs-rep-row input:focus,
.wjs-rep-row select:focus {
	outline: none;
	border-color: var(--wjs-gold);
}

.wjs-rep-time { flex: none; width: 108px; }
.wjs-rep-icon { flex: none; width: 104px; }
.wjs-rep-label { flex: 1.3; }
.wjs-rep-note,
.wjs-rep-sub { flex: 1; }
.wjs-rep-name { flex: 1; }
.wjs-rep-phone { flex: none; width: 140px; }

.wjs-rep-del {
	flex: none;
	width: 30px;
	height: 30px;
	border: 1px solid var(--wjs-line);
	border-radius: 50%;
	background: transparent;
	color: var(--wjs-muted);
	font-size: 1.05rem;
	line-height: 1;
	cursor: pointer;
}

.wjs-rep-del:hover {
	border-color: rgba(163, 58, 46, .35);
	color: #A33A2E;
}

.wjs-rep-add { justify-self: start; font-size: .84rem; padding: 8px 16px; }

/* ---------- gallery + music ---------- */

.wjs-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
	gap: 8px;
}

.wjs-gallery:empty { display: none; }

.wjs-shot {
	position: relative;
	margin: 0;
	aspect-ratio: 1;
	border-radius: 9px;
	overflow: hidden;
	background: rgba(27, 26, 23, .05);
}

.wjs-shot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wjs-shot-del {
	position: absolute;
	top: 4px;
	inset-inline-end: 4px;
	width: 21px;
	height: 21px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: .82rem;
	line-height: 1;
	cursor: pointer;
}

.wjs-music {
	display: flex;
	align-items: center;
	gap: 11px;
	flex-wrap: wrap;
	font-size: .85rem;
	color: var(--wjs-muted);
}

/* ---------- custom link ---------- */

.wjs-slug {
	display: flex;
	align-items: stretch;
	gap: 6px;
	flex-wrap: wrap;
}

.wjs-slug-base {
	display: flex;
	align-items: center;
	padding: 0 11px;
	border: 1px solid var(--wjs-line);
	border-radius: 10px;
	background: rgba(27, 26, 23, .04);
	color: var(--wjs-muted);
	font-size: .78rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.wjs-slug input {
	flex: 1;
	min-width: 130px;
	padding: 11px 14px;
	border: 1px solid var(--wjs-line);
	border-radius: 10px;
	background: #fff;
	color: var(--wjs-ink);
	font: inherit;
	font-size: .92rem;
	text-align: left;
}

.wjs-slug input:focus {
	outline: none;
	border-color: var(--wjs-gold);
}

.wjs-slug .wjd-btn {
	flex: none;
	padding: 8px 18px;
	font-size: .84rem;
}

.wjs-slug-msg {
	margin: 9px 0 0;
	min-height: 1.2em;
	font-size: .82rem;
}

.wjs-slug-msg.is-ok { color: #2F4F4A; }
.wjs-slug-msg.is-error { color: #A33A2E; }
.wjs-slug-msg.is-wait { color: var(--wjs-muted); }

.wjs-slug-current {
	display: flex;
	gap: 6px;
	margin-top: 11px;
}

.wjs-slug-current input {
	flex: 1;
	min-width: 0;
	padding: 9px 12px;
	border: 1px solid var(--wjs-line);
	border-radius: 9px;
	background: rgba(27, 26, 23, .03);
	color: var(--wjs-muted);
	font: inherit;
	font-size: .78rem;
	text-align: left;
}

.wjs-linky {
	border: 0;
	background: none;
	padding: 0;
	color: var(--wjs-gold);
	font: inherit;
	font-size: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- template strip ---------- */

.wjs-tpl-strip {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 9px;
}

.wjs-tpl {
	aspect-ratio: 9 / 13;
	display: grid;
	place-items: center;
	padding: 10px 7px;
	border: 1px solid var(--wjs-line);
	border-radius: 11px;
	font-size: .78rem;
	line-height: 1.5;
	text-align: center;
	cursor: pointer;
	transition: box-shadow .18s ease;
}

.wjs-tpl:hover { box-shadow: 0 0 0 2px var(--wjs-gold); }

.wjs-tpl.is-active { box-shadow: 0 0 0 2px var(--wjs-ink); }

.wjs-tpl.is-locked {
	opacity: .45;
	cursor: not-allowed;
}

/* ---------- preview ---------- */

.wjs-preview {
	position: sticky;
	top: 24px;
	display: grid;
	gap: 11px;
	justify-items: center;
}

.wjs-phone {
	position: relative;
	width: 100%;
	max-width: 320px;
	aspect-ratio: 9 / 17;
	padding: 11px 7px;
	border: 1px solid var(--wjs-line);
	border-radius: 30px;
	background: #1B1A17;
	overflow: hidden;
	box-shadow: 0 18px 46px rgba(27, 26, 23, .18);
}

.wjs-phone-notch {
	position: absolute;
	top: 5px;
	left: 50%;
	transform: translateX(-50%);
	width: 52px;
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .28);
	z-index: 2;
}

.wjs-phone iframe {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 21px;
	background: #F7F4EE;
	display: block;
}

.wjs-refresh { font-size: .82rem; padding: 8px 18px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
	.wjs-split { grid-template-columns: 1fr; }

	.wjs-preview {
		position: static;
		order: -1;
		margin-bottom: 6px;
	}

	.wjs-phone { max-width: 260px; }
	.wjs-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
	.wjs-rep-row {
		flex-wrap: wrap;
		padding: 11px;
		border: 1px solid var(--wjs-line);
		border-radius: 11px;
	}

	.wjs-rep-row > input,
	.wjs-rep-row > select { flex: 1 1 100%; }
	.wjs-rep-time,
	.wjs-rep-icon,
	.wjs-rep-phone { width: auto; }
	.wjs-rep-del { margin-inline-start: auto; }
	.wjs-bar-actions { width: 100%; }
	.wjs-bar-actions .wjd-btn { flex: 1; }
}

/* ---------- placeholders read as hints, never as filled values ---------- */
/* wjs-placeholder-tone */

.wjs input::placeholder,
.wjs textarea::placeholder,
.wjs-slug input::placeholder {
	color: var(--wjs-muted);
	opacity: .55;
}
