/* Nametag maker. Builds on /style.css (fonts, page background, card). */

:root {
	--navy: #192933;
	--blue: #1583bd;
	--blue-dark: #0f6896;
	--blue-tint: #e6f2f9;
	--slate: #34627b;
	--green: #abd034;
	--ink: #333;
	--muted: #66737b;
	--line: #dde2e5;
	--field: #eee;
	--panel: #f5f6f7;
	--stage: #e7ebee;
	--danger: #b3261e;
	--radius: 10px;
}

/* ---------- page frame ---------- */

div.wrapper.nt-wrapper {
	width: min(1320px, 100% - 40px);
	@media screen and (max-width: 800px) {
		width: 100%;
	}
}
div.main.nt-main {
	width: 100%;
	padding: 0;
	@media screen and (max-width: 800px) {
		padding: 0;
		border-radius: 0;
	}
}
.nt-main :is(button, input, select, textarea) {
	font-family: "Open Sans", sans-serif;
	color: inherit;
}
.nt-main :focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.icon {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

/* ---------- top bar with the steps ---------- */

.nt-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--line);
	@media screen and (max-width: 900px) {
		flex-wrap: wrap;
		padding: 12px;
	}
}
.steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 4px;

	li {
		display: flex;
		align-items: center;
	}
	li + li::before {
		content: "";
		width: 28px;
		height: 1px;
		background: var(--line);
		margin: 0 4px;
		@media screen and (max-width: 700px) {
			width: 8px;
		}
	}
}
.step-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	background: none;
	border: none;
	padding: 6px 14px 6px 6px;
	border-radius: 50px;
	cursor: pointer;
	text-align: left;

	&:hover {
		background: var(--panel);
	}
	.step-num {
		width: 34px;
		height: 34px;
		border-radius: 50%;
		display: grid;
		place-items: center;
		font-family: "Oswald", sans-serif;
		font-size: 17px;
		border: 1px solid #9aa5ab;
		color: var(--muted);
		flex-shrink: 0;
	}
	.step-text {
		font-family: "Oswald", sans-serif;
		font-weight: 400;
		font-size: 18px;
		line-height: 1.2;
		color: var(--ink);
	}
	&[aria-current="step"] {
		background: var(--blue-tint);
		.step-num {
			background: var(--blue);
			border-color: var(--blue);
			color: #fff;
		}
		.step-text {
			color: var(--blue-dark);
		}
	}
	@media screen and (max-width: 700px) {
		padding: 4px;
		gap: 6px;
		.step-text {
			font-size: 15px;
		}
		.step-num {
			width: 28px;
			height: 28px;
			font-size: 15px;
		}
	}
}

.bar-tools {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 4px;
}
.save-status {
	font-size: 13px;
	color: var(--muted);
	margin-right: 10px;
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;

	&::before {
		content: "";
		width: 7px;
		height: 7px;
		border-radius: 50%;
		background: var(--green);
	}
	&[data-state="saving"]::before {
		background: #c9d3d8;
	}
	&[data-state="error"] {
		color: var(--danger);
		white-space: normal;
		&::before {
			background: var(--danger);
		}
	}
	@media screen and (max-width: 1100px) {
		&:not([data-state="error"]) {
			font-size: 0;
			margin-right: 4px;
		}
	}
}

.icon-btn {
	width: 36px;
	height: 36px;
	display: inline-grid;
	place-items: center;
	border: none;
	background: none;
	border-radius: 50%;
	cursor: pointer;
	color: var(--ink);
	padding: 0;
	&:hover:not(:disabled) {
		background: var(--panel);
	}
	&:active:not(:disabled) {
		background: var(--line);
	}
	&:disabled {
		opacity: 0.3;
		cursor: default;
	}
}

