/* Keypad engraving and finish studio */

.ks-hero {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
}

.ks-hero-actions {
	flex-shrink: 0;
}

.ks-btn-solid {
	background: var(--ink);
	color: var(--paper);
}

.ks-btn-solid:hover {
	background: #222;
	color: var(--paper);
}

.ks-btn-sm {
	height: 30px;
	padding: 0 10px;
	font-size: 11px;
}

.ks-workspace {
	display: grid;
	grid-template-columns: 368px minmax(0, 1fr);
	gap: 32px;
	padding-top: 28px;
	align-items: start;
}

.ks-rail {
	grid-column: 1;
	grid-row: 1;
	gap: 20px;
}

.ks-stage-col {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

.ks-mobile-bar,
.ks-mobile-tabs,
.ks-mobile-wall-panel {
	display: none;
}

.ks-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ks-section-engrave {
	padding-top: 12px;
	border-top: 1px solid var(--rule);
}

.ks-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.ks-mono-meta {
	font-family: "Chivo Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11px;
	line-height: 14px;
	color: var(--ink-dim);
}

.ks-mono-ink {
	color: var(--ink);
}

.ks-segmented {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border: 1px solid rgb(10 10 10 / 20%);
}

.ks-seg-btn {
	height: 34px;
	border: 0;
	border-left: 1px solid var(--rule);
	background: var(--paper);
	color: var(--ink-dim);
	font-family: inherit;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
}

.ks-seg-btn:first-child {
	border-left: 0;
}

.ks-seg-btn[aria-pressed="true"] {
	background: var(--ink);
	color: var(--paper);
	font-weight: 600;
}

.ks-layout-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

.ks-pill-btn {
	height: 32px;
	border: 1px solid rgb(10 10 10 / 18%);
	background: var(--paper);
	color: var(--ink-dim);
	font-family: inherit;
	font-size: 12px;
	cursor: pointer;
}

.ks-pill-btn[aria-pressed="true"] {
	border-color: var(--ink);
	background: var(--ink);
	color: var(--paper);
	font-weight: 600;
}

.ks-finish-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

.ks-finish-btn {
	height: 36px;
	padding: 4px 5px;
	display: flex;
	align-items: flex-end;
	border: 1px solid rgb(10 10 10 / 22%);
	cursor: pointer;
	font-family: "Chivo Mono", ui-monospace, monospace;
	font-size: 9px;
	line-height: 11px;
	text-align: left;
}

.ks-finish-btn[aria-pressed="true"] {
	outline: 2px solid var(--poppy);
	outline-offset: -1px;
	font-weight: 600;
}

.ks-spec-link {
	font-size: 12px;
	line-height: 16px;
	color: var(--ink-dim);
	text-decoration: underline;
	text-underline-offset: 2px;
	padding-top: 2px;
}

.ks-spec-link:hover {
	color: var(--ink);
}

.ks-engrave-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ks-engrave-row {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid rgb(10 10 10 / 18%);
	padding: 0 10px;
	height: 38px;
	background: var(--paper);
}

.ks-engrave-row.is-active {
	border-color: var(--ink);
	border-width: 1.5px;
}

.ks-engrave-pos {
	width: 16px;
	flex-shrink: 0;
	font-family: "Chivo Mono", ui-monospace, monospace;
	font-size: 11px;
	color: var(--ink-dim);
}

.ks-engrave-row.is-active .ks-engrave-pos {
	color: var(--poppy);
	font-weight: 600;
}

.ks-engrave-input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-family: inherit;
	font-size: 14px;
	outline: none;
}

.ks-engrave-count {
	flex-shrink: 0;
	font-family: "Chivo Mono", ui-monospace, monospace;
	font-size: 10px;
	color: rgb(10 10 10 / 45%);
}

/* Unified wall search */

.ks-search-wrap {
	position: relative;
}

.ks-search-box {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid rgb(10 10 10 / 22%);
	background: var(--paper);
}

.ks-search-box:focus-within {
	outline: 2px solid var(--poppy);
	outline-offset: -1px;
}

.ks-search-swatch {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	border: 1px solid rgb(10 10 10 / 20%);
	background-size: cover;
	background-position: center;
}

