/* ============================================================
   Thiết kế đồng phục — UI giống PrintStyle (boxed layout)
   ============================================================ */

/* ---- Trang: reset theme wrapper, khung boxed ---- */
.halink-tshirt-designer-page #content,
.page-template-page-thiet-ke #content,
.page-template-templates-page-thiet-ke-php #content {
  background: #eceff3;
}

.halink-tshirt-designer-page #content > .container,
.page-template-page-thiet-ke #content > .container,
.page-template-templates-page-thiet-ke-php #content > .container {
  max-width: 1320px;
  width: 100%;
  padding: 16px 15px 24px;
  margin: 0 auto;
}

.halink-tshirt-designer-page #primary,
.halink-tshirt-designer-page .content-area,
.page-template-templates-page-thiet-ke-php #primary,
.page-template-templates-page-thiet-ke-php .content-area {
  width: 100% !important;
  float: none !important;
  max-width: none !important;
  padding: 0 !important;
}

.halink-tshirt-designer-page #content > .container > .row,
.page-template-templates-page-thiet-ke-php #content > .container > .row {
  margin-left: 0;
  margin-right: 0;
}

.halink-tshirt-designer-page .entry-content,
.page-template-templates-page-thiet-ke-php .entry-content {
  padding: 0 !important;
  margin: 0 !important;
}

.page-template-page-thiet-ke .pageHero,
.page-template-page-thiet-ke .entry-header,
.page-template-templates-page-thiet-ke-php .pageHero,
.page-template-templates-page-thiet-ke-php .entry-header {
  display: none !important;
}

/* Footer & hotline giữ nguyên — không ẩn */

.halink-tshirt-designer-page .site-header,
.page-template-templates-page-thiet-ke-php .site-header {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ---- Variables ---- */
.tsd {
  --tsd-bg: #eceff3;
  --tsd-panel: #ffffff;
  --tsd-border: #d5dbe3;
  --tsd-border-dark: #c4cad4;
  --tsd-text: #333842;
  --tsd-muted: #7a8494;
  --tsd-accent: #f3a64b;
  --tsd-accent-dark: #e8952f;
  --tsd-accent-hover: #df8a22;
  --tsd-tool: #5c6573;
  --tsd-active-bg: #4a5260;
  --tsd-left-w: 196px;
  --tsd-right-w: 258px;
  --tsd-flyout-w: 268px;
  --tsd-frame-max: 1320px;
  --tsd-stage-max: 580px;
  box-sizing: border-box;
  color: var(--tsd-text);
  font-family: Roboto, "Segoe UI", Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.tsd-frame {
  position: relative;
  max-width: var(--tsd-frame-max);
  margin: 0 auto 20px;
  background: var(--tsd-panel);
  border: 1px solid var(--tsd-border);
  box-shadow: 0 2px 16px rgba(16, 24, 40, 0.08);
  overflow: hidden;
}

.tsd-frame.is-modal-open {
  overflow: hidden;
}

.tsd *,
.tsd *::before,
.tsd *::after {
  box-sizing: border-box;
}

/* Font Awesome trong tool */
.tsd .fas,
.tsd .tsd-color.is-active::after,
.tsd .tsd-details summary::after {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}

.tsd .far {
  font-family: "Font Awesome 5 Free";
  font-weight: 400;
}

/* ---- Shell grid ---- */
.tsd-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--tsd-left-w) minmax(0, 1fr) var(--tsd-right-w);
  gap: 0;
  min-height: 720px;
  background: var(--tsd-panel);
  align-items: stretch;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
.tsd-left {
  border-right: 1px solid var(--tsd-border);
  display: flex;
  flex-direction: column;
  background: #fff;
  min-height: 100%;
}

.tsd-left__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--tsd-border);
  background: var(--tsd-panel);
}

.tsd-chip {
  border: 1px solid var(--tsd-border);
  background: var(--tsd-panel);
  color: var(--tsd-text);
  font-size: 11px;
  padding: 9px 4px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1.25;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.tsd-chip span {
  display: block;
}

.tsd-chip:hover {
  border-color: var(--tsd-border-dark);
  background: #fafbfc;
}

/* Menu items — bordered boxes like PrintStyle */
.tsd-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  flex: 1;
  overflow-y: auto;
}

.tsd-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--tsd-border);
  background: var(--tsd-panel);
  padding: 11px 12px;
  color: var(--tsd-text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.tsd-menu__icon {
  width: 22px;
  flex-shrink: 0;
  text-align: center;
  color: var(--tsd-tool);
  font-size: 15px;
}

.tsd-menu__text {
  flex: 1;
  line-height: 1.3;
}

.tsd-menu__item:hover {
  border-color: var(--tsd-border-dark);
  background: #fafbfc;
}

.tsd-menu__item.is-active {
  background: #eef1f6;
  border-color: #b8c0cc;
  font-weight: 600;
  color: #1a1f28;
  box-shadow: inset 0 0 0 1px rgba(74, 82, 96, 0.08);
}

.tsd-menu__item.is-active .tsd-menu__icon {
  color: #2b3340;
}

/* Layers dropdown */
.tsd-layers {
  border-top: 1px solid var(--tsd-border);
  padding: 10px;
  background: var(--tsd-panel);
}

.tsd-layers__label {
  display: block;
  font-size: 12px;
  color: var(--tsd-muted);
  margin-bottom: 6px;
}

.tsd-layers__select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--tsd-border);
  border-radius: 3px;
  background: #fff;
  padding: 0 10px;
  font-size: 12px;
  color: var(--tsd-text);
  cursor: pointer;
  appearance: auto;
}