.menu-wrap {
	position: relative;
}
.menu {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 30;
	width: 290px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 12px 32px rgba(25, 41, 51, 0.18);
	padding: 6px;
	display: flex;
	flex-direction: column;
	&[hidden] {
		display: none;
	}
}
.menu-item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	border: none;
	background: none;
	padding: 9px 12px;
	border-radius: 6px;
	cursor: pointer;
	strong {
		font-weight: 600;
		font-size: 14px;
	}
	small {
		font-size: 12.5px;
		color: var(--muted);
	}
	&:hover {
		background: var(--panel);
	}
}
.menu-danger strong {
	color: var(--danger);
}
.menu-group {
	padding: 10px 12px;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	margin: 4px 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
}

.nt-banner {
	margin: 0;
	padding: 10px 20px;
	font-size: 14px;
	background: var(--blue-tint);
	color: var(--blue-dark);
	border-bottom: 1px solid var(--line);
	&[data-kind="error"] {
		background: #fbeceb;
		color: var(--danger);
	}
	&[hidden] {
		display: none;
	}
}
.menu-item[hidden] {
	display: none;
}
.nt-dialog code {
	font-size: 12.5px;
	word-break: break-all;
	color: var(--ink);
}

/* ---------- buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 8px 18px;
	font-size: 15px;
	line-height: 1.3;
	border: 1px solid #555;
	border-radius: 50px;
	background: #fff;
	color: var(--ink);
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;

	&:hover:not(:disabled) {
		background: var(--panel);
	}
	&:active:not(:disabled) {
		background: var(--line);
	}
	&:disabled {
		opacity: 0.45;
		cursor: default;
	}
}
.btn-primary {
	background: var(--blue);
	border-color: var(--blue);
	color: #fff !important;
	font-weight: 600;
	&:hover:not(:disabled) {
		background: var(--blue-dark);
	}
	&:active:not(:disabled) {
		background: #0b5379;
	}
}
.btn-danger {
	background: var(--danger);
	border-color: var(--danger);
	color: #fff !important;
	font-weight: 600;
	&:hover:not(:disabled) {
		background: #8f1e18;
	}
}
.btn-quiet {
	border-color: transparent;
	background: none;
}
.btn-danger-quiet {
	border-color: transparent;
	color: var(--danger) !important;
	&:hover:not(:disabled) {
		background: #fbeceb;
	}
}
.btn-big {
	padding: 11px 26px;
	font-size: 16px;
}
.btn-small {
	padding: 5px 13px;
	font-size: 13.5px;
}
.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.link-btn {
	border: none;
	background: none;
	padding: 0;
	color: var(--blue-dark);
	text-decoration: underline;
	font-size: inherit;
	cursor: pointer;
	font-weight: 600;
}

/* ---------- form controls ---------- */

.fld {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}
.fld-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
}
.fld-hint {
	font-size: 13px;
	color: var(--muted);
	margin: 0;
	line-height: 1.45;
	&.tight {
		margin-top: -4px;
	}
}
.inp {
	width: 100%;
	font-size: 15px;
	padding: 9px 11px;
	background: var(--field);
	border: 1px solid transparent;
	border-radius: 6px;
	outline: none;
	&:hover {
		border-color: #d6d6d6;
	}
	&:focus {
		background: #fff;
		border-color: var(--blue);
	}
	@media screen and (max-width: 600px) {
		font-size: 16px;
	}
}
select.inp {
	appearance: none;
	padding-right: 34px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	cursor: pointer;
	&:focus {
		background-color: #fff;
	}
}
textarea.inp {
	resize: vertical;
	line-height: 1.5;
}

.num-wrap {
	position: relative;
	display: block;
	input {
		width: 100%;
		font-size: 15px;
		padding: 9px 11px;
		background: var(--field);
		border: 1px solid transparent;
		border-radius: 6px;
		outline: none;
		&:hover {
			border-color: #d6d6d6;
		}
		&:focus {
			background: #fff;
			border-color: var(--blue);
		}
	}
	&.has-suffix input {
		padding-right: 36px;
	}
	.num-suffix {
		position: absolute;
		right: 11px;
		top: 50%;
		transform: translateY(-50%);
		font-size: 13px;
		color: var(--muted);
		pointer-events: none;
	}
	input::-webkit-inner-spin-button {
		margin-right: 26px;
	}
}

