/* AppNho Thiết kế thẻ 2.0 – giao diện kiểu Figma (toàn màn hình).
 * Bản 1.0: kho-giao-dien/appnho-thietkethe-1.0/designer.css */

html:has(body.antk-fullscreen), body.antk-fullscreen { height: 100%; margin: 0; overflow: hidden; background: #18181b; }

.tk-app {
	--tk-primary: var(--an-primary, #2563eb);
	--tk-cta: var(--an-cta, #f97316);
	--tk-ink: #18181b;
	--tk-text: #27272a;
	--tk-muted: #71717a;
	--tk-line: #e4e4e7;
	--tk-soft: #f4f4f5;
	--tk-top: #18181b;
	--tk-work: #e7e7ea;
	--tk-rail: 68px;
	--tk-left: 240px;
	--tk-right: 280px;
	--tk-topbar: 48px;
	position: fixed; inset: 0; z-index: 100;
	display: grid;
	grid-template-columns: var(--tk-rail) var(--tk-left) minmax(0, 1fr) var(--tk-right);
	grid-template-rows: var(--tk-topbar) minmax(0, 1fr);
	grid-template-areas: "top top top top" "rail left work right";
	font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 13px; line-height: 1.45; color: var(--tk-text);
	background: var(--tk-work);
	-webkit-font-smoothing: antialiased;
}
body.admin-bar .tk-app { top: 32px; }
.tk-app *, .tk-app *::before, .tk-app *::after { box-sizing: border-box; }
.tk-app button { font: inherit; cursor: pointer; color: inherit; }
.tk-app [hidden] { display: none !important; }
.tk-app h4 { font-size: 12px; font-weight: 700; margin: 0 0 8px; color: var(--tk-ink); display: flex; align-items: baseline; gap: 6px; }
.tk-app h4 small { font-weight: 500; color: var(--tk-muted); font-size: 11px; }
.tk-app kbd { font: inherit; font-size: 11px; border: 1px solid var(--tk-line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fff; color: var(--tk-ink); }

/* ---------- Thanh trên ---------- */
.tk-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 0 6px; background: var(--tk-top); color: #fafafa; min-width: 0; position: relative; z-index: 5; border-bottom: 1px solid #27272a; }
.tk-top__l, .tk-top__r { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tk-top__l { flex: 1 1 0; }
.tk-top__c { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.tk-top__r { flex: 1 1 0; justify-content: flex-end; }
.tk-back { display: inline-flex; align-items: center; gap: 6px; color: #d4d4d8; text-decoration: none; font-weight: 600; padding: 6px 10px 6px 8px; border-radius: 8px; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.tk-back:hover { background: #27272a; color: #fff; }
.tk-ib { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #e4e4e7; position: relative; }
.tk-ib:hover { background: #27272a; color: #fff; }
.tk-toolfile { cursor: pointer; }
.tk-toolfile input, .tk-btn--file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* ---------- Cột công cụ (bên trái, dọc) ---------- */
.tk-rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: var(--tk-top); position: relative; z-index: 4; overflow: visible; }
.tk-rail > button, .tk-rail > .tk-toolfile { width: 56px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 10px; background: transparent; color: #d4d4d8; position: relative; padding: 0; }
.tk-rail > button::after, .tk-rail > .tk-toolfile::after { content: attr(data-label); font-size: 10.5px; font-weight: 600; line-height: 1.1; letter-spacing: .1px; white-space: nowrap; color: #a1a1aa; }
.tk-rail > button:hover, .tk-rail > .tk-toolfile:hover { background: #27272a; color: #fff; }
.tk-rail > button:hover::after, .tk-rail > .tk-toolfile:hover::after { color: #e4e4e7; }
.tk-rail > button.is-on { background: var(--tk-primary); color: #fff; }
.tk-rail > button.is-on::after { color: #fff; }
.tk-rail > button:focus-visible, .tk-rail > .tk-toolfile:focus-within { outline: 2px solid color-mix(in srgb, var(--tk-primary) 70%, #fff); outline-offset: 1px; }
.tk-sep { display: block; width: 32px; height: 1px; background: #3f3f46; margin: 4px 0; flex: 0 0 auto; }
.tk-zoom { display: flex; align-items: center; }
.tk-zoom__v { min-width: 54px; height: 32px; border: 0; background: transparent; color: #e4e4e7; border-radius: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.tk-zoom__v:hover { background: #27272a; }
.tk-cta { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--tk-cta); color: #fff !important; font-weight: 700; white-space: nowrap; }
.tk-cta:hover { filter: brightness(1.06); }
.tk-cta b { font-weight: 600; opacity: .9; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .35); }
.tk-cta--block { width: 100%; justify-content: center; height: 46px; font-size: 16px; }
.tk-cta[disabled] { opacity: .65; cursor: progress; }

.tk-seg { display: inline-flex; background: var(--tk-soft); border-radius: 8px; padding: 2px; gap: 2px; }
.tk-seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--tk-muted); white-space: nowrap; }
.tk-seg button.is-on { background: #fff; color: var(--tk-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.tk-seg--dark { background: #27272a; }
.tk-seg--dark button { color: #a1a1aa; }
.tk-seg--dark button.is-on { background: #3f3f46; color: #fff; box-shadow: none; }
.tk-seg--icons button { min-width: 32px; }

/* Bảng biểu tượng */
.tk-iconmenu { position: absolute; top: 8px; left: calc(100% + 8px); width: 300px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; background: #fff; color: var(--tk-ink); border-radius: 12px; border: 1px solid var(--tk-line); box-shadow: 0 16px 40px rgba(0, 0, 0, .22); z-index: 20; }
.tk-iconmenu button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 0; background: transparent; border-radius: 8px; font-size: 11px; color: var(--tk-text); }
.tk-iconmenu button:hover { background: var(--tk-soft); color: var(--tk-primary); }

/* ---------- Cột trái / phải ---------- */
.tk-panel { background: #fff; overflow-y: auto; overflow-x: hidden; min-width: 0; scrollbar-width: thin; }
.tk-left { grid-area: left; border-right: 1px solid var(--tk-line); display: flex; flex-direction: column; }
.tk-right { grid-area: right; border-left: 1px solid var(--tk-line); }
.tk-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--tk-line); position: sticky; top: 0; background: #fff; z-index: 2; }
.tk-tabs button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; padding: 10px 4px 9px; font-weight: 600; color: var(--tk-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tk-tabs button:hover { color: var(--tk-ink); }
.tk-tabs button.is-on { color: var(--tk-ink); border-bottom-color: var(--tk-primary); }
.tk-tabs button.is-on svg { color: var(--tk-primary); }
.tk-pane { padding: 12px; }
.tk-hint, .tk-meta { color: var(--tk-muted); font-size: 12px; margin: 8px 0; }

/* Lớp */
.tk-layers { list-style: none; margin: 0; padding: 0; }
.tk-layers { display: grid; gap: 2px; }
.tk-layer { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 6px 4px 8px; border-radius: 8px; cursor: default; user-select: none; border: 1px solid transparent; }
.tk-layer:hover { background: var(--tk-soft); }
.tk-layer.is-sel { background: color-mix(in srgb, var(--tk-primary) 12%, #fff); border-color: color-mix(in srgb, var(--tk-primary) 35%, #fff); }
.tk-layer.is-over { border-top: 2px solid var(--tk-primary); }
.tk-layer.is-drag { opacity: .45; }
.tk-layer.is-hidden .tk-layer__n, .tk-layer.is-hidden .tk-layer__ic { opacity: .4; }
.tk-layer.is-bg { color: var(--tk-muted); }
.tk-layer__ic { flex: 0 0 auto; display: grid; place-items: center; color: var(--tk-muted); }
.tk-layer__n { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-layer__b { flex: 0 0 auto; width: 24px; height: 24px; border: 0; background: transparent; border-radius: 4px; display: grid; place-items: center; color: var(--tk-muted); opacity: 0; }
.tk-layer:hover .tk-layer__b, .tk-layer.is-hidden [data-lv], .tk-layer.is-locked [data-ll] { opacity: 1; }
.tk-layer__b:hover { background: #fff; color: var(--tk-ink); }

/* Mẫu */
.tk-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.tk-tpl { display: flex; flex-direction: column; gap: 4px; border: 2px solid transparent; background: var(--tk-soft); border-radius: 8px; padding: 6px; text-align: left; }
.tk-tpl:hover { border-color: var(--tk-line); }
.tk-tpl.is-on { border-color: var(--tk-primary); background: #fff; }
.tk-tpl__pv { display: grid; place-items: center; aspect-ratio: 1011 / 638; background: #e4e4e7; border-radius: 4px; overflow: hidden; }
.tk-tpl__pv img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tk-tpl.is-doc .tk-tpl__pv img { width: auto; height: 100%; }
.tk-tpl__name { font-weight: 600; font-size: 12px; line-height: 1.3; }
.tk-admin { margin-top: 14px; padding: 10px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; }

/* Trường nhập */
.tk-field { display: block; margin: 0 0 10px; min-width: 0; }
.tk-field > span:first-child { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--tk-ink); }
.tk-field input, .tk-select, .tk-textarea, .tk-num input, .tk-num select {
	width: 100%; min-width: 0; border: 1px solid var(--tk-line); border-radius: 6px; padding: 7px 9px; font: inherit; color: var(--tk-ink); background: #fff;
}
.tk-field input:focus, .tk-select:focus, .tk-textarea:focus, .tk-num input:focus, .tk-num select:focus { outline: 2px solid color-mix(in srgb, var(--tk-primary) 35%, transparent); border-color: var(--tk-primary); }
.tk-textarea { resize: vertical; margin-bottom: 8px; }
.tk-select { margin-bottom: 8px; }
.tk-prefix { display: flex; border: 1px solid var(--tk-line); border-radius: 6px; overflow: hidden; background: #fff; }
.tk-prefix em { font-style: normal; background: var(--tk-soft); color: var(--tk-muted); padding: 7px 6px 7px 9px; font-size: 12px; white-space: nowrap; display: flex; align-items: center; }
.tk-prefix input { border: 0 !important; border-radius: 0 !important; }

/* ---------- Thuộc tính ---------- */
.tk-sec { padding: 14px 14px 16px; border-bottom: 1px solid var(--tk-line); }
.tk-sec > h4, .tk-sechead { margin-bottom: 10px; }
.tk-sechead { display: flex; justify-content: space-between; align-items: center; }
.tk-sechead h4 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; margin: 0; }
.tk-aligns { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; padding: 3px; background: var(--tk-soft); border-radius: 8px; }
.tk-aligns button { height: 30px; border: 0; border-radius: 6px; background: transparent; display: grid; place-items: center; color: var(--tk-text); }
.tk-aligns button:hover { background: #fff; color: var(--tk-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.tk-aligns button[disabled] { opacity: .3; cursor: not-allowed; background: transparent; box-shadow: none; }
.tk-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.tk-num { display: flex; align-items: center; height: 32px; border: 1px solid transparent; border-radius: 6px; background: var(--tk-soft); min-width: 0; }
.tk-num:hover { border-color: var(--tk-line); }
.tk-num > span { flex: 0 0 auto; padding: 0 2px 0 8px; color: var(--tk-muted); font-size: 11px; min-width: 22px; }
.tk-num input, .tk-num select { border: 0; background: transparent; padding: 6px 4px; font-size: 12px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.tk-num input::-webkit-inner-spin-button { opacity: .4; }
.tk-num em { font-style: normal; color: var(--tk-muted); font-size: 11px; padding-right: 8px; }
.tk-num input[disabled] { color: var(--tk-muted); }
.tk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.tk-color { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; }
.tk-color input[type=color] { width: 30px; height: 26px; padding: 1px; border: 1px solid var(--tk-line); border-radius: 6px; background: #fff; cursor: pointer; }
.tk-check { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 8px 0 0; cursor: pointer; }
.tk-swatches { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.tk-swatches button { aspect-ratio: 1; border: 1px solid rgba(0, 0, 0, .14); border-radius: 50%; padding: 0; transition: transform .12s; }
.tk-swatches button:hover { transform: scale(1.1); }
.tk-swatches--sm { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tk-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--tk-line); background: #fff; border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; overflow: hidden; }
.tk-btn:hover { border-color: var(--tk-primary); color: var(--tk-primary); }
.tk-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tk-btns button { height: 32px; border: 1px solid var(--tk-line); background: #fff; border-radius: 6px; padding: 0 8px; font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-btns .is-danger { grid-column: 1 / -1; color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.tk-btns button:hover { border-color: var(--tk-primary); color: var(--tk-primary); }
.tk-btns .is-danger:hover { border-color: #dc2626; color: #dc2626; }
.tk-seg--icons button.is-on { background: var(--tk-ink); color: #fff; }
.tk-tips ul { margin: 0; padding: 0; list-style: none; color: var(--tk-muted); font-size: 12px; }
.tk-tips li { margin-bottom: 4px; }
.tk-tips { margin-top: 16px; }

/* ---------- Vùng làm việc ---------- */
.tk-work { grid-area: work; position: relative; overflow: hidden; min-width: 0; min-height: 0;
	background-color: var(--tk-work);
	background-image: radial-gradient(rgba(0, 0, 0, .09) 1px, transparent 1px);
	background-size: 18px 18px; }
.tk-work .canvas-container { position: absolute !important; left: 0; top: 0; z-index: 1; }
.tk-cardshadow { position: absolute; z-index: 0; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 18px 40px -12px rgba(0, 0, 0, .35); pointer-events: none; }
.tk-loading { display: none; position: absolute; inset: 0; z-index: 3; place-items: center; background: rgba(231, 231, 234, .9); font-weight: 600; color: var(--tk-muted); }
.tk-app[data-loading] .tk-loading { display: grid; }
.tk-workhint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; background: rgba(24, 24, 27, .82); color: #e4e4e7; font-size: 11px; padding: 5px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none; }

/* ---------- Đặt in (hộp thoại) ---------- */
.tk-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(9, 9, 11, .55); }
.tk-modal__box { position: relative; width: min(820px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.tk-modal__box h3 { margin: 0 0 14px; font-size: 19px; color: var(--tk-ink); }
.tk-modal__x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--tk-soft); display: grid; place-items: center; }
.tk-order { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.tk-order__pv { display: grid; gap: 10px; align-content: start; justify-items: center; background: var(--tk-work); border-radius: 10px; padding: 14px; }
.tk-order__pv img { width: 100%; max-width: 340px; border-radius: 10px; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .35); background: #fff; min-height: 40px; }
.tk-order__pv img.is-doc { width: auto; max-height: 220px; }
.tk-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.tk-line span { color: var(--tk-muted); }
.tk-line strong { font-size: 17px; color: var(--tk-ink); }
.tk-line--total { border-top: 1px dashed var(--tk-line); padding-top: 12px; }
.tk-line--total strong { font-size: 22px; color: var(--tk-cta); }
.tk-qty { display: inline-flex; border: 1px solid var(--tk-line); border-radius: 8px; overflow: hidden; }
.tk-qty button { width: 36px; border: 0; background: var(--tk-soft); font-size: 17px; }
.tk-qty input { width: 56px; text-align: center; border: 0; font: inherit; -moz-appearance: textfield; }
.tk-msg { margin: 10px 0 0; font-size: 13px; }
.tk-msg.is-err { color: #b91c1c; }
.tk-msg.is-ok { color: #047857; }
.tk-trust { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12px; }
.tk-trust li { padding-left: 20px; position: relative; margin-bottom: 4px; }
.tk-trust li::before { content: "✓"; position: absolute; left: 0; color: #059669; font-weight: 700; }
.tk-help { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--tk-line); display: flex; flex-wrap: wrap; gap: 6px 12px; }
.tk-help a { font-weight: 700; color: var(--tk-primary); text-decoration: none; }

/* ---------- Điện thoại: thanh dưới + ngăn kéo ---------- */
.tk-mnav, .tk-sheetbar { display: none; }

/* Laptop nhỏ: thu hẹp hai cột */
@media (max-width: 1180px) {
	.tk-app { --tk-rail: 62px; --tk-left: 212px; --tk-right: 256px; }
	.tk-rail > button, .tk-rail > .tk-toolfile { width: 52px; height: 50px; }
	.tk-rail > button::after, .tk-rail > .tk-toolfile::after { font-size: 10px; }
	.tk-tabs button svg { display: none; }
	.tk-back span { display: none; }
	.tk-cta b { display: none; }
	.tk-workhint { display: none; }
	.tk-aligns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
	.tk-app { --tk-topbar: 52px; --tk-nav: 60px; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--tk-topbar) minmax(0, 1fr) calc(var(--tk-nav) + env(safe-area-inset-bottom)); grid-template-areas: "top" "work" "nav"; }
	body.admin-bar .tk-app { top: 46px; }
	.tk-top { gap: 6px; padding: 0 6px; }
	.tk-top__l, .tk-top__r { flex: 0 0 auto; gap: 2px; }
	.tk-top__c { flex: 1 1 auto; min-width: 0; justify-content: flex-start; }
	.tk-back { padding: 6px; }
	.tk-ib { width: 38px; height: 38px; }
	.tk-zoom, .tk-tools .tk-sep { display: none; }
	.tk-cta { padding: 0 12px; height: 36px; }
	.tk-seg--dark button { padding: 7px 10px; }

	/* Thanh dưới */
	.tk-mnav { grid-area: nav; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--tk-line); z-index: 8; padding-bottom: env(safe-area-inset-bottom); }
	.tk-mnav button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--tk-muted); position: relative; min-height: 44px; }
	.tk-mnav button::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: transparent; }
	.tk-mnav button.is-on { color: var(--tk-primary); }
	.tk-mnav button.is-on::before { background: var(--tk-primary); }
	.tk-mnav button.has-sel::after { content: ""; position: absolute; top: 8px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--tk-cta); }

	/* Ngăn kéo: các bảng bình thường ẩn, mở theo nút ở thanh dưới */
	.tk-left, .tk-right, .tk-tools { display: none; }
	.tk-app[data-sheet="layers"] .tk-left, .tk-app[data-sheet="mau"] .tk-left, .tk-app[data-sheet="info"] .tk-left,
	.tk-app[data-sheet="props"] .tk-right, .tk-app[data-sheet="add"] .tk-tools {
		display: block; position: fixed; left: 0; right: 0; bottom: calc(var(--tk-nav) + env(safe-area-inset-bottom)); max-height: 56vh; overflow-y: auto; overscroll-behavior: contain; z-index: 7;
		background: #fff; border: 0; border-top: 1px solid var(--tk-line); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 30px rgba(0, 0, 0, .18); padding: 0;
	}
	/* Đầu ngăn kéo: tay kéo + tiêu đề */
	.tk-app[data-sheet] .tk-left::before, .tk-app[data-sheet] .tk-right::before, .tk-app[data-sheet] .tk-tools::before {
		display: block; position: sticky; top: 0; z-index: 3; grid-column: 1 / -1;
		padding: 18px 16px 10px; font-size: 15px; font-weight: 700; color: var(--tk-ink);
		background: linear-gradient(#d4d4d8, #d4d4d8) center 7px / 38px 4px no-repeat, #fff; border-bottom: 1px solid var(--tk-line);
	}
	.tk-app[data-sheet="layers"] .tk-left::before { content: "Lớp"; }
	.tk-app[data-sheet="mau"] .tk-left::before { content: "Mẫu thiết kế"; }
	.tk-app[data-sheet="info"] .tk-left::before { content: "Thông tin trên thẻ"; }
	.tk-app[data-sheet="props"] .tk-right::before { content: "Thuộc tính"; }
	.tk-app[data-sheet="add"] .tk-tools::before { content: "Thêm vào thẻ"; margin: 0 -14px 4px; }
	.tk-app .tk-left .tk-tabs { display: none; }
	.tk-pane { padding: 12px 16px 16px; }
	.tk-sec { padding: 14px 16px 16px; }

	/* Bảng "Thêm" */
	.tk-app[data-sheet="add"] .tk-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 14px 16px; color: var(--tk-ink); align-items: stretch; }
	.tk-app[data-sheet="add"] .tk-tools > button, .tk-app[data-sheet="add"] .tk-toolfile { width: auto; height: 72px; color: var(--tk-ink); background: var(--tk-soft); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
	.tk-app[data-sheet="add"] .tk-tools > button::after, .tk-app[data-sheet="add"] .tk-toolfile::after { content: attr(data-label); text-align: center; line-height: 1.2; color: inherit; font-size: 11.5px; }
	.tk-app[data-sheet="add"] .tk-tools [data-tool="select"] { display: none; }
	.tk-app[data-sheet="add"] .tk-tools > button.is-on { background: var(--tk-primary); color: #fff; }
	.tk-iconmenu { position: static; transform: none; width: auto; grid-column: 1 / -1; box-shadow: none; border: 1px solid var(--tk-line); grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.tk-iconmenu button { min-height: 56px; }

	/* Cảm ứng: ô nhập 16px (iPhone không tự phóng to), nút cao ≥ 40px */
	.tk-app input:not([type=checkbox]):not([type=color]):not([type=file]), .tk-app select, .tk-app textarea { font-size: 16px; }
	.tk-field input, .tk-select, .tk-prefix em { padding-top: 10px; padding-bottom: 10px; }
	.tk-num { height: 42px; }
	.tk-num > span, .tk-num em { font-size: 12px; }
	.tk-aligns { grid-template-columns: repeat(8, minmax(0, 1fr)); }
	.tk-aligns button { height: 40px; }
	.tk-btns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.tk-btns button { height: 42px; font-size: 12.5px; }
	.tk-btns .is-danger { grid-column: auto; }
	.tk-seg button { padding: 8px 12px; font-size: 13px; }
	.tk-seg--icons button { min-width: 44px; }
	.tk-swatches, .tk-swatches--sm { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
	.tk-color input[type=color] { width: 40px; height: 34px; }
	.tk-btn { min-height: 38px; padding: 6px 14px; font-size: 13px; }
	.tk-check { font-size: 13px; min-height: 32px; }
	.tk-check input { width: 18px; height: 18px; }
	.tk-layer { min-height: 46px; }
	.tk-layer__b { opacity: 1; width: 36px; height: 36px; }
	.tk-tpls { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
	.tk-tips, .tk-workhint { display: none; }

	.tk-order { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.tk-order__pv { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
	.tk-modal { padding: 0; align-items: end; }
	.tk-modal__box { border-radius: 18px 18px 0 0; max-height: 92vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
	.tk-qty button { width: 44px; height: 44px; }
}
@media (max-width: 380px) {
	.tk-seg--dark button { padding: 7px 8px; font-size: 12px; }
	.tk-cta span { display: none; }
	.tk-swatches, .tk-swatches--sm { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* 10/11/2026: báo lỗi tại ô nhập */
.tk-ferr { display: block; color: #dc2626; font-size: 13px; line-height: 1.4; margin-top: 6px; }
.tk-ferr:empty { display: none; }
.tk-prefix.is-err { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.tk-prefix.is-err em { background: #fef2f2; color: #b91c1c; }
.tk-prefix.is-err input { background: #fff7f7 !important; }
.tk-prefix.is-shake { animation: tk-shake .35s; }
@keyframes tk-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .tk-prefix.is-shake { animation: none; } }

/* 10/11/2026: hiệu ứng (đổ bóng, viền, nền chữ, làm mờ ảnh) */
.tk-fxpre { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.tk-fxpre button { height: 30px; padding: 0 4px; border: 1px solid var(--tk-line); border-radius: 6px; background: #fff; font-size: 11.5px; font-weight: 600; color: var(--tk-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-fxpre button:hover { border-color: var(--tk-primary); color: var(--tk-primary); }
.tk-fxpre [hidden] { display: none; }
.tk-fxrow { display: flex; align-items: center; gap: 8px; margin: 6px 0; min-height: 32px; }
.tk-fxrow .tk-check { margin: 0; flex: 1; }
.tk-fxrow .tk-num--sm { flex: 0 0 86px; }
[data-fx-shadow].is-off { opacity: .45; }
.tk-range { display: grid; grid-template-columns: 62px 1fr 30px; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; color: var(--tk-muted); }
.tk-range input[type=range] { width: 100%; accent-color: var(--tk-primary); }
.tk-range output { text-align: right; font-variant-numeric: tabular-nums; color: var(--tk-text); }
.tk-bgfx { margin: 10px 0 4px; padding: 10px; border-radius: 8px; background: var(--tk-soft); }
.tk-bgfx h4 { margin-top: 0; }
.tk-bgfx[hidden], [data-fx-text][hidden], [data-fx-img][hidden] { display: none; }
@media (max-width: 760px) { .tk-fxpre button { height: 36px; font-size: 12.5px; } .tk-range { grid-template-columns: 70px 1fr 32px; } }

/* 10/11/2026: sao chép giữa 2 mặt */
.tk-top__c { gap: 6px; }
.tk-copy { position: relative; }
.tk-copy__menu { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 30; display: grid; gap: 2px; width: 290px; padding: 6px; background: #fff; color: var(--tk-ink); border: 1px solid var(--tk-line); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }
.tk-copy__menu[hidden] { display: none; }
.tk-copy__menu button { display: grid; gap: 2px; padding: 9px 10px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer; }
.tk-copy__menu button:hover:not([disabled]) { background: var(--tk-soft); }
.tk-copy__menu button[disabled] { opacity: .45; cursor: not-allowed; }
.tk-copy__menu strong { font-size: 13px; font-weight: 600; }
.tk-copy__menu small { font-size: 11.5px; color: var(--tk-muted); }
@media (max-width: 760px) { .tk-copy__menu { left: 0; transform: none; width: min(290px, calc(100vw - 20px)); } }

/* 10/11/2026: trạng thái tên trang trangcanhan.vn */
.tk-pstate { display: block; margin-top: 6px; font-size: 13px; line-height: 1.45; }
.tk-pstate:empty { display: none; }
.tk-pstate.is-ok { color: #15803d; }
.tk-pstate.is-warn { color: #b45309; }
.tk-pstate.is-err { color: #dc2626; }
.tk-pstate.is-wait { color: #64748b; }
.tk-own { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 14px; padding: 10px 12px; border: 1px solid #fcd34d; border-radius: 10px; background: #fffbeb; color: #78350f; font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.tk-own[hidden] { display: none; }
.tk-own input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #d97706; }
