.tgd-hd-host { container-type: inline-size; width: 100%; margin: 1.5em 0; } .tgd-hd-host.tgd-hd-host--full {
width: min(1320px, calc(100vw - 32px)) !important;
max-width: none !important;
margin-left: calc(50% - min(660px, 50vw - 16px)) !important;
margin-right: 0 !important;
}
.tgd-hd {
--hd-accent: #e91e63;
--hd-accent-2: #c2185b;
--hd-ink: #1f2933;
--hd-muted: #6b7785;
--hd-line: #e3e7ec;
--hd-bg: #f4f6f9;
--hd-panel: #ffffff;
--hd-radius: 10px;
position: relative;
display: grid;
grid-template-columns: 270px minmax(0, 1fr) 290px;
gap: 14px;
align-items: start;
max-width: 1320px;
margin: 0 auto;
padding: 14px;
background: var(--hd-bg);
border-radius: 14px;
color: var(--hd-ink);
font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 1.45;
box-sizing: border-box;
}
.tgd-hd *, .tgd-hd *::before, .tgd-hd *::after { box-sizing: border-box; }
.tgd-hd button, .tgd-hd input, .tgd-hd select, .tgd-hd textarea, .tgd-hd h3, .tgd-hd h4 { font-family: inherit; color: inherit; margin: 0; }
.tgd-hd button, .tgd-hd input, .tgd-hd select, .tgd-hd textarea { font-size: inherit; line-height: inherit; }
.tgd-hd button {
cursor: pointer;
border: 1px solid var(--hd-line);
background: #fff;
border-radius: 8px;
padding: 6px 10px;
line-height: 1.2;
min-height: 34px;
text-transform: none;
letter-spacing: 0;
box-shadow: none;
transition: border-color .15s, background .15s, color .15s;
}
.tgd-hd button:hover:not(:disabled) { border-color: var(--hd-accent); color: var(--hd-accent); }
.tgd-hd button:disabled { opacity: .4; cursor: not-allowed; }
.tgd-hd button.is-active, .tgd-hd button.is-active:hover:not(:disabled) { background: var(--hd-accent); border-color: var(--hd-accent); color: #fff; }
.tgd-hd input:not([type=range]):not([type=color]), .tgd-hd select, .tgd-hd textarea {
width: 100%;
border: 1px solid var(--hd-line);
border-radius: 8px;
padding: 8px 10px;
background: #fff;
min-height: 38px;
box-shadow: none;
}
.tgd-hd textarea { resize: vertical; }
.tgd-hd input:focus, .tgd-hd select:focus, .tgd-hd textarea:focus, .tgd-hd button:focus-visible { outline: 2px solid rgba(233, 30, 99, .35); outline-offset: 1px; border-color: var(--hd-accent); }
.tgd-hd input[type=color] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--hd-line); border-radius: 8px; background: #fff; }
.tgd-hd input[type=range] { width: 100%; accent-color: var(--hd-accent); }
.tgd-hd__side, .tgd-hd__props { display: flex; flex-direction: column; gap: 12px; }
.tgd-hd__side { background: var(--hd-panel); border-radius: var(--hd-radius); border: 1px solid var(--hd-line); overflow: hidden; position: sticky; top: 12px; max-height: calc(100vh - 24px); }
.tgd-hd__tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--hd-line); }
.tgd-hd__tabs button { border: 0; border-radius: 0; padding: 12px 2px; font-weight: 600; font-size: 13px; min-height: 44px; background: #fff; }
.tgd-hd__tabs button.is-active { background: #fff; color: var(--hd-accent); box-shadow: inset 0 -3px 0 var(--hd-accent); }
.tgd-hd__panel { display: none; padding: 12px; overflow-y: auto; flex-direction: column; gap: 10px; }
.tgd-hd__panel.is-active { display: flex; }
.tgd-hd__hint { margin: 0; color: var(--hd-muted); font-size: 12.5px; }
.tgd-hd__label { display: block; margin: 6px 0 4px; font-weight: 600; font-size: 12.5px; color: var(--hd-muted); }
.tgd-hd__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tgd-hd__templates { grid-template-columns: repeat(2, 1fr); }
.tgd-hd__tpl { display: flex; flex-direction: column; gap: 4px; padding: 6px !important; align-items: stretch; }
.tgd-hd__thumb { display: block; aspect-ratio: 1; background: #fafbfc; border-radius: 6px; overflow: hidden; }
.tgd-hd__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tgd-hd__name { font-size: 12.5px; font-weight: 600; text-align: center; }
.tgd-hd__icon { aspect-ratio: 1; padding: 8px !important; display: flex; align-items: center; justify-content: center; }
.tgd-hd__icon svg, .tgd-hd__icon img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.tgd-hd__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tgd-hd__chips button { font-size: 12.5px; padding: 5px 9px; min-height: 30px; border-radius: 99px; }
.tgd-hd__btn { font-weight: 600; padding: 10px 14px !important; min-height: 42px !important; width: 100%; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.tgd-hd .tgd-hd__btn--primary { background: var(--hd-accent); border-color: var(--hd-accent); color: #fff; }
.tgd-hd .tgd-hd__btn--primary:hover:not(:disabled) { background: var(--hd-accent-2); color: #fff; }
.tgd-hd__upload { display: block; cursor: pointer; }
.tgd-hd__upload .tgd-hd__btn { border-radius: 8px; }
.tgd-hd__stage { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tgd-hd__toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--hd-panel); border: 1px solid var(--hd-line); border-radius: var(--hd-radius); padding: 8px; }
.tgd-hd__toolbar button { min-width: 38px; font-size: 16px; }
.tgd-hd__toolbar [data-act=clear] { font-size: 13px; margin-left: auto; }
.tgd-hd__sep { width: 1px; height: 24px; background: var(--hd-line); margin: 0 2px; }
.tgd-hd .tgd-hd__danger:hover:not(:disabled) { color: #d32f2f; border-color: #d32f2f; }
.tgd-hd__canvaswrap {
width: 100%;
border-radius: var(--hd-radius);
border: 1px solid var(--hd-line);
background-color: #e9edf2;
background-image: radial-gradient(#d3d9e1 1px, transparent 1px);
background-size: 16px 16px;
overflow: hidden;
touch-action: none;
-webkit-user-select: none;
user-select: none;
}
.tgd-hd__canvaswrap canvas { display: block; }
.tgd-hd__status { font-size: 13px; color: var(--hd-muted); background: #fff; border: 1px solid var(--hd-line); border-radius: 8px; padding: 8px 12px; min-height: 36px; }
.tgd-hd__status.is-warn { color: #8a4b00; background: #fff7e6; border-color: #ffd591; }
.tgd-hd__box { background: var(--hd-panel); border: 1px solid var(--hd-line); border-radius: var(--hd-radius); padding: 12px; }
.tgd-hd__box h4 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--hd-ink); }
.tgd-hd__row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tgd-hd__row > input[type=range] { flex: 1; width: auto; }
.tgd-hd__swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-bottom: 6px; }
.tgd-hd__swatches button { aspect-ratio: 1; padding: 0; min-height: 0; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.tgd-hd__offsets button { flex: 1; font-size: 12.5px; }
.tgd-hd__masks button { font-size: 12.5px; padding: 5px 8px; }
.tgd-hd__qty { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.tgd-hd__qty input { width: 80px !important; text-align: center; font-weight: 700; font-size: 16px; }
.tgd-hd__qty button { width: 38px; font-size: 18px; font-weight: 700; }
.tgd-hd__tiers { width: 100%; border-collapse: collapse; margin: 0 0 8px; font-size: 13px; border: 0; }
.tgd-hd__tiers td { padding: 5px 8px; border: 0; border-bottom: 1px dashed var(--hd-line); background: transparent; }
.tgd-hd__tiers td:last-child { text-align: right; white-space: nowrap; }
.tgd-hd__tiers tr.is-active td { background: #fde7ef; color: var(--hd-accent-2); font-weight: 700; }
.tgd-hd__total { display: flex; flex-direction: column; gap: 2px; }
.tgd-hd__sum { font-size: 17px; }
.tgd-hd__sum strong, .tgd-hd__sum b { color: var(--hd-accent); }
.tgd-hd__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tgd-hd__mine { display: flex; flex-direction: column; gap: 8px; }
.tgd-hd__card { display: flex; gap: 8px; border: 1px solid var(--hd-line); border-radius: 8px; padding: 6px; }
.tgd-hd__card img, .tgd-hd__noprev { width: 70px; height: 90px; object-fit: contain; background: #eef0f3; border-radius: 6px; flex: none; }
.tgd-hd__cardbody { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tgd-hd__cardbody strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgd-hd__cardbody small { color: var(--hd-muted); }
.tgd-hd__cardbody button { font-size: 12.5px; padding: 4px 10px; min-height: 30px; }
.tgd-hd__modal { position: fixed; inset: 0; z-index: 99999; background: rgba(15, 23, 32, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tgd-hd__modal[hidden] { display: none; }
.tgd-hd__dialog { position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.tgd-hd__dialog h3 { margin: 0; font-size: 19px; font-weight: 700; }
.tgd-hd__dialog label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.tgd-hd__close { position: absolute; top: 10px; right: 10px; width: 36px; font-size: 20px !important; border: 0 !important; }
.tgd-hd__ordersum { display: flex; gap: 12px; align-items: center; background: var(--hd-bg); border-radius: 10px; padding: 10px; }
.tgd-hd__ordersum img { width: 90px; height: auto; border-radius: 6px; background: #fff; }
.tgd-hd__formmsg { color: #c62828; font-size: 13.5px; min-height: 1em; }
.tgd-hd__ok { color: #2e7d32; font-weight: 600; }
.tgd-hd .tgd-hd__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.tgd-hd__toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 100000; background: #263238; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.tgd-hd__toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.tgd-hd__toast[data-type=error] { background: #c62828; }
.tgd-hd__toast[data-type=ok] { background: #2e7d32; }
.tgd-hd__loading { display: none; }
.tgd-hd[data-loading] .tgd-hd__loading { display: flex; position: absolute; inset: 0; z-index: 5; align-items: center; justify-content: center; background: rgba(244,246,249,.85); border-radius: 14px; font-weight: 600; color: var(--hd-muted); }
.tgd-hd.is-busy { cursor: progress; }
.tgd-hd.is-busy .tgd-hd__actions button { pointer-events: none; opacity: .6; }
@container (max-width: 1100px) {
.tgd-hd { grid-template-columns: 250px minmax(0, 1fr); }
.tgd-hd__props { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tgd-hd__actions { grid-column: 1 / -1; }
}
@container (max-width: 760px) {
.tgd-hd { grid-template-columns: minmax(0, 1fr); padding: 8px; gap: 10px; }
.tgd-hd__stage { order: 1; }
.tgd-hd__side { order: 2; position: static; max-height: none; }
.tgd-hd__props { order: 3; display: flex; }
.tgd-hd__grid { grid-template-columns: repeat(4, 1fr); }
.tgd-hd__templates { grid-template-columns: repeat(3, 1fr); }
.tgd-hd__toolbar { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 6px; }
.tgd-hd__toolbar button { min-width: 36px; flex: none; }
.tgd-hd__actions { position: sticky; bottom: 0; background: var(--hd-bg); padding: 8px 0; z-index: 3; }
} .tgd-hd__grow { flex: 1; }
.tgd-hd__mini { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--hd-muted); }
.tgd-hd__mini input[type=range] { flex: 1; }
.tgd-hd__check { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--hd-muted); margin-top: 6px; }
.tgd-hd__bgopts { margin-top: 6px; }
.tgd-hd__cropdialog { max-width: 720px; }
.tgd-hd__ratios button { font-size: 12.5px; }
.tgd-hd__cropstage { position: relative; align-self: center; max-width: 100%; line-height: 0; touch-action: none; user-select: none; -webkit-user-select: none;
background-color: #fff; background-image: linear-gradient(45deg,#e6e9ee 25%,transparent 25%,transparent 75%,#e6e9ee 75%), linear-gradient(45deg,#e6e9ee 25%,transparent 25%,transparent 75%,#e6e9ee 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.tgd-hd__cropstage img { display: block; max-width: 100%; max-height: 58vh; width: auto; height: auto; pointer-events: none; }
.tgd-hd__cropbox { position: absolute; border: 2px solid #fff; outline: 1px solid var(--hd-accent); box-shadow: 0 0 0 9999px rgba(15, 23, 32, .55); cursor: move; }
.tgd-hd__cropstage { overflow: hidden; }
.tgd-hd__cropbox span { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid var(--hd-accent); border-radius: 50%; }
.tgd-hd__cropbox [data-h=nw] { left: -3px; top: -3px; cursor: nwse-resize; }
.tgd-hd__cropbox [data-h=ne] { right: -3px; top: -3px; cursor: nesw-resize; }
.tgd-hd__cropbox [data-h=sw] { left: -3px; bottom: -3px; cursor: nesw-resize; }
.tgd-hd__cropbox [data-h=se] { right: -3px; bottom: -3px; cursor: nwse-resize; }
.tgd-hd input[type=checkbox] { width: 16px !important; height: 16px !important; min-height: 0 !important; flex: none; margin-top: 2px; accent-color: var(--hd-accent); } .tgd-hd-fullpage { max-width: 1360px; margin: 0 auto; padding: 16px; box-sizing: border-box; width: 100%; }
.tgd-hd-fullpage__title { margin: 8px 0 16px; font-size: clamp(22px, 3vw, 32px); }
.tgd-hd-fullpage .tgd-hd-host.tgd-hd-host--full, body.tgd-hd-nosidebar .tgd-hd-host.tgd-hd-host--full { width: 100% !important; margin-left: 0 !important; }