.seg {
	display: flex;
	background: var(--field);
	border-radius: 50px;
	padding: 3px;
	gap: 2px;

	button {
		flex: 1;
		border: none;
		background: none;
		padding: 6px 12px;
		border-radius: 50px;
		font-size: 14px;
		cursor: pointer;
		color: var(--muted);
		display: grid;
		place-items: center;
		&:hover {
			color: var(--ink);
		}
		&[aria-checked="true"] {
			background: #fff;
			color: var(--ink);
			box-shadow: 0 0 0 1px #555;
		}
	}
	&.seg-icons button {
		padding: 6px;
	}
}

.check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 14.5px;
	line-height: 1.4;
	position: relative;

	input {
		position: absolute;
		opacity: 0;
		width: 20px;
		height: 20px;
		margin: 0;
	}
	.check-box {
		width: 20px;
		height: 20px;
		border-radius: 5px;
		border: 1.5px solid #8b979e;
		background: #fff;
		flex-shrink: 0;
		display: grid;
		place-items: center;
		margin-top: 1px;
	}
	input:checked + .check-box {
		background: var(--blue);
		border-color: var(--blue);
		&::after {
			content: "";
			width: 5px;
			height: 10px;
			border: solid #fff;
			border-width: 0 2px 2px 0;
			transform: translateY(-1px) rotate(45deg);
		}
	}
	input:focus-visible + .check-box {
		outline: 2px solid var(--blue);
		outline-offset: 2px;
	}
	.check-text {
		display: flex;
		flex-direction: column;
		small {
			font-size: 13px;
			color: var(--muted);
		}
	}
}
.check-small {
	font-size: 14px;
}

.swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}
.swatch {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.18);
	cursor: pointer;
	padding: 0;
	position: relative;
	&[aria-pressed="true"] {
		box-shadow:
			0 0 0 2px #fff,
			0 0 0 4px var(--blue);
	}
}
.swatch-custom {
	background: conic-gradient(#e94b4b, #f5c542, #6bd16b, #42b6e6, #6b5be9, #e94bb8, #e94b4b);
	display: block;
	overflow: hidden;
	&[aria-pressed="true"] {
		background: var(--c);
	}
	&[aria-pressed="true"]::after {
		content: "";
		position: absolute;
		inset: 8px;
		border-radius: 50%;
		background: conic-gradient(#e94b4b, #f5c542, #6bd16b, #42b6e6, #6b5be9, #e94bb8, #e94b4b);
		opacity: 0.9;
	}
	input {
		opacity: 0;
		width: 100%;
		height: 100%;
		cursor: pointer;
		position: absolute;
		inset: 0;
	}
	&:focus-within {
		outline: 2px solid var(--blue);
		outline-offset: 3px;
	}
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: -4px;
}
.chip {
	border: 1px dashed #8b979e;
	background: #fff;
	border-radius: 50px;
	padding: 3px 11px;
	font-size: 13px;
	cursor: pointer;
	&:hover {
		border-style: solid;
		border-color: var(--blue);
		color: var(--blue-dark);
	}
}

/* ---------- steps ---------- */

.step {
	position: relative;
	&[hidden] {
		display: none;
	}
}
.step-foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	border-top: 1px solid var(--line);
	@media screen and (max-width: 600px) {
		padding: 12px;
		.btn-big {
			padding: 10px 16px;
			font-size: 15px;
		}
	}
}

/* dropping a file onto a step */
.drop-hint {
	display: none;
}
.step.dropping .drop-hint {
	display: grid;
	place-items: center;
	position: absolute;
	inset: 8px;
	z-index: 40;
	border: 3px dashed var(--blue);
	border-radius: var(--radius);
	background: rgba(230, 242, 249, 0.92);
	font-family: "Oswald", sans-serif;
	font-size: 26px;
	color: var(--blue-dark);
	pointer-events: none;
}

/* ---------- design step ---------- */

.design-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	height: clamp(560px, calc(100vh - 230px), 860px);
	@media screen and (max-width: 900px) {
		grid-template-columns: 1fr;
		height: auto;
	}
}
.stage-col {
	display: flex;
	flex-direction: column;
	padding: 20px;
	gap: 12px;
	min-width: 0;
	@media screen and (max-width: 600px) {
		padding: 12px;
	}
}
.stage {
	position: relative;
	flex: 1;
	min-height: 300px;
	border-radius: var(--radius);
	background-color: var(--stage);
	background-image: radial-gradient(circle, rgba(25, 41, 51, 0.13) 1px, transparent 1.2px);
	background-size: 18px 18px;
	display: grid;
	place-items: center;
	overflow: hidden;
	touch-action: none;
	@media screen and (max-width: 900px) {
		flex: none;
		height: 50vh;
		min-height: 260px;
		max-height: 520px;
	}
}
.tag-frame {
	position: relative;
	box-shadow:
		0 1px 2px rgba(25, 41, 51, 0.12),
		0 10px 30px rgba(25, 41, 51, 0.16);
}
.tag-scale {
	transform-origin: 0 0;
	position: absolute;
	top: 0;
	left: 0;
}
.tag-overlay {
	position: absolute;
	inset: 0;
}