/* ============================================================
   FLYOUT — Edit Text (overlay tsd-left, không đẩy canvas)
   ============================================================ */
.tsd-flyout {
  pointer-events: none;
}

.tsd-flyout[hidden] {
  display: none !important;
}

.tsd-flyout--text {
  position: absolute;
  left: 6px;
  top: 10px;
  width: min(292px, calc(100% - 12px));
  max-height: calc(100% - 20px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  box-shadow: 0 10px 32px rgba(16, 24, 40, 0.16);
  pointer-events: auto;
  overflow: hidden;
}

.tsd-flyout__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--tsd-border);
  background: #fff;
  flex-shrink: 0;
}

.tsd-flyout__head h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  color: #1a1f28;
}

.tsd-flyout__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #98a2b3;
  cursor: pointer;
  padding: 0 2px;
}

.tsd-flyout__close:hover {
  color: #344054;
}

.tsd-flyout__body {
  padding: 12px 14px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.tsd-flyout--text .tsd-text-editor .tsd-field {
  margin-bottom: 10px;
}

.tsd-flyout--text .tsd-text-editor .tsd-field > span {
  display: block;
  font-size: 12px;
  color: #667085;
  margin-bottom: 4px;
}

.tsd-flyout--text .tsd-field--textarea textarea {
  width: 100%;
  min-height: 72px;
  max-height: 120px;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
  color: #1a1f28;
  font-family: Arial, sans-serif;
  background: #fff;
}

.tsd-flyout--text .tsd-field select,
.tsd-flyout--text .tsd-field input[type="number"] {
  width: 100%;
  height: 34px;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  padding: 0 8px;
  font-size: 13px;
  color: #344054;
  background: #fff;
}

.tsd-color-swatch {
  display: block;
  position: relative;
  width: 100%;
  height: 34px;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
}

.tsd-color-swatch::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -2px;
  border: 4px solid transparent;
  border-top-color: #667085;
  pointer-events: none;
}

.tsd-color-swatch input[type="color"] {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.tsd-color-swatch--sm {
  width: 44px;
  flex-shrink: 0;
}

.tsd-color-swatch--sm::after {
  right: 4px;
  border-width: 3px;
}

.tsd-flyout--text .tsd-text-style-row {
  display: flex;
  gap: 4px;
}

.tsd-flyout--text .tsd-text-style-btn {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tsd-flyout--text .tsd-text-style-btn[data-style="italic"] {
  font-style: italic;
  font-weight: 600;
}

.tsd-flyout--text .tsd-text-style-btn[data-style="underline"] {
  text-decoration: underline;
  font-weight: 600;
}

.tsd-flyout--text .tsd-text-style-btn.is-active {
  background: #eef1f6;
  border-color: #98a2b3;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.08);
}

.tsd-flyout--text .tsd-field-row {
  display: flex;
  gap: 8px;
}

.tsd-flyout--text .tsd-field--half {
  flex: 1;
  min-width: 0;
}

.tsd-flyout--text .tsd-field--check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #667085;
  cursor: pointer;
}

.tsd-flyout--text .tsd-field--check input {
  margin: 0;
}

.tsd-flyout--text .tsd-text-rotate {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tsd-flyout--text .tsd-text-rotate input[type="number"] {
  flex: 1;
}

.tsd-flyout--text .tsd-text-rotate__deg {
  color: #667085;
  font-size: 13px;
}

.tsd-flyout--text .tsd-text-rotate__reset {
  width: 34px;
  height: 34px;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  background: #fff;
  color: #667085;
  cursor: pointer;
  flex-shrink: 0;
}

.tsd-flyout--text .tsd-text-stroke-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tsd-flyout--text .tsd-text-stroke-row select {
  flex: 1;
  height: 34px;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  padding: 0 8px;
  font-size: 13px;
  background: #fff;
}

.tsd-flyout--text .tsd-field--range {
  margin-bottom: 0;
  padding-top: 6px;
}

.tsd-flyout--text .tsd-field--range input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #98a2b3;
}

.tsd-text-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.tsd-text-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.tsd-flyout--text .tsd-field--check-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 0;
  font-size: 11px;
  color: #667085;
  white-space: nowrap;
}

.tsd-flyout--text .tsd-field--check-inline input {
  margin: 0;
}

/* ============================================================
   CENTER STAGE
   ============================================================ */
.tsd-center {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #fff;
  min-height: 720px;
  overflow: hidden;
}

.tsd-center.is-stage-zoomed {
  overflow: hidden;
}

.tsd-center.is-stage-zoomed .tsd-center__inner {
  justify-content: flex-start;
  padding-top: 48px;
}

.tsd-center.is-stage-zoomed .tsd-stage-wrap {
  transform: scale(2);
  transform-origin: center 42%;
}

.tsd-center .tsd-stage-wrap {
  transition: transform 0.22s ease;
}

.tsd-center .tsd-utils button.is-active {
  color: #2563eb;
  background: #eff6ff;
}

