/* TCH Gang Sheet Builder — uses the TCH theme tokens when present. */

.tch-gs-product form.cart,
.tch-gs-product .wcpay-express-checkout-wrapper,
.tch-gs-product .ppc-button-wrapper,
.tch-gs-product #ppc-button-ppcp-gateway { display: none !important; }

.tch-gs-open-wrap { margin: 8px 0 20px; }
.tch-gs-open-wrap .tch-gs-open {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: 0 28px; border: 0; border-radius: var(--tch-radius, 6px);
	background: var(--tch-espresso, #352923); color: var(--tch-ivory, #f3ede4);
	font-family: var(--tch-font-body, Arimo, Arial, sans-serif); font-size: 16px; font-weight: 700;
	letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
}
.tch-gs-open-wrap .tch-gs-open:hover { background: var(--tch-ink, #25211e); }
.tch-gs-open-note { margin: 10px 0 0; color: var(--tch-muted, #655b53); font-size: 14px; }

html.tch-gs-locked, html.tch-gs-locked body { overflow: hidden !important; }

#tch-gs-app {
	--gs-espresso: var(--tch-espresso, #352923);
	--gs-ivory: var(--tch-ivory, #f3ede4);
	--gs-tan: var(--tch-tan, #c7aa7c);
	--gs-tan-deep: var(--tch-tan-deep, #a8885a);
	--gs-ink: var(--tch-ink, #25211e);
	--gs-muted: var(--tch-muted, #655b53);
	--gs-line: var(--tch-line, #ddd5c9);
	--gs-white: #fff;
	--gs-display: var(--tch-font-display, Anton, Impact, sans-serif);
	--gs-body: var(--tch-font-body, Arimo, Arial, sans-serif);
	position: fixed; inset: 0; z-index: 999999;
	display: grid; grid-template-rows: 64px 1fr;
	background: var(--gs-ivory); color: var(--gs-ink);
	font-family: var(--gs-body); font-size: 14px; line-height: 1.4;
}
#tch-gs-app[hidden] { display: none; }
#tch-gs-app *, #tch-gs-app *::before, #tch-gs-app *::after { box-sizing: border-box; }
#tch-gs-app button, #tch-gs-app select, #tch-gs-app input {
	margin: 0; font-family: inherit; text-transform: none; letter-spacing: normal; line-height: 1.2;
	box-shadow: none; text-shadow: none; min-height: 0; min-width: 0; width: auto;
}
#tch-gs-app button { background: transparent; color: inherit; border: 0; padding: 0; border-radius: 0; }
#tch-gs-app h3, #tch-gs-app p { margin: 0; padding: 0; text-transform: none; letter-spacing: normal; }
#tch-gs-app img { max-width: none; }

/* Top bar */
#tch-gs-app .tch-gs__bar {
	display: flex; align-items: center; gap: 20px; padding: 0 16px 0 20px;
	background: var(--gs-espresso); color: var(--gs-ivory);
}
#tch-gs-app .tch-gs__brand { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
#tch-gs-app .tch-gs__logo { height: 36px; width: auto; filter: brightness(0) invert(0.94) sepia(0.15); }
#tch-gs-app .tch-gs__title { font-family: var(--gs-display); font-size: 22px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
#tch-gs-app .tch-gs__size { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#tch-gs-app .tch-gs__size span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gs-tan); font-weight: 700; }
#tch-gs-app .tch-gs__size select {
	height: 38px; padding: 0 34px 0 12px; border: 1px solid rgba(243,237,228,.35); border-radius: 6px;
	background: rgba(243,237,228,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f3ede4' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
	color: var(--gs-ivory); font: 600 14px var(--gs-body); appearance: none; cursor: pointer;
}
#tch-gs-app .tch-gs__size select option { color: var(--gs-ink); }
#tch-gs-app .tch-gs__price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; min-width: 70px; }
#tch-gs-app .tch-gs__price-label { font-size: 11px; color: rgba(243,237,228,.7); }
#tch-gs-app .tch-gs__price strong { font-family: var(--gs-display); font-size: 24px; font-weight: 400; color: var(--gs-tan); }
#tch-gs-app .tch-gs__bar-actions { display: flex; align-items: center; gap: 10px; }

/* Buttons */
#tch-gs-app .tch-gs__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 38px; padding: 0 16px; border: 1px solid var(--gs-espresso); border-radius: 6px;
	background: var(--gs-white); color: var(--gs-espresso); font-size: 13px; font-weight: 700; cursor: pointer;
	transition: background .15s, color .15s;
}
#tch-gs-app .tch-gs__btn:hover { background: var(--gs-espresso); color: var(--gs-ivory); }
#tch-gs-app .tch-gs__btn:disabled { opacity: .5; cursor: not-allowed; }
#tch-gs-app .tch-gs__btn--primary { background: var(--gs-tan); border-color: var(--gs-tan); color: var(--gs-ink); text-transform: uppercase; letter-spacing: .05em; }
#tch-gs-app .tch-gs__btn--primary:hover:not(:disabled) { background: var(--gs-ivory); border-color: var(--gs-ivory); color: var(--gs-ink); }
#tch-gs-app .tch-gs__btn--danger { border-color: #b8432f; color: #b8432f; }
#tch-gs-app .tch-gs__btn--danger:hover { background: #b8432f; color: #fff; }
#tch-gs-app .tch-gs__btn--small { height: 30px; padding: 0 12px; font-size: 12px; }
#tch-gs-app .tch-gs__icon-btn {
	width: 38px; height: 38px; border: 1px solid rgba(243,237,228,.35); border-radius: 6px;
	background: transparent; color: var(--gs-ivory); font-size: 24px; line-height: 1; cursor: pointer;
}
#tch-gs-app .tch-gs__icon-btn:hover, #tch-gs-app .tch-gs__icon-btn:focus { background: rgba(243,237,228,.12); color: var(--gs-ivory); }
#tch-gs-app .tch-gs__zoom button:focus { background: transparent; color: var(--gs-ink); }
#tch-gs-app .tch-gs__tool:focus:not([aria-pressed="true"]) { background: transparent; color: var(--gs-ink); }
#tch-gs-app button:focus-visible, #tch-gs-app select:focus-visible, #tch-gs-app input:focus-visible { outline: 2px solid var(--gs-tan); outline-offset: 2px; }

/* Body */
#tch-gs-app .tch-gs__body { display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
#tch-gs-app .tch-gs__panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--gs-line); background: var(--gs-white); }
#tch-gs-app .tch-gs__drop {
	margin: 16px; padding: 18px 16px; border: 2px dashed var(--gs-line); border-radius: 10px;
	text-align: center; background: #fbf9f5; transition: border-color .15s, background .15s;
}
#tch-gs-app .tch-gs__drop.is-over { border-color: var(--gs-tan); background: #f6efe3; }
#tch-gs-app .tch-gs__drop-title { margin: 0 0 2px; font-family: var(--gs-display); font-size: 20px; text-transform: uppercase; color: var(--gs-ink); }
#tch-gs-app .tch-gs__drop-text { margin: 0 0 10px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__hint { margin: 10px 0 0; font-size: 12px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 8px; }
#tch-gs-app .tch-gs__panel-head h3 { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gs-tan-deep); font-family: var(--gs-body); font-weight: 700; }
#tch-gs-app .tch-gs__count { min-width: 22px; padding: 2px 7px; border-radius: 99px; background: var(--gs-ivory); font-size: 12px; font-weight: 700; text-align: center; }
#tch-gs-app .tch-gs__count:empty { display: none; }
#tch-gs-app .tch-gs__uploads { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 0 16px 16px; list-style: none; }
#tch-gs-app .tch-gs__upload { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--gs-line); }
#tch-gs-app .tch-gs__thumb {
	flex: 0 0 52px; height: 52px; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
	background: repeating-conic-gradient(#ebe6de 0% 25%, #fff 0% 50%) 50% / 12px 12px;
}
#tch-gs-app .tch-gs__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
#tch-gs-app .tch-gs__upload-main { flex: 1; min-width: 0; }
#tch-gs-app .tch-gs__upload-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tch-gs-app .tch-gs__upload-meta { font-size: 12px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__upload.is-error .tch-gs__upload-meta { color: #b8432f; }
#tch-gs-app .tch-gs__upload-warn { margin-top: 3px; font-size: 11.5px; color: #8a5a00; }
#tch-gs-app .tch-gs__bar-track { height: 4px; margin-top: 5px; border-radius: 4px; background: var(--gs-ivory); overflow: hidden; }
#tch-gs-app .tch-gs__bar-track span { display: block; height: 100%; width: 0; background: var(--gs-tan); transition: width .2s; }

/* Stage */
#tch-gs-app .tch-gs__stage { display: grid; grid-template-rows: auto 1fr; min-width: 0; min-height: 0; background: #d8d2c8; }
#tch-gs-app .tch-gs__area { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#tch-gs-app .tch-gs__canvas-wrap { position: absolute; top: 22px; left: 22px; right: 0; bottom: 0; }
#tch-gs-app .tch-gs__ruler { position: absolute; display: block; background: #f2ede5; z-index: 2; }
#tch-gs-app .tch-gs__ruler--top { top: 0; left: 22px; right: 0; height: 22px; width: calc(100% - 22px); border-bottom: 1px solid var(--gs-line); }
#tch-gs-app .tch-gs__ruler--left { top: 22px; left: 0; bottom: 0; width: 22px; height: calc(100% - 22px); border-right: 1px solid var(--gs-line); }
#tch-gs-app .tch-gs__ruler-corner { position: absolute; top: 0; left: 0; z-index: 3; width: 22px; height: 22px; display: grid; place-items: center; background: #e9e2d7; font-size: 9px; font-weight: 700; color: var(--gs-muted); border-right: 1px solid var(--gs-line); border-bottom: 1px solid var(--gs-line); }

/* Toolbar */
#tch-gs-app .tch-gs__tools { display: flex; align-items: center; gap: 4px; min-height: 46px; padding: 6px 10px; background: var(--gs-white); border-bottom: 1px solid var(--gs-line); overflow-x: auto; scrollbar-width: thin; }
#tch-gs-app .tch-gs__tool { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 6px; color: var(--gs-ink); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
#tch-gs-app .tch-gs__tool svg { width: 18px; height: 18px; flex: 0 0 18px; }
#tch-gs-app .tch-gs__tool:hover:not(:disabled) { background: var(--gs-ivory); }
#tch-gs-app .tch-gs__tool:disabled { opacity: .35; cursor: default; }
#tch-gs-app .tch-gs__tool[aria-pressed="true"] { background: var(--gs-espresso); color: var(--gs-ivory); }
#tch-gs-app .tch-gs__gap { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; margin: 0 4px 0 2px; font-size: 12px; color: var(--gs-muted); white-space: nowrap; }
#tch-gs-app .tch-gs__gap span:first-child { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
#tch-gs-app .tch-gs__gap input { width: 64px; height: 30px; padding: 0 6px; border: 1px solid var(--gs-line); border-radius: 6px; font: 600 13px var(--gs-body); color: var(--gs-ink); background: #fff; }
#tch-gs-app .tch-gs__sep { flex: 0 0 1px; align-self: stretch; margin: 4px 6px; background: var(--gs-line); }
#tch-gs-app .tch-gs__spacer { flex: 1 1 auto; min-width: 8px; }
#tch-gs-app .tch-gs__bgpick { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#tch-gs-app .tch-gs__bgpick > span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--gs-muted); margin-right: 2px; }
#tch-gs-app .tch-gs__swatch { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--gs-line); cursor: pointer; }
#tch-gs-app .tch-gs__swatch[aria-pressed="true"] { border-color: var(--gs-espresso); box-shadow: 0 0 0 2px var(--gs-tan); }
#tch-gs-app .tch-gs__swatch--checker { background: repeating-conic-gradient(#e2dbd0 0% 25%, #fff 0% 50%) 50% / 8px 8px; }
#tch-gs-app .tch-gs__swatch--white { background: #fff; }
#tch-gs-app .tch-gs__swatch--black { background: #1d1a17; }
#tch-gs-app .tch-gs__swatch--grey { background: #8d8780; }
#tch-gs-app .tch-gs__issues { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: #fbe9e5; color: #a3321f; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
#tch-gs-app .tch-gs__issues svg { width: 16px; height: 16px; }
#tch-gs-app .tch-gs__issues:hover { background: #f6d6cf; }
#tch-gs-app .tch-gs__issues[hidden], #tch-gs-app .tch-gs__fit-hint[hidden] { display: none; }
#tch-gs-app .tch-gs__fit-hint { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px; border-radius: 99px; background: #eef5ec; color: #23613a; font-size: 12.5px; white-space: nowrap; }
#tch-gs-app .tch-gs__fit-hint button { height: 24px; padding: 0 10px; border-radius: 99px; background: #2e7d4a; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
#tch-gs-app .tch-gs__fit-hint button:hover { background: #23613a; }
#tch-gs-app .tch-gs__empty {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 300px; padding: 18px 20px;
	border-radius: 10px; background: rgba(255,255,255,.92); text-align: center; color: var(--gs-muted); pointer-events: none;
	box-shadow: 0 6px 24px rgba(37,33,30,.12);
}
#tch-gs-app .tch-gs__empty p { margin: 0 0 4px; }
#tch-gs-app .tch-gs__empty strong { color: var(--gs-ink); }
#tch-gs-app .tch-gs__empty[hidden] { display: none; }
#tch-gs-app .tch-gs__zoom {
	position: absolute; left: 34px; bottom: 14px; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 4px;
	border-radius: 8px; background: var(--gs-white); box-shadow: 0 4px 16px rgba(37,33,30,.15);
}
#tch-gs-app .tch-gs__zoom button { min-width: 34px; height: 32px; border: 0; border-radius: 6px; background: transparent; font-size: 16px; font-weight: 700; color: var(--gs-ink); cursor: pointer; }
#tch-gs-app .tch-gs__zoom button:hover { background: var(--gs-ivory); }
#tch-gs-app .tch-gs__zoom [data-zoom-fit] { font-size: 12px; padding: 0 10px; }
#tch-gs-app .tch-gs__zoom span { min-width: 48px; text-align: center; font-size: 12px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__legend {
	position: absolute; left: 34px; top: 32px; z-index: 4; display: flex; gap: 12px; padding: 6px 10px; pointer-events: none;
	border-radius: 8px; background: rgba(255,255,255,.9); font-size: 12px; color: var(--gs-muted);
}
#tch-gs-app .tch-gs__legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }

/* Selection card */
#tch-gs-app .tch-gs__selinfo {
	position: absolute; right: 14px; bottom: 14px; z-index: 5; width: 300px; padding: 14px;
	border-radius: 10px; background: var(--gs-white); box-shadow: 0 8px 28px rgba(37,33,30,.18);
}
#tch-gs-app .tch-gs__selinfo[hidden] { display: none; }
#tch-gs-app .tch-gs__sel-title { margin-bottom: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tch-gs-app .tch-gs__sel-row { display: flex; align-items: flex-end; gap: 6px; }
#tch-gs-app .tch-gs__sel-row label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gs-muted); font-weight: 700; }
#tch-gs-app .tch-gs__sel-row input { width: 88px; height: 34px; padding: 0 8px; border: 1px solid var(--gs-line); border-radius: 6px; font: 600 14px var(--gs-body); color: var(--gs-ink); }
#tch-gs-app .tch-gs__sel-x, #tch-gs-app .tch-gs__unit { padding-bottom: 8px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__quality { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; font-size: 13px; }
#tch-gs-app .tch-gs__quality i { width: 10px; height: 10px; border-radius: 50%; }
#tch-gs-app .tch-gs__quality.is-good i { background: #2e9e5b; }
#tch-gs-app .tch-gs__quality.is-ok i { background: #d9a520; }
#tch-gs-app .tch-gs__quality.is-low { color: #b8432f; }
#tch-gs-app .tch-gs__quality.is-low i { background: #d0412f; }
#tch-gs-app .tch-gs__sel-note { margin: 4px 0 0; font-size: 12px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__sel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
#tch-gs-app .tch-gs__sel-actions .tch-gs__btn { height: 32px; padding: 0 10px; font-size: 12px; }

/* Text card */
#tch-gs-app .tch-gs__selinfo { max-height: calc(100% - 28px); overflow: auto; }
#tch-gs-app .tch-gs__tx { width: 100%; min-height: 54px; padding: 8px 10px; border: 1px solid var(--gs-line); border-radius: 6px; font: 600 15px var(--gs-body); color: var(--gs-ink); resize: vertical; }
#tch-gs-app .tch-gs__fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-height: 150px; margin: 10px 0; overflow: auto; padding: 2px; }
#tch-gs-app .tch-gs__font { height: 34px; padding: 0 8px; border: 1px solid var(--gs-line); border-radius: 6px; font-size: 16px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--gs-ink); cursor: pointer; background: #fff; }
#tch-gs-app .tch-gs__font:hover { border-color: var(--gs-tan); }
#tch-gs-app .tch-gs__font[aria-selected="true"] { border-color: var(--gs-espresso); box-shadow: inset 0 0 0 1px var(--gs-espresso); background: #fbf6ee; }
#tch-gs-app .tch-gs__tx-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
#tch-gs-app .tch-gs__tx-label { flex: 0 0 58px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gs-muted); font-weight: 700; }
#tch-gs-app .tch-gs__colors { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
#tch-gs-app .tch-gs__color { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); cursor: pointer; }
#tch-gs-app .tch-gs__color[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gs-espresso); }
#tch-gs-app input[type="color"] { width: 28px; height: 24px; padding: 0; border: 1px solid var(--gs-line); border-radius: 4px; background: #fff; cursor: pointer; }
#tch-gs-app input[type="color"]:disabled { opacity: .35; cursor: default; }
#tch-gs-app .tch-gs__tx-row select { height: 30px; padding: 0 8px; border: 1px solid var(--gs-line); border-radius: 6px; font: 600 13px var(--gs-body); color: var(--gs-ink); background: #fff; }
#tch-gs-app .tch-gs__tx-row input[type="range"] { flex: 1; min-width: 90px; accent-color: var(--gs-espresso); }
#tch-gs-app .tch-gs__align { display: inline-flex; border: 1px solid var(--gs-line); border-radius: 6px; overflow: hidden; }
#tch-gs-app .tch-gs__align button { width: 30px; height: 28px; font-size: 14px; color: var(--gs-ink); cursor: pointer; }
#tch-gs-app .tch-gs__align button[aria-pressed="true"] { background: var(--gs-espresso); color: var(--gs-ivory); }
#tch-gs-app .tch-gs__arr-row .tch-gs__thumb span { font: 700 18px var(--gs-display); color: var(--gs-muted); }

/* Quantity, done dialog, collapsible card */
#tch-gs-app .tch-gs__qty { display: inline-flex; align-items: center; gap: 6px; }
#tch-gs-app .tch-gs__qty span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gs-tan); font-weight: 700; }
#tch-gs-app .tch-gs__qty input { width: 58px; height: 38px; padding: 0 6px; border: 1px solid rgba(243,237,228,.35); border-radius: 6px; background: rgba(243,237,228,.08); color: var(--gs-ivory); font: 700 14px var(--gs-body); text-align: center; }
#tch-gs-app .tch-gs__modal-card--small { width: min(460px, 100%); }
#tch-gs-app .tch-gs__modal-foot--stack { flex-wrap: wrap; justify-content: flex-end; }
#tch-gs-app a.tch-gs__btn { text-decoration: none; }
#tch-gs-app a.tch-gs__btn--dark:hover { color: var(--gs-ivory); }
#tch-gs-app .tch-gs__selinfo .tch-gs__sel-title[role="button"] { cursor: pointer; }
#tch-gs-app .tch-gs__selinfo.is-min > :not(.tch-gs__sel-title) { display: none; }
#tch-gs-app .tch-gs__selinfo.is-min .tch-gs__sel-title { margin: 0; }
#tch-gs-app .tch-gs__selinfo.is-min .tch-gs__sel-title::after { content: " ▴"; color: var(--gs-muted); }

/* Background remover */
#tch-gs-app .tch-gs__modal-card--wide { width: min(880px, 100%); max-height: calc(100vh - 32px); }
#tch-gs-app .tch-gs__bgr-view { display: grid; place-items: center; height: min(56vh, 520px); margin: 0 20px; border-radius: 8px; overflow: hidden; background: repeating-conic-gradient(#e2dbd0 0% 25%, #fff 0% 50%) 50% / 18px 18px; }
#tch-gs-app .tch-gs__bgr-view canvas { display: block; cursor: crosshair; }
#tch-gs-app .tch-gs__bgr-note { margin: 8px 20px 0; font-size: 12px; color: #8a5a00; }
#tch-gs-app .tch-gs__bgr-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 20px; }
#tch-gs-app .tch-gs__bgr-opts input[type="range"] { width: 160px; accent-color: var(--gs-espresso); }
#tch-gs-app .tch-gs__modal-foot .tch-gs__spacer { flex: 1; }

/* Auto-arrange */
#tch-gs-app .tch-gs__tool--accent { background: var(--gs-tan); color: var(--gs-ink); font-weight: 700; }
#tch-gs-app .tch-gs__tool--accent:hover:not(:disabled), #tch-gs-app .tch-gs__tool--accent:focus { background: #d6bd94; color: var(--gs-ink); }
#tch-gs-app .tch-gs__btn--dark { background: var(--gs-espresso); color: var(--gs-ivory); }
#tch-gs-app .tch-gs__btn--dark:hover:not(:disabled) { background: var(--gs-ink); }
#tch-gs-app .tch-gs__modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(37,33,30,.45); }
#tch-gs-app .tch-gs__modal[hidden] { display: none; }
#tch-gs-app .tch-gs__modal-card { display: flex; flex-direction: column; width: min(640px, 100%); max-height: min(720px, calc(100vh - 32px)); border-radius: 12px; background: var(--gs-white); box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
#tch-gs-app .tch-gs__modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
#tch-gs-app .tch-gs__modal-head h2 { margin: 0; font-family: var(--gs-display); font-size: 26px; font-weight: 400; text-transform: uppercase; color: var(--gs-ink); letter-spacing: .01em; }
#tch-gs-app .tch-gs__modal-x { width: 34px; height: 34px; border-radius: 6px; font-size: 24px; color: var(--gs-muted); cursor: pointer; }
#tch-gs-app .tch-gs__modal-x:hover { background: var(--gs-ivory); }
#tch-gs-app .tch-gs__modal-intro { padding: 0 20px 12px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__arr-rows { flex: 1 1 auto; min-height: 80px; overflow: auto; padding: 0 20px; border-top: 1px solid var(--gs-line); border-bottom: 1px solid var(--gs-line); }
#tch-gs-app .tch-gs__arr-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #efe9e0; }
#tch-gs-app .tch-gs__arr-row:last-child { border-bottom: 0; }
#tch-gs-app .tch-gs__arr-row .tch-gs__thumb { flex: 0 0 48px; height: 48px; }
#tch-gs-app .tch-gs__arr-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#tch-gs-app .tch-gs__arr-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tch-gs-app .tch-gs__arr-size { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__arr-size input { width: 70px; height: 30px; padding: 0 6px; border: 1px solid var(--gs-line); border-radius: 6px; font: 600 13px var(--gs-body); color: var(--gs-ink); }
#tch-gs-app .tch-gs__arr-size b { font-weight: 600; color: var(--gs-ink); }
#tch-gs-app .tch-gs__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 4px; }
#tch-gs-app .tch-gs__dot.is-good { background: #2e9e5b; }
#tch-gs-app .tch-gs__dot.is-ok { background: #d9a520; }
#tch-gs-app .tch-gs__dot.is-low { background: #d0412f; }
#tch-gs-app .tch-gs__stepper { display: inline-flex; align-items: center; border: 1px solid var(--gs-line); border-radius: 8px; overflow: hidden; }
#tch-gs-app .tch-gs__stepper button { width: 34px; height: 34px; font-size: 18px; font-weight: 700; color: var(--gs-ink); cursor: pointer; }
#tch-gs-app .tch-gs__stepper button:hover, #tch-gs-app .tch-gs__stepper button:focus { background: var(--gs-ivory); color: var(--gs-ink); }
#tch-gs-app .tch-gs__stepper input { width: 52px; height: 34px; border: 0; border-left: 1px solid var(--gs-line); border-right: 1px solid var(--gs-line); text-align: center; font: 700 14px var(--gs-body); color: var(--gs-ink); -moz-appearance: textfield; }
#tch-gs-app .tch-gs__stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
#tch-gs-app .tch-gs__arr-opts { display: grid; gap: 10px; padding: 14px 20px; }
#tch-gs-app .tch-gs__arr-opt { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; }
#tch-gs-app .tch-gs__arr-opt input { width: 80px; height: 32px; padding: 0 8px; border: 1px solid var(--gs-line); border-radius: 6px; font: 600 13px var(--gs-body); }
#tch-gs-app .tch-gs__arr-opt select { height: 32px; max-width: 260px; padding: 0 8px; border: 1px solid var(--gs-line); border-radius: 6px; font: 600 13px var(--gs-body); color: var(--gs-ink); background: #fff; }
#tch-gs-app .tch-gs__arr-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
#tch-gs-app .tch-gs__arr-check input { width: 18px; height: 18px; accent-color: var(--gs-espresso); }
#tch-gs-app .tch-gs__modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: #fbf9f5; border-top: 1px solid var(--gs-line); }
#tch-gs-app .tch-gs__arr-summary { flex: 1; font-size: 13.5px; color: var(--gs-ink); }
#tch-gs-app .tch-gs__arr-summary.is-error { color: #a3321f; }

/* Toast */
#tch-gs-app .tch-gs__toast {
	position: fixed; left: 50%; bottom: 24px; z-index: 1000000; max-width: min(520px, calc(100% - 32px));
	padding: 12px 16px; border-radius: 8px; background: var(--gs-ink); color: var(--gs-ivory);
	box-shadow: 0 8px 24px rgba(0,0,0,.25); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
	transition: opacity .2s, transform .2s;
}
#tch-gs-app .tch-gs__toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
#tch-gs-app .tch-gs__toast.is-error { background: #8f2f21; }
#tch-gs-app .tch-gs__toast.is-warn { background: #6b4a12; }

/* Phones and small tablets */
@media (max-width: 860px) {
	#tch-gs-app { grid-template-rows: auto 1fr; }
	#tch-gs-app .tch-gs__bar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 10px; }
	#tch-gs-app .tch-gs__brand { flex: 1; }
	#tch-gs-app .tch-gs__title { display: none; }
	#tch-gs-app .tch-gs__logo { height: 26px; max-width: 170px; object-fit: contain; object-position: left center; }
	#tch-gs-app .tch-gs__bar-actions { order: 2; margin-left: auto; gap: 8px; }
	#tch-gs-app .tch-gs__bar-actions .tch-gs__btn--primary { height: 34px; padding: 0 12px; font-size: 12px; }
	#tch-gs-app .tch-gs__icon-btn { width: 34px; height: 34px; font-size: 22px; }
	#tch-gs-app .tch-gs__size { order: 3; margin-left: 0; flex: 1 1 200px; min-width: 0; }
	#tch-gs-app .tch-gs__size span { display: none; }
	#tch-gs-app .tch-gs__size select { flex: 1; min-width: 0; height: 36px; }
	#tch-gs-app .tch-gs__price { order: 4; min-width: 0; }
	#tch-gs-app .tch-gs__price-label { display: none; }
	#tch-gs-app .tch-gs__price strong { font-size: 22px; }
	#tch-gs-app .tch-gs__body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
	#tch-gs-app .tch-gs__panel { order: 2; max-height: 34vh; border-right: 0; border-top: 1px solid var(--gs-line); }
	#tch-gs-app .tch-gs__drop { margin: 8px 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; }
	#tch-gs-app .tch-gs__drop-title { font-size: 16px; margin: 0; }
	#tch-gs-app .tch-gs__drop-text { display: none; }
	#tch-gs-app .tch-gs__hint { width: 100%; margin: 2px 0 0; font-size: 11px; }
	#tch-gs-app .tch-gs__panel-head { padding: 0 10px 6px; }
	#tch-gs-app .tch-gs__uploads { padding: 0 10px 10px; }
	#tch-gs-app .tch-gs__legend { display: none; }
	#tch-gs-app .tch-gs__selinfo { left: 10px; right: 10px; bottom: 58px; width: auto; padding: 12px; max-height: 55%; }
	#tch-gs-app .tch-gs__fonts { max-height: 112px; }
	#tch-gs-app .tch-gs__qty span { display: none; }
	#tch-gs-app .tch-gs__qty input { width: 46px; height: 34px; }
	#tch-gs-app .tch-gs__sel-title::after { content: " ▾"; color: var(--gs-muted); }
	#tch-gs-app .tch-gs__modal-foot--stack .tch-gs__btn { flex: 1 1 100%; }
	#tch-gs-app .tch-gs__zoom { left: 10px; bottom: 10px; }
	#tch-gs-app .tch-gs__ruler, #tch-gs-app .tch-gs__ruler-corner { display: none; }
	#tch-gs-app .tch-gs__canvas-wrap { top: 0; left: 0; }
	#tch-gs-app .tch-gs__tools { min-height: 42px; padding: 4px 6px; }
	#tch-gs-app .tch-gs__tool span { display: none; }
	#tch-gs-app .tch-gs__tool--accent span { display: inline; }
	#tch-gs-app .tch-gs__gap span:first-child { display: none; }
	#tch-gs-app .tch-gs__gap input { width: 54px; }
	#tch-gs-app .tch-gs__modal { padding: 0; place-items: end stretch; }
	#tch-gs-app .tch-gs__modal-card { width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0; }
	#tch-gs-app .tch-gs__modal-foot { flex-wrap: wrap; }
	#tch-gs-app .tch-gs__arr-summary { flex-basis: 100%; }
	#tch-gs-app .tch-gs__bgr-view { height: 42vh; margin: 0 12px; }
	#tch-gs-app .tch-gs__bgr-opts { gap: 8px 14px; padding: 10px 12px; }
	#tch-gs-app .tch-gs__tool { padding: 0 8px; }
	#tch-gs-app .tch-gs__bgpick > span { display: none; }
	#tch-gs-app .tch-gs__sel-actions .tch-gs__btn { flex: 1 1 auto; }
}

/* ---------- Upload a finished sheet (product page) ---------- */
#tch-gsu { margin: 8px 0 24px; font-family: var(--tch-font-body, Arimo, Arial, sans-serif); color: var(--tch-ink, #25211e); }
#tch-gsu .tch-gsu__card { padding: 20px; border: 1px solid var(--tch-line, #ddd5c9); border-radius: 10px; background: #fff; }
#tch-gsu .tch-gsu__title { margin: 0 0 4px; font-family: var(--tch-font-display, Anton, Impact, sans-serif); font-size: 22px; font-weight: 400; text-transform: uppercase; letter-spacing: .01em; }
#tch-gsu .tch-gsu__intro { margin: 0 0 14px; color: var(--tch-muted, #655b53); font-size: 14px; }
#tch-gsu .tch-gsu__drop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 18px; border: 2px dashed var(--tch-line, #ddd5c9); border-radius: 10px; background: #fbf9f5; }
#tch-gsu .tch-gsu__drop.is-over { border-color: var(--tch-tan, #c7aa7c); background: #f6efe3; }
#tch-gsu .tch-gsu__drop[hidden], #tch-gsu [hidden] { display: none !important; }
#tch-gsu .tch-gsu__or { color: var(--tch-muted, #655b53); font-size: 14px; }
#tch-gsu .tch-gsu__hint { flex-basis: 100%; margin: 4px 0 0; font-size: 12.5px; color: var(--tch-muted, #655b53); }
#tch-gsu .tch-gsu__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid var(--tch-espresso, #352923); border-radius: 6px; background: #fff; color: var(--tch-espresso, #352923); font: 700 14px var(--tch-font-body, Arimo, Arial, sans-serif); text-transform: none; letter-spacing: normal; text-decoration: none; cursor: pointer; box-shadow: none; }
#tch-gsu .tch-gsu__btn:hover { background: var(--tch-ivory, #f3ede4); color: var(--tch-espresso, #352923); }
#tch-gsu .tch-gsu__btn--dark { background: var(--tch-espresso, #352923); color: var(--tch-ivory, #f3ede4); }
#tch-gsu .tch-gsu__btn--dark:hover { background: var(--tch-ink, #25211e); color: var(--tch-ivory, #f3ede4); }
#tch-gsu .tch-gsu__btn--primary { background: var(--tch-tan, #c7aa7c); border-color: var(--tch-tan, #c7aa7c); color: var(--tch-ink, #25211e); text-transform: uppercase; letter-spacing: .05em; }
#tch-gsu .tch-gsu__btn--primary:hover:not(:disabled) { background: #d6bd94; }
#tch-gsu .tch-gsu__btn:disabled { opacity: .5; cursor: not-allowed; }
#tch-gsu .tch-gsu__result { display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: start; }
#tch-gsu .tch-gsu__preview { min-height: 120px; max-height: 420px; overflow: auto; border-radius: 8px; border: 1px solid var(--tch-line, #ddd5c9); background: repeating-conic-gradient(#e7e1d8 0% 25%, #fff 0% 50%) 50% / 14px 14px; }
#tch-gsu .tch-gsu__preview img { display: block; width: 100%; height: auto; }
#tch-gsu .tch-gsu__nopreview { padding: 30px 10px; text-align: center; font-size: 12px; color: var(--tch-muted, #655b53); }
#tch-gsu .tch-gsu__facts { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#tch-gsu .tch-gsu__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tch-gsu .tch-gsu__meta { font-size: 13.5px; color: var(--tch-muted, #655b53); }
#tch-gsu .tch-gsu__quality { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
#tch-gsu .tch-gsu__quality i { width: 10px; height: 10px; border-radius: 50%; background: #2e9e5b; }
#tch-gsu .tch-gsu__quality.is-ok i { background: #d9a520; }
#tch-gsu .tch-gsu__quality.is-low { color: #b8432f; }
#tch-gsu .tch-gsu__quality.is-low i { background: #d0412f; }
#tch-gsu .tch-gsu__quality small { flex-basis: 100%; font-weight: 400; color: var(--tch-muted, #655b53); }
#tch-gsu .tch-gsu__warn { padding: 8px 10px; border-radius: 6px; background: #fdf3df; color: #7a5200; font-size: 13px; }
#tch-gsu .tch-gsu__bar { height: 6px; border-radius: 6px; background: var(--tch-ivory, #f3ede4); overflow: hidden; }
#tch-gsu .tch-gsu__bar span { display: block; height: 100%; width: 0; background: var(--tch-tan, #c7aa7c); transition: width .2s; }
#tch-gsu .tch-gsu__status { font-size: 13px; color: var(--tch-muted, #655b53); }
#tch-gsu .tch-gsu__status.is-error, #tch-gsu .tch-gsu__fit.is-error { color: #a3321f; }
#tch-gsu .tch-gsu__field { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 700; }
#tch-gsu .tch-gsu__field span { min-width: 80px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--tch-muted, #655b53); }
#tch-gsu .tch-gsu__field select, #tch-gsu .tch-gsu__field input { height: 40px; padding: 0 10px; border: 1px solid var(--tch-line, #ddd5c9); border-radius: 6px; font: 600 14px var(--tch-font-body, Arimo, Arial, sans-serif); color: var(--tch-ink, #25211e); background: #fff; }
#tch-gsu .tch-gsu__field select { flex: 1; min-width: 0; }
#tch-gsu .tch-gsu__field input { width: 80px; }
#tch-gsu .tch-gsu__fit { font-size: 13px; color: var(--tch-muted, #655b53); }
#tch-gsu .tch-gsu__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#tch-gsu .tch-gsu__done { padding: 12px; border-radius: 8px; background: #eef5ec; color: #23613a; font-size: 14px; }
#tch-gsu .tch-gsu__alt { margin: 14px 0 0; font-size: 13.5px; color: var(--tch-muted, #655b53); }
#tch-gsu .tch-gsu__alt a { color: var(--tch-tan-deep, #a8885a); font-weight: 700; }
@media (max-width: 600px) {
	#tch-gsu .tch-gsu__result { grid-template-columns: 1fr; }
	#tch-gsu .tch-gsu__preview { max-height: 260px; }
}

/* Design Library (v0.8) */
#tch-gs-app .tch-gs__lib {
	display: flex; align-items: center; gap: 12px; width: auto; margin: 0 16px 16px; padding: 12px 14px;
	border: 1px solid var(--gs-tan); border-radius: 10px; background: #fbf6ee; color: var(--gs-ink); text-align: left; cursor: pointer;
	transition: background .15s, border-color .15s;
}
#tch-gs-app .tch-gs__lib:hover { background: #f4ead9; border-color: var(--gs-tan-deep); }
#tch-gs-app .tch-gs__lib, #tch-gs-app .tch-gs__lib span, #tch-gs-app .tch-gs__lib small { white-space: normal; overflow-wrap: anywhere; }
#tch-gs-app .tch-gs__lib span { min-width: 0; line-height: 1.3; }
#tch-gs-app .tch-gs__lib svg { width: 30px; height: 30px; flex: none; color: var(--gs-tan-deep); }
#tch-gs-app .tch-gs__lib strong { display: block; font-size: 14px; }
#tch-gs-app .tch-gs__lib small { display: block; margin-top: 1px; font-size: 12px; color: var(--gs-muted); }
#tch-gs-app .tch-gs__libtag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; background: var(--gs-ivory); color: var(--gs-tan-deep); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
#tch-gs-app .tch-gs__libtag.is-mine { background: #e6f0e8; color: #2e6b43; }
#tch-gs-app .tch-gs__keep { display: inline-block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--gs-tan-deep); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
#tch-gs-app .tch-gs__keep:disabled { opacity: .7; cursor: default; }
#tch-gs-app .tch-gs__keep.is-done { color: #2e6b43; text-decoration: none; }
@media (max-width: 860px) {
	#tch-gs-app .tch-gs__lib { margin: 0 10px 8px; padding: 8px 12px; }
	#tch-gs-app .tch-gs__lib svg { width: 24px; height: 24px; }
	#tch-gs-app .tch-gs__lib small { display: none; }
}