.ov-box {
	position: absolute;
	cursor: move;
	outline: 1px dashed rgba(21, 131, 189, 0.55);
	outline-offset: 0;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
	touch-action: none;
	&:hover {
		outline: 1px solid var(--blue);
	}
	&:focus-visible {
		outline: 2px solid var(--blue);
		outline-offset: 0;
	}
	&.selected {
		outline: 2px solid var(--blue);
		box-shadow:
			0 0 0 3px rgba(255, 255, 255, 0.85),
			inset 0 0 0 1px rgba(255, 255, 255, 0.85);
	}
	&.overflow {
		outline: 2px solid var(--danger);
	}
}
.ov-tag {
	position: absolute;
	bottom: calc(100% + 4px);
	left: -2px;
	background: var(--blue);
	color: #fff;
	font-size: 11.5px;
	line-height: 1;
	padding: 4px 7px;
	border-radius: 4px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ov-box:hover .ov-tag,
.ov-box.selected .ov-tag {
	opacity: 1;
}
.ov-warn {
	position: absolute;
	top: calc(100% + 4px);
	left: -2px;
	background: var(--danger);
	color: #fff;
	font-size: 11.5px;
	padding: 3px 7px;
	border-radius: 4px;
	white-space: nowrap;
	pointer-events: none;
}
.handle {
	position: absolute;
	width: 12px;
	height: 12px;
	background: #fff;
	border: 2px solid var(--blue);
	border-radius: 3px;
	z-index: 1;
	&.h-n,
	&.h-s {
		left: calc(50% - 6px);
		cursor: ns-resize;
	}
	&.h-e,
	&.h-w {
		top: calc(50% - 6px);
		cursor: ew-resize;
	}
	&.h-n,
	&.h-ne,
	&.h-nw {
		top: -7px;
	}
	&.h-s,
	&.h-se,
	&.h-sw {
		bottom: -7px;
	}
	&.h-e,
	&.h-ne,
	&.h-se {
		right: -7px;
	}
	&.h-w,
	&.h-nw,
	&.h-sw {
		left: -7px;
	}
	&.h-ne,
	&.h-sw {
		cursor: nesw-resize;
	}
	&.h-nw,
	&.h-se {
		cursor: nwse-resize;
	}
	/* bigger touch targets */
	&::after {
		content: "";
		position: absolute;
		inset: -8px;
	}
}
.guide {
	position: absolute;
	pointer-events: none;
	background: #e2398a;
	z-index: 2;
	&.guide-v {
		top: -12px;
		bottom: -12px;
		width: 1px;
	}
	&.guide-h {
		left: -12px;
		right: -12px;
		height: 1px;
	}
}

.stage-foot {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	#add-text-btn {
		margin-left: auto;
	}
}
.stage-help {
	margin: 0;
	font-size: 13px;
	color: var(--muted);
	@media (pointer: coarse) {
		display: none;
	}
}
.preview-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	min-height: 40px;
}
.preview-empty {
	margin: 0;
	font-size: 14px;
	color: var(--muted);
}
.preview-label {
	font-size: 14px;
	color: var(--muted);
}
.stepper {
	display: flex;
	align-items: center;
	background: var(--panel);
	border-radius: 50px;
	padding: 2px;
}
.stepper-text {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 150px;
	max-width: 240px;
	line-height: 1.2;
	padding: 0 4px;
	strong {
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 100%;
	}
	small {
		font-size: 12px;
		color: var(--muted);
	}
}