.ks-search-input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-family: inherit;
	font-size: 14px;
	outline: none;
}

.ks-search-hint {
	flex-shrink: 0;
	font-size: 12px;
	color: rgb(10 10 10 / 45%);
	white-space: nowrap;
}

.ks-search-results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 280px;
	overflow-y: auto;
	background: var(--paper);
	border: 1px solid rgb(10 10 10 / 24%);
	box-shadow: 0 12px 28px rgb(0 0 0 / 12%);
	z-index: 30;
}

.ks-search-item {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border: 0;
	border-bottom: 1px solid rgb(10 10 10 / 8%);
	background: var(--paper);
	color: var(--ink);
	font-family: inherit;
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}

.ks-search-item:hover,
.ks-search-item:focus {
	background: rgb(10 10 10 / 5%);
	outline: none;
}

.ks-search-item-meta {
	margin-left: auto;
	font-family: "Chivo Mono", ui-monospace, monospace;
	font-size: 11px;
	color: var(--ink-dim);
}

/* Live wall stage */

.ks-stage {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	min-height: 510px;
	padding: 18px 20px;
	border: 1px solid rgb(10 10 10 / 18%);
	background-size: cover;
	background-position: center;
	overflow: hidden;
}

.ks-stage::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(
		circle at 38% 28%,
		rgb(255 255 255 / 12%),
		rgb(0 0 0 / 16%)
	);
	pointer-events: none;
}

.ks-stage-top,
.ks-stage-bottom,
.ks-keypad-mount {
	position: relative;
	z-index: 1;
}

.ks-stage-top {
	display: none;
	width: 100%;
}

.ks-stage-bottom {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	flex-wrap: wrap;
}

.ks-pill {
	background: rgb(10 10 10 / 56%);
	color: #fff;
	padding: 4px 10px;
	font-family: "Chivo Mono", ui-monospace, monospace;
	font-size: 11px;
	line-height: 16px;
}

.ks-keypad-mount {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 20px 0;
}

/* Quick swatches */

.ks-swatches-desktop {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
	gap: 8px;
}

.ks-swatch-card {
	display: flex;
	align-items: center;
	gap: 7px;
	min-width: 0;
	overflow: hidden;
	padding: 6px 8px;
	border: 1px solid var(--rule);
	background: var(--paper);
	color: var(--ink);
	font-family: inherit;
	font-size: 11px;
	line-height: 14px;
	text-align: left;
	cursor: pointer;
}

.ks-swatch-card > span:not(.ks-swatch-chip) {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ks-swatch-card[aria-pressed="true"] {
	border: 2px solid var(--ink);
	padding: 5px 7px;
	font-weight: 600;
}

.ks-swatch-chip {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	border: 1px solid rgb(10 10 10 / 18%);
	background-size: cover;
	background-position: center;
}

/* Keypad hardware renderings */

.kp-palladiom {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 192px;
	height: 306px;
	padding: 51px 46px;
	box-shadow:
		0 22px 44px rgb(0 0 0 / 38%),
		0 4px 10px rgb(0 0 0 / 22%);
	border: 1px solid rgb(255 255 255 / 18%);
}

.kp-palladiom-col {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	gap: 1px;
	background: rgb(15 12 8 / 55%);
	padding: 1px;
}

.kp-palladiom-btn {
	flex: 1;
	display: flex;
	align-items: center;
	padding: 0 10px;
	border: 0;
	border-top: 1px solid rgb(255 255 255 / 14%);
	font-family: inherit;
	font-size: 11px;
	line-height: 14px;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-align: left;
	cursor: pointer;
}

.kp-palladiom-btn.is-active {
	font-weight: 600;
}

.kp-rl-split {
	display: flex;
	flex: 0.85;
	gap: 1px;
}

.kp-rl-split .kp-palladiom-btn {
	justify-content: center;
	padding: 0;
	font-size: 12px;
}

/* Alisse square 3.55 x 3.55 in */

.kp-alisse {
	display: grid;
	width: 236px;
	height: 236px;
	padding: 28px 22px;
	align-content: space-between;
	justify-items: center;
	box-shadow:
		0 22px 44px rgb(0 0 0 / 38%),
		0 4px 10px rgb(0 0 0 / 22%);
	border: 1px solid rgb(255 255 255 / 24%);
}

.kp-alisse.cols-1 {
	grid-template-columns: 1fr;
}

.kp-alisse.cols-2 {
	grid-template-columns: 1fr 1fr;
	column-gap: 12px;
}

.kp-alisse-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	border: 0;
	background: transparent;
	padding: 2px 4px;
	cursor: pointer;
	font-family: inherit;
}