/* Thanh công cụ nhanh — góc trên canvas (giống PrintStyle) */
.tsd-center .tsd-utils {
  position: absolute;
  top: 10px;
  right: 42px;
  z-index: 6;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0;
  border: 1px solid var(--tsd-border);
  background: var(--tsd-panel);
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.tsd-center .tsd-utils button {
  border: 0;
  border-right: 1px solid var(--tsd-border);
  background: transparent;
  color: var(--tsd-tool);
  font-size: 10px;
  padding: 7px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 52px;
  border-radius: 0;
  transition: background 0.12s, color 0.12s;
}

.tsd-center .tsd-utils button:last-child {
  border-right: 0;
}

.tsd-center .tsd-utils button i {
  font-size: 15px;
  width: 16px;
  text-align: center;
}

.tsd-center .tsd-utils button span {
  line-height: 1.1;
  white-space: nowrap;
}

.tsd-center .tsd-utils button:hover {
  color: #1a1f28;
  background: #f3f5f8;
}

.tsd-center__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 36px 16px 24px 8px;
  min-width: 0;
  width: 100%;
}

.tsd-product-meta {
  font-size: 12px;
  color: var(--tsd-muted);
  margin: 0 0 12px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tsd-stage-wrap {
  position: relative;
  width: min(
    var(--tsd-stage-max),
    calc(100% - 8px)
  );
  max-width: 100%;
  aspect-ratio: 13 / 15;
  background: transparent;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.08));
}

.tsd-stage-wrap .canvas-container {
  width: 100% !important;
  max-width: 100%;
  margin: 0 auto;
}

.tsd-stage-wrap canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  margin: 0 auto;
  touch-action: none;
}

.tsd-shirt-tint {
  display: none !important;
}

/* View tabs */
.tsd-views {
  display: inline-flex;
  margin-top: 20px;
  border: 1px solid var(--tsd-border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--tsd-panel);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tsd-views__btn {
  border: 0;
  background: var(--tsd-panel);
  color: var(--tsd-text);
  padding: 10px 22px;
  font-size: 13px;
  cursor: pointer;
  border-right: 1px solid var(--tsd-border);
  transition: background 0.15s, color 0.15s;
  min-width: 72px;
}

.tsd-views__btn:last-child {
  border-right: 0;
}

.tsd-views__btn:hover:not(.is-active) {
  background: #f3f5f8;
}

.tsd-views__btn.is-active {
  background: var(--tsd-active-bg);
  color: #fff;
  font-weight: 500;
}

/* Object toolbar — vertical strip */
.tsd-objbar {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border: 1px solid #d8dee6;
  border-right: 0;
  border-radius: 0;
  padding: 0;
  z-index: 5;
  box-shadow: -1px 0 6px rgba(16, 24, 40, 0.06);
}

.tsd-objbar button {
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  border-radius: 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}

.tsd-objbar button:last-child {
  border-bottom: 0;
}

.tsd-objbar button:hover {
  background: #f3f4f6;
  color: #111827;
}

.tsd-objbar button:hover::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 3px;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.tsd-objbar button:hover::before {
  content: '';
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #1f2937;
  pointer-events: none;
  z-index: 20;
}

.tsd-objbar button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Drawers / panels floating on center */
.tsd-drawer {
  position: absolute;
  z-index: 20;
  left: 16px;
  top: 16px;
  width: 280px;
  max-height: calc(100% - 32px);
  background: var(--tsd-panel);
  border: 1px solid var(--tsd-border);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(16, 24, 40, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tsd-drawer[hidden] {
  display: none !important;
}

.tsd-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--tsd-border);
  background: #fafbfc;
}

.tsd-drawer__head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1f28;
}

.tsd-drawer__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--tsd-muted);
  cursor: pointer;
  padding: 0 4px;
}

.tsd-drawer__close:hover {
  color: #111;
}

.tsd-drawer__body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.tsd-drawer__actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.tsd-field {
  display: block;
  margin-bottom: 12px;
}

.tsd-field > span {
  display: block;
  font-size: 11px;
  color: var(--tsd-muted);
  margin-bottom: 5px;
}

.tsd-field input[type="text"],
.tsd-field input[type="url"],
.tsd-field input[type="number"],
.tsd-field select,
.tsd-field textarea {
  width: 100%;
  border: 1px solid var(--tsd-border);
  border-radius: 3px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--tsd-text);
  background: #fff;
  font-family: inherit;
}

.tsd-field input[type="text"],
.tsd-field input[type="url"],
.tsd-field input[type="number"],
.tsd-field select {
  height: 36px;
}

.tsd-field textarea {
  min-height: 110px;
  padding: 8px 10px;
  line-height: 1.45;
  resize: vertical;
}

.tsd-field--inline input[type="color"] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--tsd-border);
  border-radius: 3px;
  padding: 2px 4px;
  cursor: pointer;
}