/* settings panel on the right */
.inspector {
	border-left: 1px solid var(--line);
	background: #fff;
	overflow-y: auto;
	min-height: 0;
	scrollbar-width: thin;
	@media screen and (max-width: 900px) {
		border-left: none;
		border-top: 1px solid var(--line);
		overflow: visible;
	}
}
.insp-head {
	padding: 18px 20px 14px;
	h2 {
		text-decoration: none;
		font-size: 26px;
		font-weight: 400;
		margin: 0;
	}
	p {
		margin: 2px 0 0;
		font-size: 14px;
		color: var(--muted);
	}
}
.back-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border: none;
	background: none;
	padding: 4px 8px 4px 2px;
	margin: -4px 0 4px -2px;
	font-size: 14px;
	color: var(--blue-dark);
	cursor: pointer;
	border-radius: 6px;
	&:hover {
		background: var(--blue-tint);
	}
}
.insp-section {
	padding: 16px 20px 18px;
	border-top: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	gap: 14px;
	h3 {
		font-size: 19px;
		font-weight: 400;
		color: var(--navy);
	}
}
.insp-actions {
	padding: 16px 20px 24px;
	border-top: 1px solid var(--line);
}
.pair {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	> .fld {
		flex: 1;
	}
	.pair-x {
		padding-bottom: 10px;
		color: var(--muted);
	}
	&.pair-4 {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 12px 10px;
	}
}
.lock-btn {
	margin-bottom: 2px;
	color: var(--muted);
	&[aria-pressed="true"] {
		color: var(--blue-dark);
		background: var(--blue-tint);
	}
}
.size-row {
	display: grid;
	grid-template-columns: 110px 1fr;
	align-items: end;
	gap: 14px;
	.size-slider {
		padding-bottom: 12px;
	}
}
input[type="range"] {
	width: 100%;
	accent-color: var(--blue);
}
.range-fld .fld-label {
	display: flex;
	justify-content: space-between;
	output {
		font-weight: 400;
		color: var(--muted);
	}
}
.align-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.example {
	background: var(--panel);
	border-radius: 8px;
	padding: 8px 12px;
	display: flex;
	gap: 12px;
	align-items: baseline;
	margin-top: -6px;
	span {
		font-size: 12.5px;
		color: var(--muted);
	}
	p {
		margin: 0;
		white-space: pre-line;
		font-weight: 600;
		font-size: 14.5px;
		line-height: 1.35;
	}
}
details.more {
	border-radius: 8px;
	summary {
		cursor: pointer;
		font-size: 14px;
		font-weight: 600;
		color: var(--blue-dark);
		padding: 4px 0;
	}
	.more-body {
		display: flex;
		flex-direction: column;
		gap: 14px;
		padding-top: 10px;
	}
}