.kp-alisse-cap {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1.5px solid rgb(255 242 208 / 38%);
	box-shadow:
		inset 0 1px 2px rgb(255 255 255 / 32%),
		0 1px 3px rgb(0 0 0 / 28%);
}

.kp-alisse-btn.is-active .kp-alisse-cap {
	border: 2px solid #fff2c9;
	box-shadow:
		0 0 12px rgb(255 230 164 / 92%),
		inset 0 1px 2px rgb(255 246 224 / 45%);
}

.kp-alisse-label {
	font-size: 11px;
	line-height: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-align: center;
}

.kp-alisse-btn.is-active .kp-alisse-label {
	font-weight: 600;
}

/* Sunnata US 1-gang with right LED light bar */

.kp-sunnata {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 192px;
	height: 306px;
	padding: 51px 48px;
	box-shadow:
		0 22px 44px rgb(0 0 0 / 34%),
		0 4px 10px rgb(0 0 0 / 18%);
	border: 1px solid rgb(255 255 255 / 16%);
}

.kp-sunnata-col {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	gap: 2px;
	background: rgb(10 10 10 / 22%);
	padding: 2px;
}

.kp-sunnata-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 9px;
	border: 0;
	font-family: inherit;
	font-size: 10.5px;
	line-height: 13px;
	font-weight: 500;
	cursor: pointer;
}

.kp-sunnata-led {
	width: 3px;
	height: 14px;
	background: rgb(255 255 255 / 22%);
}

.kp-sunnata-btn.is-active .kp-sunnata-led {
	background: #fff4d2;
	box-shadow: 0 0 8px rgb(255 224 154 / 90%);
}

/* seeTouch US 1-gang with left LED dots */

.kp-seetouch {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 192px;
	height: 306px;
	padding: 49px 47px;
	box-shadow:
		0 22px 44px rgb(0 0 0 / 34%),
		0 4px 10px rgb(0 0 0 / 18%);
	border: 1px solid rgb(255 255 255 / 16%);
}

.kp-seetouch-col {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	gap: 4px;
	padding: 5px;
	background: rgb(10 10 10 / 14%);
}

.kp-seetouch-btn {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 0 7px;
	border: 1px solid rgb(10 10 10 / 16%);
	font-family: inherit;
	font-size: 10px;
	line-height: 12px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
}

.kp-seetouch-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	flex-shrink: 0;
	background: rgb(10 10 10 / 20%);
}

.kp-seetouch-btn.is-active .kp-seetouch-dot {
	background: #ffe08a;
	box-shadow: 0 0 6px rgb(255 220 120 / 95%);
}

/* Email spec modal */

.ks-dialog {
	width: min(440px, calc(100vw - 32px));
	padding: 0;
	border: 1px solid var(--ink);
	background: var(--paper);
	color: var(--ink);
	margin: auto;
}

.ks-dialog::backdrop {
	background: rgb(10 10 10 / 55%);
}

.ks-dialog-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 22px;
}

.ks-dialog-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ks-dialog-head h2 {
	font-size: 22px;
	line-height: 26px;
}

.ks-dialog-close {
	border: 1px solid var(--rule);
	background: var(--paper);
	color: var(--ink);
	padding: 4px 10px;
	font-family: inherit;
	font-size: 12px;
	cursor: pointer;
}

.ks-dialog-copy {
	font-size: 14px;
	line-height: 21px;
	color: var(--ink-dim);
}

.ks-dialog-status {
	font-size: 13px;
	line-height: 19px;
	color: var(--ink);
	min-height: 19px;
}