.tsd-btn {
  flex: 1;
  height: 36px;
  border-radius: 3px;
  border: 1px solid var(--tsd-border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.tsd-btn--dark {
  background: var(--tsd-active-bg);
  border-color: var(--tsd-active-bg);
  color: #fff;
}

.tsd-btn--dark:hover {
  background: #3a4150;
}

.tsd-btn--ghost:hover {
  background: #f3f5f8;
}

.tsd-art-grid,
.tsd-template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tsd-art-item,
.tsd-template-item {
  border: 1px solid var(--tsd-border);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  padding: 0;
}

.tsd-art-item:hover,
.tsd-template-item:hover {
  border-color: var(--tsd-accent);
  box-shadow: 0 2px 8px rgba(243, 166, 75, 0.2);
}

.tsd-art-item img,
.tsd-template-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background: #f8f9fb;
  padding: 4px;
}

.tsd-art-item span,
.tsd-template-item span {
  display: block;
  font-size: 10px;
  padding: 4px 6px;
  text-align: center;
  color: var(--tsd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsd-empty {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--tsd-muted);
  text-align: center;
  padding: 16px 8px;
  margin: 0;
}

.tsd-hint {
  font-size: 11px;
  color: var(--tsd-muted);
  margin: 10px 0 0;
}

.tsd-product-info h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.tsd-product-info__desc {
  font-size: 12px;
  color: var(--tsd-muted);
  margin-bottom: 8px;
}

.tsd-product-info__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--tsd-accent-dark);
}

.tsd-hidden-file {
  display: none;
}

/* ============================================================
   RIGHT SIDEBAR
   ============================================================ */
.tsd-right {
  border-left: 1px solid var(--tsd-border);
  display: flex;
  flex-direction: column;
  background: #fff;
  min-height: 100%;
}

.tsd-right .tsd-panel {
  border-bottom: 1px solid var(--tsd-border);
  flex-shrink: 0;
}

.tsd-right .tsd-panel__title {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  padding: 12px 14px 0;
  color: #2b3340;
}

#tsd-sizes-panel {
  padding: 0 0 12px;
}

#tsd-sizes-panel .tsd-panel__title {
  padding: 12px 14px 8px;
}

.tsd-checkout {
  margin-top: auto;
  border-top: 1px solid var(--tsd-border);
  flex-shrink: 0;
}

/* Panels */
.tsd-panel {
  padding: 0;
  border-bottom: 1px solid var(--tsd-border);
  background: var(--tsd-panel);
}

.tsd-panel__title {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  padding: 12px 14px 0;
  color: #1a1f28;
}

.tsd-panel--collapsible .tsd-panel__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
}

.tsd-panel--collapsible .tsd-panel__toggle .tsd-panel__title {
  font-size: 13px;
  font-weight: 700;
  color: #2b3340;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tsd-panel--collapsible .tsd-panel__toggle i {
  font-size: 11px;
  color: var(--tsd-muted);
  transition: transform 0.2s;
}

.tsd-panel--collapsible.is-open .tsd-panel__toggle i {
  transform: rotate(180deg);
}

.tsd-panel--collapsible:not(.is-open) .tsd-panel__body {
  display: none;
}

.tsd-panel__body {
  padding: 0 14px 12px;
}

.tsd-subtitle {
  font-size: 12px;
  color: var(--tsd-muted);
  margin: 0 0 8px;
}

/* Color picker — ô màu vuông */
.tsd-colors {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.tsd-empty--colors {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 4px;
}

.tsd-color {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #cfd5df;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  padding: 0;
  min-height: 28px;
  transition: border-color 0.15s;
}

.tsd-color:hover {
  border-color: #9aa3b2;
}

.tsd-color.is-active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.tsd-color.is-active::after {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #2563eb;
  text-shadow: 0 0 2px #fff;
}

.tsd-color.is-light.is-active::after {
  color: #1d4ed8;
}

.tsd-color[data-hex="#000000"].is-active::after,
.tsd-color[data-hex="#0b1f3a"].is-active::after,
.tsd-color[data-hex="#1e3a5f"].is-active::after {
  color: #fff;
  text-shadow: none;
}

/* Sizes — hàng ngang S M L (giống PrintStyle) */
.tsd-sizes {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 14px;
}

.tsd-size-col {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.tsd-size-label {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--tsd-text);
  margin-bottom: 5px;
  line-height: 1;
}

.tsd-size-qty {
  width: 100%;
  height: 32px;
  border: 1px solid var(--tsd-border);
  border-radius: 2px;
  padding: 0 4px;
  font-size: 13px;
  text-align: center;
  background: #fff;
  color: var(--tsd-text);
}

.tsd-size-qty:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Details accordion */
.tsd-details {
  padding: 8px 14px 10px;
  background: #fff;
}

.tsd-details details {
  border: 0;
  border-bottom: 1px solid var(--tsd-border);
  border-radius: 0;
  background: transparent;
  margin-bottom: 0;
}

.tsd-details details:last-child {
  border-bottom: 0;
}

.tsd-details summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 12px;
  color: var(--tsd-muted);
  list-style: none;
  user-select: none;
  position: relative;
  padding-right: 18px;
}

.tsd-details summary::-webkit-details-marker {
  display: none;
}

.tsd-details summary::after {
  content: "\f078";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #aab2be;
}