.field-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.field-item {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 12px;
	text-align: left;
	border: 1px solid var(--line);
	background: #fff;
	border-radius: 8px;
	padding: 9px 10px;
	cursor: pointer;
	&:hover {
		border-color: var(--blue);
		background: var(--blue-tint);
	}
	.field-item-num {
		width: 24px;
		height: 24px;
		border-radius: 50%;
		background: var(--panel);
		display: grid;
		place-items: center;
		font-size: 13px;
		font-weight: 600;
		flex-shrink: 0;
	}
	.field-item-text {
		flex: 1;
		min-width: 0;
		display: flex;
		flex-direction: column;
		strong {
			font-size: 14.5px;
			font-weight: 600;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}
		small {
			font-size: 12.5px;
			color: var(--muted);
		}
	}
	.icon {
		color: var(--muted);
	}
}

.bg-drop {
	display: flex;
	gap: 8px;
	align-items: center;
	&:not(.has-bg) {
		display: block;
	}
}
.bg-drop-btn {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 18px 16px;
	border: 2px dashed #b7c1c7;
	border-radius: var(--radius);
	background: var(--panel);
	cursor: pointer;
	color: var(--ink);
	.icon {
		color: var(--blue);
		margin-bottom: 4px;
	}
	strong {
		font-size: 15px;
		font-weight: 600;
	}
	small {
		font-size: 13px;
		color: var(--muted);
		line-height: 1.4;
		text-align: center;
	}
	&:hover {
		border-color: var(--blue);
		background: var(--blue-tint);
	}
}

/* font picker */
.font-picker {
	position: relative;
}
.font-btn {
	text-align: left;
	font-size: 19px !important;
	padding: 6px 34px 6px 11px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
}
.font-menu {
	position: absolute;
	z-index: 20;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 12px 32px rgba(25, 41, 51, 0.18);
	padding: 5px;
	max-height: 340px;
	overflow-y: auto;
}
.font-opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	text-align: left;
	border: none;
	background: none;
	padding: 8px 10px;
	font-size: 21px;
	border-radius: 6px;
	cursor: pointer;
	small {
		font-family: "Open Sans", sans-serif;
		font-size: 11.5px;
		color: var(--muted);
	}
	&:hover,
	&:focus-visible {
		background: var(--panel);
		outline: none;
	}
	&[aria-selected="true"] {
		background: var(--blue-tint);
		color: var(--blue-dark);
	}
	&.font-upload {
		font-family: "Open Sans", sans-serif !important;
		font-size: 14px;
		justify-content: flex-start;
		color: var(--blue-dark);
		border-top: 1px solid var(--line);
		border-radius: 0 0 6px 6px;
		margin-top: 4px;
	}
}

/* ---------- the tag itself (editor, preview and print) ---------- */

.nt-tag {
	position: relative;
	overflow: hidden;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}
.nt-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	user-select: none;
}
.nt-field {
	position: absolute;
	display: flex;
	flex-direction: column;
}
.nt-text {
	flex-shrink: 0;
	width: 100%;
	overflow-wrap: normal;
	word-break: normal;
	font-kerning: normal;
	font-synthesis: none;
	text-rendering: geometricPrecision;
}

/* ---------- names step ---------- */

.names-grid {
	display: grid;
	grid-template-columns: 360px minmax(0, 1fr);
	min-height: 560px;
	@media screen and (max-width: 900px) {
		grid-template-columns: 1fr;
	}
	h2 {
		font-size: 28px;
		font-weight: 300;
		margin: 0;
	}
}
.names-add {
	padding: 22px 24px 26px;
	border-right: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	gap: 10px;
	h2 {
		margin-bottom: 6px;
	}
	.paste {
		font-size: 15px;
		min-height: 180px;
	}
	@media screen and (max-width: 900px) {
		border-right: none;
		border-bottom: 1px solid var(--line);
		padding: 16px;
	}
}
.or {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--muted);
	font-size: 14px;
	margin: 8px 0;
	&::before,
	&::after {
		content: "";
		flex: 1;
		height: 1px;
		background: var(--line);
	}
}
.upload-btn {
	position: relative;
	padding: 11px 18px;
	input {
		position: absolute;
		inset: 0;
		opacity: 0;
		cursor: pointer;
		width: 100%;
	}
	&:focus-within {
		outline: 2px solid var(--blue);
		outline-offset: 2px;
	}
}