.ks-dialog-actions {
	display: flex;
	justify-content: flex-end;
}

/* Mobile layout matching Paper screens 3 and 4 */

@media (max-width: 860px) {
	main.ks-page {
		padding-top: 8px;
	}

	.ks-hero {
		display: none;
	}

	.ks-workspace {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		gap: 0;
		padding-top: 0;
	}

	.ks-mobile-bar {
		position: sticky;
		top: 0;
		z-index: 20;
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: auto;
		margin: 0 calc(-1 * var(--inset, 20px));
		padding: 10px var(--inset, 20px);
		background: var(--paper);
		border-bottom: 1px solid var(--rule);
	}

	.ks-mobile-title {
		display: flex;
		flex-direction: column;
		gap: 2px;
	}

	.ks-mobile-name {
		font-size: 20px;
		line-height: 22px;
		font-weight: 600;
	}

	.ks-mobile-sku {
		font-family: "Chivo Mono", ui-monospace, monospace;
		font-size: 10px;
		line-height: 12px;
		color: var(--ink-dim);
	}

	.ks-stage-col {
		position: relative;
		gap: 0;
		width: auto;
		margin: 0 calc(-1 * var(--inset, 20px));
	}

	.ks-search-wrap#ks-search-wrap-desktop,
	.ks-swatches-desktop {
		display: none;
	}

	.ks-stage {
		height: 364px;
		min-height: 364px;
		width: 100%;
		border-left: 0;
		border-right: 0;
		padding: 12px 14px;
	}

	.ks-stage-top {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.ks-stage-bottom {
		justify-content: flex-end;
	}

	.ks-stage-bottom .ks-pill:first-child {
		display: none;
	}

	.ks-keypad-mount {
		padding: 0;
	}

	.kp-palladiom,
	.kp-sunnata,
	.kp-seetouch {
		transform: scale(0.92);
		margin: -12px 0;
	}

	.kp-alisse {
		transform: scale(0.94);
		margin: -6px 0;
	}

	.ks-mobile-tabs {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		width: 100%;
		border-bottom: 1px solid var(--rule);
		background: var(--paper);
	}

	.ks-tab {
		height: 44px;
		border: 0;
		border-bottom: 2px solid transparent;
		background: transparent;
		color: var(--ink-dim);
		font-family: inherit;
		font-size: 13px;
		font-weight: 500;
		cursor: pointer;
	}

	.ks-tab[aria-selected="true"] {
		color: var(--ink);
		font-weight: 600;
		border-bottom-color: var(--ink);
	}

	.ks-mobile-wall-panel {
		flex-direction: column;
		width: 100%;
		gap: 12px;
		padding: 14px 0 24px;
	}

	.ks-search-input,
	.ks-engrave-input,
	.ks-dialog .tool-input {
		font-size: 16px;
	}

	.ks-search-hint {
		display: none;
	}

	.ks-search-results {
		z-index: 40;
	}

	.ks-swatches-mobile {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
		width: 100%;
	}

	.ks-swatches-mobile .ks-swatch-card {
		flex-direction: column;
		align-items: stretch;
		gap: 5px;
		padding: 8px;
	}

	.ks-swatches-mobile .ks-swatch-card[aria-pressed="true"] {
		padding: 7px;
	}

	.ks-swatches-mobile .ks-swatch-chip {
		width: 100%;
		height: 36px;
	}

	.ks-swatch-sub {
		font-family: "Chivo Mono", ui-monospace, monospace;
		font-size: 10px;
		color: var(--ink-dim);
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.ks-rail {
		border: 0;
		padding: 14px 0 24px;
		width: 100%;
	}

	.ks-section-engrave {
		border-top: 0;
		padding-top: 0;
	}

	.ks-workspace[data-mobile-tab="wall"] .ks-mobile-wall-panel {
		display: flex;
	}

	.ks-workspace[data-mobile-tab="wall"] .ks-rail {
		display: none;
	}

	.ks-workspace[data-mobile-tab="keypad"] .ks-rail [data-panel="engrave"],
	.ks-workspace[data-mobile-tab="engrave"] .ks-rail [data-panel="keypad"] {
		display: none;
	}
}