.tsd-details details[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.tsd-details__body {
  padding: 0 0 10px;
  font-size: 12px;
  color: var(--tsd-text);
}

.tsd-details textarea {
  width: 100%;
  border: 1px solid var(--tsd-border);
  border-radius: 3px;
  padding: 8px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
}

.tsd-details textarea:focus {
  outline: none;
  border-color: #93c5fd;
}

/* Price + Mua ngay */
.tsd-price-box {
  padding: 12px 14px 14px;
  background: #fff;
}

.tsd-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.tsd-price {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.tsd-price-reset {
  width: 28px;
  height: 28px;
  border: 1px solid var(--tsd-border);
  border-radius: 50%;
  background: #fff;
  color: var(--tsd-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}

.tsd-price-reset:hover {
  color: var(--tsd-accent);
  border-color: var(--tsd-accent);
}

.tsd-price-avg {
  font-size: 12px;
  color: var(--tsd-muted);
  margin: 0 0 12px;
}

.tsd-buy {
  width: 100%;
  border: 0;
  background: var(--tsd-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
  letter-spacing: 0.01em;
  text-transform: none;
}

.tsd-buy:hover {
  background: var(--tsd-accent-hover);
}

.tsd-buy:active {
  transform: scale(0.99);
}

.tsd-buy:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tsd-msg {
  margin-top: 8px;
  font-size: 12px;
  color: #dc2626;
  min-height: 16px;
}

.tsd-msg.is-ok {
  color: #059669;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* PC lớn — canvas rộng hơn giống PrintStyle */
@media (min-width: 1280px) {
  .tsd {
    --tsd-stage-max: 525px;
    --tsd-frame-max: 1320px;
  }

  .tsd-center__inner {
    padding: 40px 12px 28px 4px;
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  .tsd {
    --tsd-stage-max: 560px;
  }
}

@media (max-width: 1200px) {
  .tsd {
    --tsd-left-w: 186px;
    --tsd-right-w: 248px;
    --tsd-stage-max: 520px;
  }
}

/* Tablet ngang — thu sidebar, canvas co theo cột giữa */
@media (max-width: 1099px) {
  .tsd {
    --tsd-left-w: 172px;
    --tsd-right-w: 232px;
    --tsd-stage-max: 100%;
  }

  .tsd-center__inner {
    padding: 28px 10px 20px 6px;
  }

  .tsd-center .tsd-utils {
    right: 8px;
    top: 8px;
  }

  .tsd-center .tsd-utils button {
    min-width: 46px;
    padding: 6px 6px;
  }

  .tsd-menu__item {
    padding: 9px 8px;
    font-size: 12px;
  }

  .tsd-menu__text {
    font-size: 11.5px;
  }
}

/* Tablet dọc — xếp chồng: menu → canvas → tuỳ chọn */
@media (max-width: 960px) {
  .tsd-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "center"
      "right";
    min-height: auto;
  }

  .tsd-left {
    grid-area: left;
    border-right: 0;
    border-bottom: 1px solid var(--tsd-border);
  }

  .tsd-center {
    grid-area: center;
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    overflow: visible;
  }

  .tsd-center .tsd-utils {
    order: 1;
    flex-shrink: 0;
  }

  .tsd-center__inner {
    order: 2;
    flex: none;
    width: 100%;
    padding: 12px 10px 16px;
  }

  .tsd-objbar {
    order: 3;
    flex-shrink: 0;
  }

  .tsd-right {
    grid-area: right;
    border-left: 0;
    border-top: 1px solid var(--tsd-border);
  }

  .tsd-left__top {
    grid-template-columns: 1fr 1fr;
    padding: 8px 10px;
  }

  .tsd-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px 10px;
    flex: none;
    max-height: none;
  }

  .tsd-menu__item {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 108px;
    padding: 10px 8px;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 6px;
  }

  .tsd-menu__icon {
    width: auto;
    font-size: 17px;
  }

  .tsd-menu__text {
    font-size: 11px;
    line-height: 1.2;
  }

  .tsd-layers {
    padding: 8px 10px 10px;
  }

  .tsd-stage-wrap {
    width: 100%;
    max-width: 100%;
    min-height: 280px;
  }

  .tsd-center .tsd-utils {
    position: static;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    margin: 0 0 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .tsd-center .tsd-utils button {
    min-width: 52px;
    flex: 0 0 auto;
  }

  .tsd-objbar {
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--tsd-border);
    border-radius: 4px;
    margin: 12px auto 0;
    padding: 6px;
    box-shadow: none;
    width: fit-content;
    max-width: 100%;
  }

  .tsd-objbar button {
    width: 38px;
    height: 38px;
  }

  .tsd-objbar button:hover::after,
  .tsd-objbar button:hover::before {
    display: none;
  }

  .tsd-drawer {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: 360px;
  }

  .tsd-flyout--text {
    left: 8px;
    right: auto;
    width: min(300px, calc(100% - 16px));
    max-height: min(440px, 72vh);
  }

  .tsd-right .tsd-panel__body {
    padding-bottom: 4px;
  }

  .tsd-colors {
    grid-template-columns: repeat(8, 1fr);
  }
}

/* Mobile lớn */
@media (max-width: 768px) {
  .halink-tshirt-designer-page #content > .container,
  .page-template-page-thiet-ke #content > .container,
  .page-template-templates-page-thiet-ke-php #content > .container {
    padding: 10px 8px 20px;
  }

  .tsd-frame {
    margin-bottom: 12px;
    border-radius: 0;
  }

  .tsd-menu__item {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .tsd-stage-wrap {
    width: 100%;
    min-height: 260px;
  }

  .tsd-center {
    min-height: 320px;
  }

  .tsd-views {
    width: 100%;
    display: flex;
  }

  .tsd-views__btn {
    flex: 1;
    min-width: 0;
    padding: 9px 8px;
  }

  .tsd-flyout--text {
    left: 6px;
    right: 6px;
    width: auto;
    max-width: none;
  }

  .tsd-text-grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tsd-text-grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tsd-flyout--text .tsd-field--check-inline {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
  }

  .tsd-colors {
    grid-template-columns: repeat(6, 1fr);
  }

  .tsd-sizes {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile nhỏ */
@media (max-width: 520px) {
  .tsd-left__top {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .tsd-chip {
    font-size: 10px;
    padding: 8px 2px;
  }

  .tsd-menu__item {
    flex: 1 1 calc(50% - 4px);
    padding: 8px 4px;
  }

  .tsd-menu__text {
    font-size: 10px;
  }

  .tsd-center .tsd-utils button span {
    display: none;
  }

  .tsd-center .tsd-utils button {
    min-width: 40px;
    padding: 8px 6px;
  }

  .tsd-views__btn {
    font-size: 11px;
    padding: 8px 6px;
  }

  .tsd-colors {
    grid-template-columns: repeat(5, 1fr);
  }

  .tsd-text-grid-2 {
    grid-template-columns: 1fr;
  }

  .tsd-modal__dialog {
    padding: 20px 16px 24px;
  }
}

/* Popup: Thông tin sản phẩm WooCommerce (trong .tsd-frame) */
.tsd-modal {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.tsd-modal[hidden] {
  display: none !important;
}

.tsd-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.tsd-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: calc(100% - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
  padding: 28px 32px 32px;
}

.tsd-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.tsd-modal__close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.tsd-modal__top {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}

.tsd-modal__image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  background: #f8fafc;
  border: 1px solid var(--tsd-border, #e2e8f0);
  border-radius: 6px;
  overflow: hidden;
}

.tsd-modal__image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.tsd-modal__image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
  color: #94a3b8;
  font-size: 64px;
}

.tsd-modal__title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  padding-right: 36px;
}

.tsd-modal__meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: #64748b;
}

.tsd-modal__price {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--tsd-accent, #f97316);
}

.tsd-modal__price del {
  color: #94a3b8;
  font-weight: 400;
  font-size: 14px;
}

.tsd-modal__excerpt {
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
}

.tsd-modal__excerpt p:last-child {
  margin-bottom: 0;
}

.tsd-modal__desc {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--tsd-border, #e2e8f0);
}

.tsd-modal__desc-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.tsd-modal__desc-body {
  font-size: 14px;
  line-height: 1.7;
  color: #334155;
}

.tsd-modal__desc-body p:last-child {
  margin-bottom: 0;
}

.tsd-modal__empty {
  padding: 12px 0;
  font-size: 14px;
  line-height: 1.65;
  color: #475569;
}

.tsd-modal__empty code {
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: 13px;
}

.tsd-modal__dialog--chart {
  width: min(780px, 100%);
  padding: 24px 28px 28px;
}

.tsd-modal__title--center {
  text-align: center;
  padding-right: 0;
  margin-bottom: 18px;
  font-size: 18px;
}

.tsd-modal__chart {
  overflow: auto;
  border: 1px solid var(--tsd-border, #e2e8f0);
  border-radius: 6px;
  background: #fff;
}

.tsd-modal__chart img {
  display: block;
  width: 100%;
  height: auto;
}

/* Popup: Chọn loại áo / trang thiết kế */
.tsd-modal__dialog--pick {
  width: min(920px, 100%);
  padding: 20px 24px 18px;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 24px);
}

.tsd-pick__head {
  margin-bottom: 16px;
  min-height: 36px;
}

.tsd-pick__filter-label {
  display: block;
  max-width: 240px;
}

.tsd-pick__filter {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--tsd-border, #d0d5dd);
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  color: #344054;
}

.tsd-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  overflow: auto;
  flex: 1 1 auto;
  padding: 4px 2px 12px;
}

.tsd-pick-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--tsd-border, #e4e7ec);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tsd-pick-card:hover {
  border-color: #98a2b3;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.tsd-pick-card.is-current {
  border-color: var(--tsd-accent, #f97316);
  box-shadow: 0 0 0 1px var(--tsd-accent, #f97316);
  cursor: default;
}

.tsd-pick-card__img {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 12px;
  background: #f8fafc;
}

.tsd-pick-card__img img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: contain;
}

.tsd-pick-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  color: #94a3b8;
  font-size: 48px;
}

.tsd-pick-card__title {
  display: block;
  padding: 10px 12px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: #344054;
  border-top: 1px solid var(--tsd-border, #eef2f6);
}

.tsd-pick__footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--tsd-border, #eef2f6);
}

/* Popup: Thư viện Art / Clipart */
.tsd-modal--art {
  padding: 14px;
}

.tsd-modal__dialog--art {
  width: calc(100% - 8px);
  max-width: 1180px;
  height: calc(100% - 8px);
  max-height: calc(100% - 8px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 2px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
}

.tsd-art-pop__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 10px 12px 10px 12px;
  border-bottom: 1px solid #eee;
  min-height: 56px;
}

.tsd-art-pop__toggle {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8dde6;
  background: #fff;
  color: #5b6472;
  font-size: 16px;
  cursor: pointer;
  border-radius: 2px;
  padding: 0;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.tsd-art-pop__toggle:hover {
  background: #f7f8fa;
  color: #1f2937;
}

.tsd-art-pop__search {
  display: flex;
  align-items: stretch;
  flex: 0 1 420px;
  max-width: 420px;
  height: 36px;
  border: 1px solid #d8dde6;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.tsd-art-pop__search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  padding: 0 12px;
  font-size: 13px;
  color: #334155;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
}

.tsd-art-pop__search input::placeholder {
  color: #94a3b8;
}

.tsd-art-pop__search button {
  flex: 0 0 auto;
  height: 100%;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

.tsd-art-pop__search button:hover {
  background: #e5e7eb;
}

.tsd-art-pop__close {
  position: static !important;
  margin-left: auto;
  width: 32px;
  height: 32px;
  font-size: 26px;
  color: #9ca3af;
  background: transparent;
}

.tsd-art-pop__close:hover {
  color: #111827;
  background: transparent;
}

.tsd-art-pop__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tsd-art-pop__sidebar {
  flex: 0 0 188px;
  width: 188px;
  overflow: auto;
  border-right: 1px solid #eee;
  padding: 14px 18px 18px;
  transition: flex-basis 0.2s ease, width 0.2s ease, padding 0.2s ease, opacity 0.15s ease;
}

.tsd-modal__dialog--art.is-sidebar-collapsed .tsd-art-pop__sidebar {
  flex-basis: 0;
  width: 0;
  min-width: 0;
  padding: 0;
  border-right-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.tsd-art-pop__cats {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.tsd-art-pop__cat {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 5px 0;
  color: #3b82f6;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  font-family: inherit;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

.tsd-art-pop__cat:hover {
  color: #1d4ed8;
}

.tsd-art-pop__cat.is-active {
  color: #ea580c;
  font-weight: 500;
}

.tsd-art-pop__main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  padding: 14px 16px 8px;
}

.tsd-art-pop__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.tsd-art-pop__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 1px solid #ececec;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

.tsd-art-pop__item:hover {
  border-color: #c5cdd8;
}

.tsd-art-pop__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 8px 22px;
}

.tsd-art-pop__thumb img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.tsd-art-pop__price {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  display: inline-block;
  padding: 1px 7px;
  background: #ececec;
  color: #4b5563;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  border-radius: 1px;
}

.tsd-art-pop__foot {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: 10px 16px 14px;
}

.tsd-art-pop__more {
  height: 36px;
  padding: 0 16px;
  border: 0;
  background: #3b82f6;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.tsd-art-pop__more:hover {
  background: #2563eb;
}

.tsd-art-pop__more[hidden] {
  display: none !important;
}

/* Popup: Tải lên hình ảnh */
.tsd-modal--upload {
  overflow: hidden;
}

.tsd-modal__dialog--upload {
  width: min(720px, 100%);
  padding: 20px 24px 24px;
  overflow: auto;
}

.tsd-upload-pane[hidden] {
  display: none !important;
}

.tsd-upload-tabs {
  display: flex;
  gap: 24px;
  margin: 4px 28px 18px 0;
  border-bottom: 1px solid #eee;
}

.tsd-upload-tabs__btn {
  border: 0;
  background: transparent;
  padding: 8px 2px 10px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  font-family: inherit;
}

.tsd-upload-tabs__btn:hover {
  color: #ea580c;
}

.tsd-upload-tabs__btn.is-active {
  color: #ea580c;
  border-bottom-color: #ea580c;
}

.tsd-upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}

.tsd-upload-label,
.tsd-upload-hint-title {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.tsd-upload-hint {
  margin: 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.tsd-upload-col input[type="file"] {
  display: block;
  max-width: 100%;
  font-size: 13px;
}

.tsd-upload-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #374151;
  cursor: pointer;
}

.tsd-upload-agree input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.tsd-upload-terms-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.tsd-upload-terms-link:hover {
  text-decoration: underline;
}

.tsd-upload-error {
  margin: 0 0 10px;
  font-size: 13px;
  color: #dc2626;
}

.tsd-upload-error[hidden] {
  display: none !important;
}

.tsd-upload-submit {
  height: 36px;
  padding: 0 18px;
  border: 0;
  background: #3b82f6;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.tsd-upload-submit:hover {
  background: #2563eb;
}

.tsd-upload-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tsd-upload-library {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 140px;
  margin-bottom: 10px;
}

.tsd-upload-thumb {
  position: relative;
  width: 110px;
  height: 110px;
  padding: 0;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.tsd-upload-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f8fafc;
}

.tsd-upload-thumb__badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.tsd-upload-click-hint {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
}

.tsd-upload-library .tsd-empty {
  width: 100%;
}

.tsd-upload-terms {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  padding: 16px;
}

.tsd-upload-terms[hidden] {
  display: none !important;
}

.tsd-upload-terms__box {
  position: relative;
  width: min(480px, 100%);
  background: #fff;
  border-radius: 6px;
  padding: 22px 24px 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
}

.tsd-upload-terms__box h3 {
  margin: 0 32px 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.tsd-upload-terms__body {
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 14px;
}

.tsd-upload-terms__body p:last-child {
  margin-bottom: 0;
}

/* Popup: Chọn font */
.tsd-modal--font {
  z-index: 220;
}

.tsd-modal__dialog--font {
  width: min(760px, 100%);
  padding: 16px 20px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 32px);
}

.tsd-font-pop__head {
  margin: 0 28px 12px 0;
}

.tsd-font-pop__cat {
  min-width: 180px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  background: #fff;
  font-size: 13px;
  color: #374151;
  appearance: auto;
  -webkit-appearance: menulist;
}

.tsd-font-pop__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 200px;
  max-height: min(460px, calc(100vh - 220px));
  padding-right: 4px;
}

.tsd-font-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  min-height: 72px;
  padding: 8px 6px 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  text-align: center;
  color: #111827;
  font-family: inherit;
}

.tsd-font-item:hover {
  border-color: #93c5fd;
}

.tsd-font-item.is-active {
  border-color: #2563eb;
  color: #2563eb;
}

.tsd-font-item__sample {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1.15;
  margin-bottom: 4px;
  min-height: 28px;
  word-break: break-word;
}

.tsd-font-item__name {
  font-size: 10px;
  line-height: 1.2;
  color: inherit;
  font-family: Roboto, Arial, sans-serif;
}

.tsd-font-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #111827;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  text-align: left;
}

.tsd-font-picker:hover {
  border-color: #9ca3af;
}

.tsd-font-picker__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.tsd-font-picker i {
  font-size: 11px;
  color: #6b7280;
}

/* Popup: Đăng nhập / Lưu / Thiết kế của tôi */
.tsd-modal__title--left {
  text-align: left;
  margin: 0 32px 16px 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.tsd-modal__dialog--auth,
.tsd-modal__dialog--save {
  width: min(480px, 100%);
  padding: 22px 24px 24px;
}

.tsd-modal__dialog--mine {
  width: min(860px, 100%);
  padding: 22px 24px 24px;
  max-height: calc(100% - 32px);
  display: flex;
  flex-direction: column;
}

.tsd-auth-form .tsd-field,
.tsd-save-form .tsd-field {
  margin-bottom: 12px;
}

.tsd-auth-form .tsd-field > span,
.tsd-save-form .tsd-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.tsd-auth-form input[type="text"],
.tsd-auth-form input[type="password"],
.tsd-save-form input[type="text"],
.tsd-save-form textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}

.tsd-save-form textarea {
  resize: vertical;
  min-height: 96px;
}

.tsd-auth-foot {
  margin: 8px 0 12px;
  font-size: 12px;
  color: #9ca3af;
}

.tsd-auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tsd-auth-or {
  font-size: 13px;
  color: #6b7280;
}

.tsd-auth-register {
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
}

.tsd-auth-register:hover {
  text-decoration: underline;
}

.tsd-auth-error,
.tsd-save-error {
  margin: 0 0 10px;
  font-size: 13px;
  color: #dc2626;
}

.tsd-auth-error[hidden],
.tsd-save-error[hidden] {
  display: none !important;
}

.tsd-save-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #6b7280;
}

.tsd-save-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.tsd-save-actions .tsd-btn {
  flex: 0 0 auto;
  min-width: 88px;
}

.tsd-btn--outline {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.tsd-btn--outline:hover {
  background: #f9fafb;
}

.tsd-btn--primary {
  border: 0;
  background: #3b82f6;
  color: #fff;
}

.tsd-btn--primary:hover {
  background: #2563eb;
}

.tsd-btn--primary:disabled,
.tsd-btn--outline:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tsd-mine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(520px, calc(100vh - 220px));
  padding-right: 4px;
}

.tsd-mine-item {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  overflow: hidden;
}

.tsd-mine-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.tsd-mine-item__img {
  aspect-ratio: 1;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tsd-mine-item__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tsd-mine-item__placeholder {
  font-size: 28px;
  color: #9ca3af;
}

.tsd-mine-item__meta {
  padding: 8px 10px 10px;
}

.tsd-mine-item__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsd-mine-item__date {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}

.tsd-mine-loading {
  margin: 12px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.tsd-mine-loading[hidden] {
  display: none !important;
}

.tsd-mine-grid .tsd-empty {
  grid-column: 1 / -1;
}

/* Popup: Xem trước thiết kế */
.tsd-modal--preview {
  z-index: 210;
}

.tsd-modal__dialog--preview {
  width: min(420px, 100%);
  padding: 12px 12px 16px;
  max-height: calc(100% - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tsd-modal__dialog--preview .tsd-modal__close {
  top: 8px;
  right: 8px;
}

.tsd-preview-body {
  overflow-y: auto;
  flex: 1 1 auto;
  max-height: min(78vh, 720px);
  padding: 28px 8px 4px;
}

.tsd-preview-loading {
  margin: 24px 8px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

.tsd-preview-item {
  margin-bottom: 16px;
}

.tsd-preview-item:last-child {
  margin-bottom: 0;
}

.tsd-preview-item img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.tsd-preview-item__label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
}

@media (max-width: 720px) {
  .tsd-font-pop__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .tsd-font-pop__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .tsd-upload-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.tsd .screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

@media (max-width: 1100px) {
  .tsd-art-pop__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .tsd-modal__dialog {
    padding: 24px 20px 28px;
  }

  .tsd-modal__top {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tsd-modal__image,
  .tsd-modal__image-placeholder {
    min-height: 180px;
  }

  .tsd-modal--art {
    padding: 8px;
  }

  .tsd-art-pop__head {
    gap: 8px;
    padding: 8px;
  }

  .tsd-art-pop__search {
    flex: 1 1 auto;
    max-width: none;
  }

  .tsd-art-pop__sidebar {
    flex-basis: 150px;
    width: 150px;
    padding: 10px 12px;
  }

  .tsd-art-pop__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .tsd-art-pop__main {
    padding: 10px;
  }
}