.names-list {
	padding: 22px 24px 26px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	@media screen and (max-width: 900px) {
		padding: 16px;
	}
}
.names-list-head {
	display: flex;
	align-items: baseline;
	gap: 14px;
	.count {
		font-size: 15px;
		color: var(--muted);
	}
}
.names-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	.spacer {
		flex: 1;
	}
	&[hidden] {
		display: none;
	}
}
.names-empty {
	border: 2px dashed var(--line);
	border-radius: var(--radius);
	padding: 50px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
	color: var(--muted);
	.icon {
		color: #a9b4ba;
		margin-bottom: 6px;
	}
	strong {
		color: var(--ink);
		font-size: 17px;
		font-weight: 600;
	}
	p {
		margin: 0 0 12px;
		max-width: 34ch;
		font-size: 14.5px;
	}
}
.table-scroll {
	overflow: auto;
	max-height: 560px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
table.names {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;

	th {
		position: sticky;
		top: 0;
		z-index: 1;
		background: var(--panel);
		text-align: left;
		padding: 8px 6px 7px;
		border-bottom: 1px solid var(--line);
		vertical-align: top;
		small {
			display: block;
			font-weight: 400;
			font-size: 12px;
			padding: 2px 6px 0;
		}
		.col-used {
			color: var(--blue-dark);
		}
		.col-unused {
			color: var(--muted);
		}
	}
	.col-name {
		width: 100%;
		font-weight: 600;
		font-size: 14.5px;
		border: 1px solid transparent;
		background: none;
		padding: 3px 6px;
		border-radius: 5px;
		outline: none;
		&::placeholder {
			color: var(--ink);
		}
		&:hover {
			border-color: #ccd3d7;
			background: #fff;
		}
		&:focus {
			border-color: var(--blue);
			background: #fff;
		}
	}
	td {
		border-bottom: 1px solid #edf0f2;
		padding: 2px 4px;
		input {
			width: 100%;
			min-width: 120px;
			border: 1px solid transparent;
			background: none;
			padding: 6px 6px;
			font-size: 15px;
			border-radius: 5px;
			outline: none;
			&:hover {
				background: var(--panel);
			}
			&:focus {
				border-color: var(--blue);
				background: #fff;
			}
		}
	}
	tr:last-child td {
		border-bottom: none;
	}
	.num-col {
		width: 44px;
		text-align: right;
		color: #9aa5ab;
		font-size: 13px;
		padding-right: 6px;
		font-variant-numeric: tabular-nums;
	}
	.del-col {
		width: 44px;
		text-align: center;
		.icon-btn {
			width: 30px;
			height: 30px;
			color: var(--muted);
			opacity: 0;
		}
	}
	tr:hover .del-col .icon-btn,
	.del-col .icon-btn:focus-visible {
		opacity: 1;
	}
	@media (hover: none) {
		.del-col .icon-btn {
			opacity: 1;
		}
	}
}
.add-row {
	align-self: flex-start;
}

/* ---------- step 3: print ---------- */

.print-grid {
	display: grid;
	grid-template-columns: 380px minmax(0, 1fr);
	@media screen and (max-width: 900px) {
		grid-template-columns: 1fr;
	}
}
.print-side {
	border-right: 1px solid var(--line);
	@media screen and (max-width: 900px) {
		border-right: none;
	}
}
.print-summary {
	padding: 20px 20px 4px;
	p {
		margin: 0 0 6px;
		font-size: 14.5px;
		line-height: 1.45;
	}
	.summary-big {
		font-size: 17px;
		strong {
			font-family: "Oswald", sans-serif;
			font-weight: 400;
			font-size: 34px;
			color: var(--blue-dark);
			line-height: 1;
			vertical-align: -3px;
		}
		small {
			display: block;
			font-size: 13.5px;
			color: var(--muted);
		}
	}
	.summary-note,
	.summary-tip {
		font-size: 13.5px;
		color: var(--muted);
		background: var(--panel);
		border-radius: 8px;
		padding: 8px 11px;
		margin-top: 10px;
	}
	.summary-tip {
		background: var(--blue-tint);
		color: var(--ink);
	}
}
.print-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px 20px 16px;
	.btn {
		width: 100%;
	}
	[hidden] {
		display: none;
	}
}
.print-tip {
	margin: 0 20px 16px;
	font-size: 14px;
	summary {
		cursor: pointer;
		color: var(--blue-dark);
		font-weight: 600;
	}
	ul {
		margin: 8px 0 0;
		padding-left: 18px;
		display: flex;
		flex-direction: column;
		gap: 5px;
		line-height: 1.45;
	}
}
.print-preview-wrap {
	background: var(--stage);
	min-width: 0;
	@media screen and (min-width: 901px) {
		border-radius: 0 0 0 0;
	}
}
.print-preview {
	padding: 28px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 26px;
	min-height: 100%;
	@media screen and (max-width: 600px) {
		padding: 16px 12px;
	}
}
.sheet-preview {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	figcaption {
		font-size: 13px;
		color: var(--muted);
	}
}
.sheet-paper {
	background: #fff;
	box-shadow:
		0 1px 2px rgba(25, 41, 51, 0.12),
		0 8px 24px rgba(25, 41, 51, 0.14);
	overflow: hidden;
	position: relative;
}
.print-empty {
	max-width: 400px;
	text-align: center;
	padding: 60px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	strong {
		font-size: 18px;
		font-weight: 600;
	}
	p {
		margin: 0 0 10px;
		color: var(--muted);
		font-size: 14.5px;
	}
}

/* a page of tags, at real size */
.sheet {
	position: relative;
	background: #fff;
	overflow: hidden;
}
.sheet-cell {
	position: absolute;
}
.cut-outline::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 0.5pt solid #b5b5b5;
	pointer-events: none;
}
.crop-marks {
	position: absolute;
	inset: 0;
	pointer-events: none;
	line {
		stroke: #777;
		stroke-width: 0.007;
	}
}

/* ---------- dialogs and messages ---------- */

.nt-dialog {
	border: none;
	border-radius: 14px;
	padding: 24px;
	width: min(440px, calc(100% - 32px));
	font-family: "Open Sans", sans-serif;
	color: var(--ink);
	text-align: left;
	box-shadow: 0 20px 60px rgba(25, 41, 51, 0.35);
	&::backdrop {
		background: rgba(25, 41, 51, 0.55);
	}
	h3 {
		font-size: 24px;
		font-weight: 400;
		margin-bottom: 8px;
	}
	p {
		margin: 0 0 20px;
		line-height: 1.5;
		font-size: 15px;
	}
	.dialog-actions {
		display: flex;
		justify-content: flex-end;
		flex-wrap: wrap;
		gap: 8px;
	}
	button {
		font-family: "Open Sans", sans-serif;
	}
}

#nt-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translate(-50%, 20px);
	background: var(--navy);
	color: #fff;
	font-family: "Open Sans", sans-serif;
	font-size: 14.5px;
	padding: 11px 18px;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 0.2s,
		transform 0.2s;
	z-index: 100;
	max-width: calc(100% - 32px);
	text-align: center;
	&.show {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}
@media (prefers-reduced-motion: reduce) {
	#nt-toast {
		transition: none;
	}
}

/* ---------- printing ---------- */

#print-root {
	display: none;
}
body.is-printing #print-root {
	display: block;
	position: absolute;
	left: -10000px;
	top: 0;
}

@media print {
	html,
	body {
		background: #fff !important;
		margin: 0 !important;
		padding: 0 !important;
		display: block !important;
	}
	body > *:not(#print-root) {
		display: none !important;
	}
	#print-root {
		display: block !important;
		position: static !important;
	}
	#print-root .sheet {
		break-after: page;
		page-break-after: always;
	}
	#print-root .sheet:last-child {
		break-after: auto;
		page-break-after: auto;
	}
}
