:root {
  --bg: #313658;
  --panel: #313658;
  --panel-2: #313658;
  --line: rgba(255,255,255,0.08);
  --text: #f3f5f7;
  --muted: #9ca3af;
  --accent: #ffffff;
  --selected: #ff2020;
  --danger: #ef4444;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { overflow: hidden; }

.icon-rail {
  height: 100vh;
  background: #313658;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
}

.rail-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: var(--text);
  font-weight: 950;
  margin-bottom: 8px;
}

.rail-btn {
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.72;
  transition: 0.16s ease;
  padding: 7px;
}

.rail-btn:hover {
  opacity: 1;
  background: #313658;
  border-color: transparent;
}

.rail-btn.active {
  opacity: 1;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--selected);
}

.rail-btn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

.rail-btn.active img {
  filter: brightness(0) saturate(100%) invert(19%) sepia(98%) saturate(5128%) hue-rotate(352deg) brightness(102%) contrast(104%) drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

.app-shell { height: 100vh; display: grid; grid-template-columns: 62px 430px minmax(0, 1fr); }

.sidebar {
  border-right: 1px solid var(--line);
  background: #313658;
  padding: 14px;
  overflow: auto;
}

.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #8b5cf6); font-weight: 900;
}
.brand h1, .brand p, .panel h2, .topbar h2, .topbar p { margin: 0; }
.brand h1 { font-size: 21px; }
.brand p, .topbar p, .notes li { color: var(--muted); font-size: 13px; }
.compact-brand { margin-bottom: 16px; }

.side-section { display: none; }
.side-section.active { display: block; }

.section-heading {
  min-height: 46px;
  padding: 4px 2px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  display: grid;
  gap: 2px;
}
.section-heading span {
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-heading small {
  color: var(--muted);
  font-size: 12px;
}
.placeholder-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.main-module, .panel {
  background: #313658;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.module-title {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #313658;
  color: var(--text);
  min-height: 44px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.module-title:disabled { opacity: 0.55; cursor: not-allowed; }
.soon { color: var(--muted); font-size: 11px; text-transform: none; letter-spacing: 0; }

.module-body { padding: 10px; }

.part-row {
  display: grid;
  grid-template-columns: 1fr 30px 30px 30px 30px;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.part-name {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.icon-btn {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
}

.icon-btn:hover { border-color: rgba(255,255,255,0.22); }
.icon-btn.danger { color: #fecaca; }
.file-name {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hidden-file { display: none; }

.part-options {
  display: none;
  padding: 10px;
  margin: 8px 0 12px;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.part-options.open { display: block; }

.option-title {
  font-size: 12px;
  color: #dbeafe;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 8px 0 8px;
}

.layer-select-row,
.option-row,
.check-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.layer-select-row select,
.option-row input[type="range"],
.option-row input[type="number"],
.option-row input[type="color"],
.option-row select {
  width: 100%;
}

.option-row.three {
  grid-template-columns: 116px 1fr 72px;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.color-chip {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.34);
  cursor: pointer;
}

.color-chip.empty {
  width: auto;
  padding: 0 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #313658;
  font-size: 12px;
}

.reset-color-btn {
  width: 34px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(239,68,68,0.12);
  color: #fecaca;
  cursor: pointer;
  font-weight: 900;
}

.panel { padding: 14px; }
.panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d6dbe4;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.check-row {
  grid-template-columns: 22px 1fr;
  justify-content: start;
}

input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
input[type="color"], input[type="number"], select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px;
}
input[type="range"] { accent-color: var(--accent); }

.zoom-row {
  display: grid;
  grid-template-columns: 1fr auto 70px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}
.zoom-row strong { color: var(--text); font-size: 13px; }
.zoom-row button, .actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.actions { display: grid; gap: 10px; }
.actions .primary { background: linear-gradient(135deg, var(--accent), #4f46e5); border-color: transparent; }

.notes ul { margin: 0; padding-left: 18px; }
.notes li { margin: 6px 0; }

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  background: #313658;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h2 { font-size: 18px; }
.status {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #313658;
  border-radius: 999px;
  padding: 7px 11px;
}

.canvas-wrap {
  margin: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  min-height: 0;
  height: calc(100vh - 76px - 44px);
  display: block;
  overflow: scroll;
  background: #313658;
  padding: 22px;
  scrollbar-color: rgba(101,163,255,0.65) rgba(255,255,255,0.08);
  overscroll-behavior: contain;
  position: relative;
}

.canvas-wrap.checker {
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.06) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}

.canvas-stage { width: 720px; height: 720px; margin: 0 auto; position: relative; }
#kitCanvas {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  max-width: none;
  max-height: none;
  image-rendering: auto;
  cursor: crosshair;
}


/* v0.7.1: fuerza que los modales con atributo hidden permanezcan cerrados al iniciar. */
.modal-backdrop[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  display: grid;
  place-items: center;
  z-index: 1000;
}
.modal {
  width: min(720px, calc(100vw - 40px));
  background: #161a22;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-header button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  padding: 18px;
}
.internal-card {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #313658;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 8px;
}
.internal-card img {
  max-width: 90px;
  max-height: 54px;
}
.internal-card span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; grid-template-columns: 56px 1fr; }
  .icon-rail { position: sticky; top: 0; height: 100vh; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace { height: auto; min-height: 80vh; }
  .canvas-wrap { height: 80vh; }
}


/* v0.7.2: Brand palette UI — detected colors are edited one by one. */
.part-row[data-part] {
  gap: 8px;
}

.part-row[data-part] .part-name {
  min-height: 30px;
}

.part-options {
  padding: 12px;
}

.palette.palette-edit {
  margin: 0 0 12px;
  gap: 8px;
}

.palette-color-input,
.border-color-input {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}

.palette-color-input::-webkit-color-swatch-wrapper,
.border-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.palette-color-input::-webkit-color-swatch,
.border-color-input::-webkit-color-swatch {
  border: 0;
  border-radius: 7px;
}

.palette-color-input.original-changed {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option-row.three.tight {
  grid-template-columns: 108px 1fr 58px;
  margin-bottom: 9px;
}

.border-toggle-row {
  display: grid;
  grid-template-columns: 108px 22px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 8px;
}

.border-control-row {
  display: grid;
  grid-template-columns: 30px 74px;
  gap: 10px;
  align-items: center;
  margin-bottom: 2px;
}

.border-size-number {
  height: 30px;
  padding: 4px 7px;
}


/* v0.7.3: open Brand submodules independently, full-square palette swatches, icons without box strokes. */
.rail-btn {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
}

.rail-btn:hover,
.rail-btn.active {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1;
}

.icon-btn {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
}

.icon-btn:hover {
  border-color: transparent !important;
  background: rgba(255,255,255,0.035) !important;
}

.palette.palette-edit {
  display: grid;
  grid-template-columns: repeat(5, 30px);
  align-items: center;
}

.palette-color-input,
.border-color-input {
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  overflow: hidden;
}

.palette-color-input::-webkit-color-swatch-wrapper,
.border-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.palette-color-input::-webkit-color-swatch,
.border-color-input::-webkit-color-swatch {
  border: 0;
  border-radius: 0;
}

.palette-color-input::-moz-color-swatch,
.border-color-input::-moz-color-swatch {
  border: 0;
  border-radius: 0;
}

/* v0.7.4: strict predominant palette, Brand header row, independent duplicated layer blocks. */
.logos-heading {
  min-height: 34px;
  padding-bottom: 9px;
}

.brand-module-row {
  min-height: 46px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(78px, auto) 30px 30px 34px minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #313658;
}

.brand-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  padding: 0;
  min-height: 30px;
}

.brand-toggle .chevron {
  width: 14px;
  display: inline-block;
  color: var(--accent);
}

.brand-header-thumb {
  width: 34px;
  height: 30px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0,0,0,0.22);
}

.brand-header-file {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.main-module:not(.open) .module-body {
  display: none;
}

.brand-layer-block {
  border: 1px solid rgba(255,255,255,0.08);
  background: #313658;
  border-radius: 13px;
  padding: 10px;
  margin: 0 0 10px;
}

.brand-layer-block.selected {
  border-color: rgba(101,163,255,0.48);
  background: rgba(101,163,255,0.07);
}

.layer-block-title {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 0 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  text-align: left;
}

.layer-block-title span {
  color: #dbeafe;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.layer-block-title strong {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.layer-thumb {
  width: 34px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0,0,0,0.22);
}

.brand-layer-block .palette.palette-edit {
  margin-bottom: 11px;
}

.brand-layer-block .palette-color-input,
.brand-layer-block .border-color-input {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-clip: padding-box;
}


/* v0.7.5: Brand header restored, per-part rows show thumbnail/name/actions, and visible logo bounds fit the slot. */
.brand-module-row {
  grid-template-columns: 1fr;
  min-height: 44px;
  padding: 8px 10px;
}

.brand-toggle {
  width: 100%;
}

.part-row {
  grid-template-columns: 58px 34px minmax(0, 1fr) 30px 30px 30px 30px;
  gap: 7px;
  min-height: 44px;
}

.part-row .part-name {
  font-size: 13px;
  white-space: nowrap;
}

.part-thumb {
  width: 34px;
  height: 30px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0,0,0,0.22);
}

.part-file {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.part-options:not(.open) {
  display: none;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 56px 410px minmax(0, 1fr); }
}

/* v0.7.6: one shared Size control, layer-level delete for duplicates, and new per-part row order. */
.part-row {
  grid-template-columns: 30px 30px 58px 34px minmax(0, 1fr) 30px 30px;
  gap: 7px;
}

.part-thumb,
.layer-thumb {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0;
}

.layer-block-title {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
  padding: 0 0 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  text-align: left;
}

.layer-delete-btn,
.layer-delete-spacer {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.layer-delete-btn {
  border: 0;
  background: transparent;
  color: #fecaca;
  font-size: 18px;
  font-weight: 950;
  cursor: pointer;
  line-height: 1;
}

.layer-delete-btn:hover {
  color: #ffffff;
  background: rgba(239,68,68,0.18);
  border-radius: 6px;
}

/* v0.7.7: smoother Size/X/Y sliders and Y range extended to -1000px / 1000px. */


/* v0.8.2: fit-to-view minimum zoom and piece color controls. */
.piece-color-panel .piece-color-list {
  display: grid;
  gap: 10px;
}

.piece-color-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  min-height: 38px;
}

.piece-color-row span {
  color: var(--text);
  font-weight: 800;
}

.piece-color-input {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  overflow: hidden;
}

.piece-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.piece-color-input::-webkit-color-swatch { border: 0; border-radius: 0; }
.piece-color-input::-moz-color-swatch { border: 0; border-radius: 0; }


/* v0.8.37: unified #313658 UI, guide/UV toggles and manual texture layers. */
.texture-panel { display: grid; gap: 12px; }
.texture-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.texture-actions button, .texture-layer button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.texture-layer-list { display: grid; gap: 10px; }
.texture-layer {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0,0,0,0.08);
  display: grid;
  gap: 9px;
}
.texture-layer-title {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
}
.texture-layer-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.texture-layer-grid {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 8px;
  align-items: center;
}
.texture-layer-grid label { color: var(--muted); font-size: 12px; font-weight: 800; }
.texture-layer-grid select { min-width: 0; }
.texture-opacity-row { display: grid; grid-template-columns: 1fr 60px; gap: 8px; align-items: center; }
.texture-opacity-row input[type="number"] { width: 60px; padding: 6px; }


/* v0.8.38: full #313658 workspace, larger rail icons and texture opacity percent display. */
.canvas-wrap { background: #313658; }
.canvas-wrap.checker {
  background-color: #313658;
  background-image: none;
}
.rail-btn img { width: 30px !important; height: 30px !important; }
.texture-opacity-row { grid-template-columns: 1fr 56px 22px; }
.texture-opacity-percent { color: var(--text); font-size: 12px; font-weight: 900; align-self: center; }
#saveTemplateSettingsBtn { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); }


/* v0.8.40: texture controls fit and percent visible */
.texture-layer-grid { grid-template-columns: 72px minmax(0,1fr) !important; }
.texture-layer-grid select { width: 100%; }
.texture-opacity-row { grid-template-columns: minmax(0,1fr) 52px 18px !important; gap: 6px; }
.texture-opacity-row input[type="number"] { width: 52px !important; padding: 6px 4px; text-align: right; }
.texture-opacity-percent { min-width: 18px; display: inline-block; }


/* v0.8.41: Photoshop-like piece palette and lower-box update */
.photoshop-color-row {
  grid-template-columns: minmax(82px, 1fr) minmax(0, 178px) !important;
  align-items: start;
  gap: 10px;
}
.photoshop-color-control {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}
.photoshop-color-control .piece-color-input {
  width: 38px;
  height: 34px;
}
.piece-hex-input {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(0,0,0,0.20);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  padding: 0 8px;
  text-transform: uppercase;
  outline: none;
}
.piece-hex-input:focus {
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}
.piece-preset-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.piece-preset {
  width: 100%;
  height: 17px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
}
.piece-preset.active {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}


/* v0.8.45: internal Brand gallery fixed + thumbnails 20% larger */
.brand-gallery-window {
  width: min(1200px, calc(100vw - 80px));
  max-height: min(710px, calc(100vh - 120px));
  background: #313658;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 22px 70px rgba(0,0,0,0.45);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.brand-gallery-header {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 7px;
  background: #313658;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.brand-gallery-header strong {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #ffffff;
}
.brand-gallery-header input {
  height: 25px;
  border: 0;
  border-radius: 0;
  background: rgba(255,255,255,0.05);
  color: #ffffff;
  padding: 0 10px;
  outline: none;
  font-size: 12px;
}
.brand-gallery-header input::placeholder { color: rgba(255,255,255,0.48); }
.brand-gallery-header button {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  padding: 5px 8px;
}
.brand-gallery-header button:hover { color: #ff4040; }
.brand-gallery-grid {
  grid-template-columns: repeat(10, 94px) !important;
  grid-auto-rows: 86px;
  justify-content: start;
  align-content: start;
  gap: 14px 20px;
  padding: 18px 24px 22px;
  overflow-y: auto;
  background: #313658;
}
.brand-gallery-grid .internal-card {
  min-height: 0;
  width: 94px;
  height: 86px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
  display: grid;
  grid-template-rows: 60px 20px;
  place-items: center;
  gap: 2px;
  cursor: pointer;
}
.brand-gallery-grid .internal-card:hover img { transform: scale(1.06); }
.brand-gallery-grid .internal-card img {
  max-width: 90px;
  max-height: 58px;
  object-fit: contain;
  transition: transform 0.12s ease;
  image-rendering: auto;
}
.brand-gallery-grid .internal-card span {
  width: 94px;
  color: rgba(255,255,255,0.78);
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-loading,
.gallery-empty {
  grid-column: 1 / -1;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  padding: 20px;
}

/* v0.8.42: Photoshop-like popup palette and ankle detail fix */
.photoshop-color-row {
  grid-template-columns: minmax(92px, 1fr) 42px !important;
  align-items: center;
  position: relative;
}
.photoshop-color-row.picker-open {
  align-items: start;
}
.piece-color-swatch {
  width: 38px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
  cursor: pointer;
}
.piece-color-swatch:hover {
  border-color: rgba(255,255,255,0.55);
}
.ps-color-popover {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  background: #313658;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 26px rgba(0,0,0,0.28);
}
.ps-tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 900;
}
.ps-tabs span { color: rgba(255,255,255,0.72); }
.ps-tabs .active { color: #ffffff; border-bottom: 2px solid #ff2b2b; padding-bottom: 3px; }
.ps-picker-body {
  display: grid;
  grid-template-columns: 1fr 62px;
  gap: 10px;
  align-items: start;
}
.ps-preset-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}
.ps-palette-swatch {
  height: 20px;
  border: 1px solid rgba(255,255,255,0.42);
  border-radius: 0;
  cursor: pointer;
}
.ps-palette-swatch.active {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}
.ps-native-block {
  display: grid;
  gap: 8px;
}
.ps-big-color {
  width: 60px;
  height: 62px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}
.ps-hex {
  grid-column: auto !important;
  width: 100% !important;
  height: 28px !important;
  font-size: 10px !important;
  padding: 0 4px !important;
}

/* v0.8.43: texture layer is treated as full Photoshop layer above ordered kit pieces. */


.socks-side-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0 10px;
  margin: 4px 0 8px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.socks-side-buttons {
  display: flex;
  gap: 6px;
}

.socks-side-buttons button {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #fff;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.socks-side-buttons button.active {
  background: #e1262f;
  border-color: #e1262f;
  color: #fff;
}


/* v0.8.47: hybrid Photoshop-like popup color picker */
.photoshop-color-row {
  position: relative;
  grid-template-columns: minmax(92px, 1fr) 40px !important;
  align-items: center;
}
.piece-color-swatch {
  width: 38px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.22);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
}
.psh-popover {
  grid-column: 1 / -1;
  width: min(650px, calc(100vw - 520px));
  min-width: 520px;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(7,12,18,0.98), rgba(14,24,34,0.98));
  box-shadow: 0 24px 70px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 30;
}
.psh-title { font-size: 15px; font-weight: 950; color: #fff; margin-bottom: 12px; }
.psh-main { display: grid; grid-template-columns: minmax(280px, 1fr) 170px; gap: 18px; align-items: start; }
.psh-main label, .psh-hue-row label, .psh-hex-wrap label, .psh-presets label {
  display: block; color: rgba(255,255,255,0.82); font-size: 12px; font-weight: 850; margin-bottom: 7px;
}
.psh-sv { width: 100%; height: 210px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.28); cursor: crosshair; display:block; }
.psh-current-wrap { display: grid; gap: 9px; }
.psh-current { width: 84px; height: 78px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.psh-current-wrap strong { color: #fff; font-size: 20px; letter-spacing: 0.02em; }
.psh-rgb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 4px; }
.psh-rgb label { margin: 0; display: grid; gap: 5px; text-align: center; }
.psh-rgb input { width: 100%; min-width: 0; height: 34px; padding: 4px; text-align: center; }
.psh-hue-row { display: grid; grid-template-columns: 58px minmax(0,1fr); align-items: center; gap: 11px; margin: 13px 0 15px; }
.psh-hue-row label { margin:0; }
.psh-hue-row input[type="range"] { width: 100%; accent-color: #ff2a2a; }
.psh-bottom { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 20px; align-items: start; }
.psh-hex-field { display: grid; grid-template-columns: minmax(0,1fr) 40px; }
.psh-hex-field input { border-radius: 8px 0 0 8px; height: 38px; }
.psh-hex-field button { border: 1px solid rgba(255,255,255,0.16); border-left: 0; border-radius: 0 8px 8px 0; background: rgba(255,255,255,0.06); color:#fff; cursor:pointer; }
.psh-eyedrop { margin-top: 10px; width: 100%; min-height: 42px; border: 1px solid #ff2d2d; border-radius: 9px; background: rgba(255,45,45,0.08); color: #fff; font-weight: 900; cursor:pointer; }
.psh-presets { display: grid; gap: 6px; }
.psh-preset-row { display: grid; grid-template-columns: repeat(8, 28px); gap: 6px; }
.psh-preset { width: 28px; height: 28px; padding:0; border-radius: 5px; border: 1px solid rgba(255,255,255,0.24); cursor:pointer; }
.psh-preset.active { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 1100px) {
  .psh-popover { min-width: 430px; width: min(520px, calc(100vw - 360px)); }
  .psh-main { grid-template-columns: 1fr; }
  .psh-bottom { grid-template-columns: 1fr; }
}

/* v0.8.48: unified compact Photoshop palette inside sidebar blocks */
.logo-color-row,
.border-color-picker {
  position: relative;
  width: 100%;
}
.palette-color-swatch,
.border-color-swatch {
  width: 34px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
  cursor: pointer;
  padding: 0;
}
.palette-color-swatch.original-changed {
  outline: 2px solid #ff2d2d;
  outline-offset: 2px;
}
.brand-layer-block .palette.palette-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  overflow: visible;
}
.brand-layer-block,
.piece-color-row,
.section-card,
.panel {
  overflow: visible;
}
.border-control-row {
  align-items: start;
}
.psh-popover,
.psh-popover.compact {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border-radius: 14px;
  z-index: 80;
}
.logo-color-row .psh-popover,
.border-color-picker .psh-popover {
  margin-top: 8px;
  width: calc(var(--sidebar-width, 320px) - 52px);
  max-width: calc(100vw - 120px);
}
.psh-main,
.psh-popover.compact .psh-main {
  grid-template-columns: 1fr;
  gap: 10px;
}
.psh-sv,
.psh-popover.compact .psh-sv {
  width: 100%;
  height: 165px;
}
.psh-current-wrap {
  grid-template-columns: 70px 1fr;
  align-items: center;
}
.psh-current { width: 60px; height: 54px; }
.psh-current-wrap strong { font-size: 16px; }
.psh-rgb { grid-column: 1 / -1; }
.psh-bottom,
.psh-popover.compact .psh-bottom {
  grid-template-columns: 1fr;
  gap: 10px;
}
.psh-preset-row { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.psh-preset { width: 100%; height: 24px; }
#kitCanvas { cursor: crosshair; }


.socks-back-calibration-panel .calibration-help{font-size:12px;line-height:1.35;color:rgba(255,255,255,.75);margin:8px 0 10px;}
.coords-readout{white-space:pre-wrap;background:rgba(0,0,0,.22);border:1px solid rgba(255,255,255,.12);border-radius:10px;padding:10px;font:12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;color:#fff;margin:8px 0;}
#copySocksBackCoords{width:100%;height:34px;border-radius:10px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.09);color:#fff;font-weight:700;}

.option-note{font-size:11px;line-height:1.35;color:#c7d2fe;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.10);border-radius:10px;padding:8px 10px;margin:7px 0;}


/* v0.8.52: compact preset palette and final socks-back cleanup */
.psh-title,
.psh-sv-wrap > label { display: none !important; }
.psh-popover,
.psh-popover.compact { padding: 10px; border-radius: 12px; }
.psh-main,
.psh-popover.compact .psh-main { display: grid; grid-template-columns: 1fr; gap: 8px; }
.psh-sv,
.psh-popover.compact .psh-sv { height: 130px; }
.psh-bottom,
.psh-popover.compact .psh-bottom { gap: 8px; }
.psh-presets { gap: 8px; }
.psh-presets label { font-size: 11px; margin-bottom: 2px; }
.psh-preset-row { display: grid; grid-template-columns: repeat(10, 22px) !important; gap: 8px !important; justify-content: start; margin-bottom: 7px; }
.psh-preset { width: 22px !important; height: 22px !important; min-width: 22px; border-radius: 5px; }
.psh-preset.active { outline: 2px solid #fff; outline-offset: 2px; }
.psh-eyedrop.icon-only { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #ff2d2d; }
.psh-eyedrop.icon-only img { width: 22px; height: 22px; object-fit: contain; display: block; }
.socks-back-calibration-panel { display:none !important; }

/* v0.8.53: calibration back on + palette fitted inside sidebar */
.socks-back-calibration-panel { display: block !important; }
.layer-block-title {
  grid-template-columns: auto auto 34px minmax(0, 1fr) auto !important;
  gap: 8px !important;
}
.layer-title-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 34px;
  max-width: 84px;
}
.layer-title-palette .palette-color-swatch {
  width: 30px;
  height: 28px;
  flex: 0 0 auto;
}
.palette-popover-only {
  display: block !important;
  width: 100%;
  margin: 0 0 10px !important;
  padding: 0 !important;
  overflow: visible !important;
}
.logo-color-popover-row { width: 100%; }
.brand-layer-block .psh-popover,
.piece-color-row .psh-popover,
.border-color-picker .psh-popover,
.psh-popover,
.psh-popover.compact {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden;
}
.psh-main,
.psh-popover.compact .psh-main {
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}
.psh-sv,
.psh-popover.compact .psh-sv {
  width: 100% !important;
  height: 118px !important;
}
.psh-current-wrap {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: center !important;
}
.psh-current {
  width: 48px !important;
  height: 42px !important;
}
.psh-current-wrap strong {
  font-size: 13px !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.psh-rgb {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
.psh-rgb input { height: 28px !important; font-size: 11px !important; }
.psh-hue-row {
  grid-template-columns: 40px minmax(0, 1fr) !important;
  gap: 7px !important;
  margin: 8px 0 9px !important;
}
.psh-bottom,
.psh-popover.compact .psh-bottom {
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}
.psh-hex-field input { height: 32px !important; }
.psh-eyedrop.icon-only {
  min-height: 34px !important;
  margin-top: 7px !important;
  font-size: 12px !important;
}
.psh-presets label { display: none !important; }
.psh-preset-row {
  grid-template-columns: repeat(10, 22px) !important;
  gap: 10px !important;
  justify-content: start !important;
  margin-bottom: 9px !important;
}
.psh-preset { width: 22px !important; height: 22px !important; }
.coords-readout { max-height: 120px; overflow: auto; }

/* v0.8.54: palette must fit inside the sidebar and numeric inputs must remain usable */
.psh-popover,
.psh-popover.compact,
.brand-layer-block .psh-popover,
.piece-color-row .psh-popover,
.border-color-picker .psh-popover {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 8px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.psh-main,
.psh-popover.compact .psh-main {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
}
.psh-sv,
.psh-popover.compact .psh-sv {
  width: 100% !important;
  height: 94px !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.psh-current-wrap {
  grid-template-columns: 44px minmax(0, 1fr) !important;
  gap: 6px !important;
}
.psh-current {
  width: 40px !important;
  height: 34px !important;
}
.psh-current-wrap strong {
  font-size: 11px !important;
}
.psh-rgb {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px !important;
}
.psh-rgb label {
  gap: 3px !important;
  font-size: 10px !important;
}
.psh-rgb input {
  height: 26px !important;
  font-size: 11px !important;
  padding: 2px !important;
  min-width: 0 !important;
}
.psh-hue-row {
  grid-template-columns: 34px minmax(0, 1fr) !important;
  gap: 6px !important;
  margin: 7px 0 8px !important;
}
.psh-hue-row label { font-size: 10px !important; }
.psh-bottom,
.psh-popover.compact .psh-bottom {
  grid-template-columns: 1fr !important;
  gap: 7px !important;
}
.psh-hex-field {
  grid-template-columns: minmax(0, 1fr) 32px !important;
}
.psh-hex-field input {
  height: 28px !important;
  font-size: 11px !important;
  min-width: 0 !important;
}
.psh-hex-field button {
  min-width: 0 !important;
  padding: 0 !important;
}
.psh-eyedrop.icon-only {
  min-height: 30px !important;
  margin-top: 6px !important;
  font-size: 11px !important;
}
.psh-eyedrop.icon-only img {
  width: 18px !important;
  height: 18px !important;
}
.psh-presets {
  width: 100% !important;
  overflow: visible !important;
}
.psh-preset-row {
  display: grid !important;
  grid-template-columns: repeat(10, 18px) !important;
  gap: 7px !important;
  justify-content: start !important;
  margin-bottom: 7px !important;
}
.psh-preset {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  border-radius: 4px !important;
}
.palette-popover-only {
  width: 100% !important;
  max-width: 100% !important;
}
.brand-layer-block {
  overflow: visible !important;
}


/* v0.8.57 TEAM country gallery */
.brand-gallery-grid .country-card {
  grid-template-rows: 54px 24px;
}
.brand-gallery-grid .country-card .country-flag {
  font-size: 38px;
  line-height: 1;
  width: 90px;
  height: 54px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
.brand-gallery-grid .back-card .country-flag {
  color: #ffffff;
  font-size: 34px;
}


.template-select-row{display:flex;align-items:center;gap:8px;font-size:13px}.template-details-panel{padding-bottom:10px}.template-folder{border:1px solid rgba(255,255,255,.08);border-radius:10px;margin:8px 0;overflow:hidden}.template-folder-title{width:100%;text-align:left;background:rgba(0,0,0,.18);border:0;color:#fff;padding:7px 9px;font-weight:700}.template-folder-body{display:flex;flex-direction:column;gap:4px;padding:6px}.template-detail-row{display:grid;grid-template-columns:auto minmax(40px,auto) 1fr auto auto auto auto auto;gap:5px;align-items:center;font-size:11px;background:rgba(0,0,0,.12);border-radius:8px;padding:5px}.template-detail-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-color{width:18px;height:18px;border:0;padding:0;background:transparent}.template-opacity{width:62px}.template-detail-row button{min-width:22px;padding:2px 4px}.template-detail-row select{max-width:78px;font-size:11px}

.template-folder-title {
  cursor: pointer;
  width: 100%;
}
.template-detail-row button,
.template-detail-row input,
.template-detail-row select {
  pointer-events: auto;
}

#selectedCollarName.clickable {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.collar-detail-folder {
  margin-top: 8px;
}

.kitlab-toast {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 99999;
  background: rgba(7, 10, 24, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.18);
  border-left: 4px solid #ff3131;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 12px 34px rgba(0,0,0,.35);
  pointer-events: none;
}
.kitlab-toast.show { animation: kitlabToastIn .18s ease-out both; }
@keyframes kitlabToastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* v0.9.1 template gallery: template thumbnails x4 */
.internal-card.template-card {
  min-height: 480px;
}
.internal-card.template-card img {
  max-width: 360px;
  max-height: 216px;
}
.internal-card.collar-card img {
  max-width: 180px;
  max-height: 108px;
}

/* v0.9.1: icons without boxes */
.icon-btn,
.template-detail-row button,
.layer-delete-btn,
button[data-template-up],
button[data-template-down],
button[data-template-delete] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.template-detail-row button {
  color: #ffffff;
  font-weight: 900;
  min-width: 22px;
  padding: 2px 4px;
}
.template-detail-row button[data-template-delete] {
  color: #ff6b6b;
}
.template-palette-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.template-color-popover {
  position: absolute;
  z-index: 50;
  top: 28px;
  left: 0;
}
.kitlab-toast {
  top: 26px !important;
  right: 36px !important;
  font-size: 20px !important;
  padding: 16px 24px !important;
  border-left-width: 6px !important;
}

/* v0.9.1 template gallery x5 and clean card */
.internal-card.template-card {
  min-height: 600px;
  width: 100%;
  align-content: center;
}
.internal-card.template-card img {
  max-width: 450px;
  max-height: 270px;
}
.internal-card.template-card span {
  display: block;
  margin-top: 12px;
  position: static;
}
.internal-card.template-card {
  padding: 18px;
}

/* v0.9.1 detail icons no boxes */
.icon-btn,
.template-detail-row button,
.layer-delete-btn,
button[data-template-up],
button[data-template-down],
button[data-template-delete] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* v0.9.1 fixes */
.template-detail-row {
  overflow: visible !important;
  position: relative;
}
.template-folder,
.template-folder-body,
.template-details-panel,
.template-collar-panel,
.sidebar,
.side-section,
.panel {
  overflow: visible !important;
}
.template-color-popover,
.logo-color-popover-row {
  z-index: 999999 !important;
}
.template-palette-wrap .palette-color-swatch,
.template-palette-swatch {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  border-radius: 4px !important;
  padding: 0 !important;
  border: 1px solid rgba(255,255,255,.55) !important;
  display: inline-block !important;
}
.template-palette-wrap:empty {
  display: none !important;
}
.template-detail-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.internal-card.template-card {
  min-height: 600px !important;
  padding: 18px !important;
  grid-template-rows: 1fr auto !important;
}
.internal-card.template-card img {
  max-width: 450px !important;
  max-height: 270px !important;
}
.internal-card.template-card span {
  position: static !important;
  display: block !important;
  margin-top: 12px !important;
  background: transparent !important;
}

/* v0.9.1: TEMPLATE gallery box fitted to thumbnail + name */
.internal-card.template-card {
  width: auto !important;
  min-width: 490px !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 14px 18px 12px !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  align-content: unset !important;
  place-items: unset !important;
  grid-template-rows: unset !important;
}
.internal-card.template-card img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 450px !important;
  max-height: 270px !important;
  object-fit: contain !important;
  margin: 0 !important;
}
.internal-card.template-card span {
  display: block !important;
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 13px !important;
}
#internalBrandGrid:has(.template-card) {
  align-items: start !important;
}

/* v0.9.1: template palette should never be clipped by the sidebar */
.template-color-popover {
  position: fixed !important;
  left: 360px !important;
  top: 82px !important;
  z-index: 999999 !important;
  width: 560px !important;
  max-width: calc(100vw - 390px) !important;
  max-height: calc(100vh - 120px) !important;
  overflow: visible !important;
}
.template-color-popover .psh-popover {
  width: 100% !important;
  max-width: 560px !important;
  box-sizing: border-box !important;
}

/* v0.9.1: template gallery modal is fixed to its contents, no vertical scroll */
.modal-backdrop[data-gallery-source="template"] .brand-gallery-window,
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-window {
  width: auto !important;
  max-width: calc(100vw - 80px) !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
}
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid,
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid {
  display: grid !important;
  grid-template-columns: auto !important;
  grid-auto-rows: auto !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 18px !important;
  justify-content: center !important;
  align-content: center !important;
}
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card {
  min-width: 0 !important;
  width: fit-content !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 12px 14px 10px !important;
  gap: 6px !important;
}
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img {
  max-width: 450px !important;
  max-height: 270px !important;
}
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span {
  margin-top: 6px !important;
  line-height: 1.1 !important;
}

/* v0.9.1: Template palette uses same formula as Brand/Team/Sponsor.
   It opens directly below the clicked color swatch, not fixed over the canvas. */
.template-palette-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow: visible !important;
}
.template-palette-wrap .template-color-popover,
.template-palette-wrap .logo-color-popover-row {
  position: absolute !important;
  top: 26px !important;
  left: 0 !important;
  width: 270px !important;
  max-width: 270px !important;
  max-height: none !important;
  z-index: 999999 !important;
  overflow: visible !important;
}
.template-palette-wrap .psh-popover,
.template-color-popover .psh-popover {
  width: 270px !important;
  max-width: 270px !important;
  box-sizing: border-box !important;
}
.template-folder,
.template-folder-body,
.template-detail-row,
.template-details-panel,
.template-collar-panel,
.side-section,
.panel {
  overflow: visible !important;
}
.template-detail-row {
  position: relative !important;
}
.template-palette-swatch {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  padding: 0 !important;
}

/* Cancel previous fixed/workspace palette positioning from v0.8.97 */
.template-color-popover {
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}

/* v0.9.10 SETTINGS visual/order module only */
.settings-heading-clean {
  min-height: 34px;
  margin-bottom: 10px;
}
.settings-heading-clean small { display: none; }
.settings-main-panel {
  padding: 10px;
  display: grid;
  gap: 9px;
}
.settings-line {
  width: 100%;
  min-height: 30px;
  display: grid;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
}
.template-settings-line {
  grid-template-columns: 26px minmax(0,1fr);
}
.texture-main-line {
  grid-template-columns: 26px minmax(0,1fr);
}
.guide-toggle-line {
  grid-template-columns: 26px minmax(44px,76px) minmax(0,1fr) 42px;
}
.settings-icon-btn {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.settings-icon-btn img {
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35));
}
.settings-icon-btn:hover img { transform: translateY(-1px); }
.visibility-icon-btn img { max-width: 25px; max-height: 20px; }
.hidden-check { display: none !important; }
.settings-label-group {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
}
.settings-label {
  color: #ffffff;
  font-weight: 900;
  white-space: nowrap;
}
.settings-value {
  color: #dbe2ff;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-texture-compact {
  display: block;
  width: 100%;
}
.settings-texture-empty {
  color: var(--muted);
  font-size: 11px;
  padding-left: 34px;
}
.settings-texture-row {
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0,1.25fr) minmax(80px,0.9fr) minmax(72px,1fr) 38px;
  gap: 7px;
  align-items: center;
}
.settings-texture-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #dbe2ff;
  font-size: 11px;
  font-weight: 800;
  padding-left: 0;
}
.settings-texture-duplicate-btn img {
  max-width: 22px;
  max-height: 22px;
}
.settings-texture-blend {
  min-width: 0;
  width: 100%;
  height: 27px;
  padding: 3px 6px;
  border-radius: 8px;
  font-size: 11px;
}
.settings-texture-opacity,
.settings-opacity-range {
  width: 100%;
  min-width: 0;
}
.settings-opacity-value {
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}
.guide-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-actions-clean {
  display: grid;
  gap: 8px;
  padding: 10px;
}
.settings-actions-clean button {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}
.settings-actions-clean button:hover {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.11);
}
.settings-actions-clean .primary {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.settings-legacy-view { display: none !important; }


/* v0.9.10 template folder gallery */
.internal-card.template-folder-card img { object-fit: contain; padding: 10px; filter: none; }
.internal-card.template-folder-card span { text-transform: capitalize; }

/* v0.9.14: sidebar 20% narrower + simpler default UI typography */
html, body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.app-shell {
  grid-template-columns: 50px 344px minmax(0, 1fr) !important;
}
.icon-rail {
  padding: 10px 5px !important;
  gap: 8px !important;
}
.rail-logo {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}
.rail-btn {
  width: 34px !important;
  height: 34px !important;
  padding: 5px !important;
  border-radius: 0 !important;
}
.rail-btn img,
.rail-btn.active img {
  width: 23px !important;
  height: 23px !important;
}
.sidebar {
  padding: 10px !important;
  font-size: 11px !important;
}
.sidebar *,
.sidebar button,
.sidebar input,
.sidebar select {
  font-family: inherit !important;
  font-weight: 400 !important;
}
.brand.compact-brand {
  gap: 8px !important;
  margin-bottom: 12px !important;
}
.brand-mark {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}
.brand h1 {
  font-size: 16px !important;
  line-height: 1.05 !important;
  font-weight: 400 !important;
}
.brand p {
  font-size: 10px !important;
  line-height: 1.2 !important;
}
.section-heading,
.settings-heading-clean {
  min-height: 30px !important;
  padding: 2px 0 8px !important;
  margin-bottom: 8px !important;
}
.section-heading span {
  font-size: 13px !important;
  letter-spacing: 0.04em !important;
  font-weight: 400 !important;
}
.main-module,
.panel {
  border-radius: 12px !important;
}
.panel,
.settings-main-panel,
.settings-actions-clean {
  padding: 8px !important;
}
.settings-main-panel {
  gap: 7px !important;
}
.settings-line {
  min-height: 25px !important;
  gap: 6px !important;
  font-size: 11px !important;
}
.template-settings-line,
.texture-main-line {
  grid-template-columns: 22px minmax(0,1fr) !important;
}
.guide-toggle-line {
  grid-template-columns: 22px minmax(38px,60px) minmax(0,1fr) 32px !important;
}
.settings-icon-btn {
  width: 22px !important;
  height: 22px !important;
}
.settings-icon-btn img {
  max-width: 20px !important;
  max-height: 20px !important;
}
.visibility-icon-btn img {
  max-width: 21px !important;
  max-height: 17px !important;
}
.settings-label-group {
  gap: 4px !important;
}
.settings-label,
.settings-value,
.settings-texture-name,
.settings-opacity-value {
  font-weight: 400 !important;
}
.settings-texture-compact {
  display: grid !important;
  gap: 5px !important;
}
.settings-texture-empty {
  font-size: 10px !important;
  padding-left: 28px !important;
}
.settings-texture-row {
  grid-template-columns: 22px minmax(0,1fr) 74px minmax(48px,0.8fr) 42px !important;
  gap: 5px !important;
  padding: 2px 0 !important;
  align-items: center !important;
}
.settings-texture-row.is-selected {
  background: rgba(255,255,255,0.035) !important;
  border-radius: 8px !important;
}
.settings-texture-name {
  font-size: 10.5px !important;
}
.settings-texture-duplicate-btn img {
  max-width: 19px !important;
  max-height: 19px !important;
}
.settings-texture-blend {
  height: 23px !important;
  padding: 2px 4px !important;
  border-radius: 6px !important;
  font-size: 10px !important;
}
.settings-texture-opacity,
.settings-opacity-range {
  height: 18px !important;
}
.settings-texture-opacity-number {
  width: 42px !important;
  min-width: 42px !important;
  height: 23px !important;
  padding: 2px 3px !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  border-radius: 6px !important;
  background: rgba(0,0,0,0.18) !important;
  color: #fff !important;
  text-align: right !important;
  font-size: 10px !important;
}
.settings-actions-clean {
  gap: 6px !important;
}
.settings-actions-clean button {
  min-height: 28px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
}
.template-folder-title,
.template-detail-row,
.part-row,
.part-options,
.piece-color-panel,
.logo-control-panel {
  font-size: 10.5px !important;
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 48px 1fr !important; }
}


/* v0.9.17: replaced sidebar icons, same approved size, no boxes */
.rail-btn {
  width: 40px !important;
  height: 40px !important;
  padding: 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.rail-btn img {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  opacity: 1 !important;
  filter: none !important;
}
.rail-btn.active img {
  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(5200%) hue-rotate(352deg) brightness(105%) contrast(104%) !important;
}
.rail-btn:not(.active) img {
  filter: brightness(0) invert(1) !important;
}
.rail-btn:hover,
.rail-btn.active {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}


/* v0.9.19: new Logos icon, no active shrink, remove preview header and use full canvas area */
.rail-btn,
.rail-btn.active,
.rail-btn:hover {
  transform: none !important;
  scale: 1 !important;
}
.rail-btn img,
.rail-btn.active img,
.rail-btn:hover img {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  transform: none !important;
  scale: 1 !important;
  object-fit: contain !important;
}
.workspace {
  grid-template-rows: minmax(0, 1fr) !important;
  height: 100vh !important;
}
.topbar {
  display: none !important;
}
.canvas-wrap {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  height: 100vh !important;
  padding: 8px !important;
  overflow: auto !important;
}
.canvas-stage {
  margin: 0 auto !important;
}
.status {
  display: none !important;
}


/* v0.9.19: final rail icons - transparent masks, same size, selected only changes color */
.rail-btn,
.rail-btn.active,
.rail-btn:hover {
  transform: none !important;
  scale: 1 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.rail-btn img,
.rail-btn.active img,
.rail-btn:hover img {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  transform: none !important;
  scale: 1 !important;
  object-fit: contain !important;
  opacity: 1 !important;
}
.rail-btn:not(.active) img {
  filter: brightness(0) invert(1) !important;
}
.rail-btn.active img {
  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(5200%) hue-rotate(352deg) brightness(105%) contrast(104%) !important;
}

/* v0.9.20: rail icons are real pre-colored PNGs, no CSS filters/masks.
   This prevents transparent PNGs from becoming red blocks or disappearing. */
.rail-btn,
.rail-btn.active,
.rail-btn:hover {
  transform: none !important;
  scale: 1 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.rail-btn img.rail-icon,
.rail-btn.active img.rail-icon,
.rail-btn:hover img.rail-icon {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
  transform: none !important;
  scale: 1 !important;
  opacity: 1 !important;
  filter: none !important;
}
.rail-btn .rail-icon-red { display: none !important; }
.rail-btn .rail-icon-white { display: block !important; }
.rail-btn.active .rail-icon-red { display: block !important; }
.rail-btn.active .rail-icon-white { display: none !important; }


/* v0.9.21 TEST: remove vertical rail and move module icons above the section title.
   v0.9.20 is the locked stable baseline; this is a reversible visual experiment only. */
.app-shell {
  grid-template-columns: 344px minmax(0, 1fr) !important;
}
.module-tabbar {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 14px !important;
  width: 100% !important;
  padding: 4px 0 10px !important;
  margin: 0 0 8px !important;
  background: transparent !important;
  border: 0 !important;
}
.module-tabbar .rail-btn,
.module-tabbar .rail-btn.active,
.module-tabbar .rail-btn:hover {
  width: 40px !important;
  height: 40px !important;
  padding: 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  scale: 1 !important;
  opacity: 1 !important;
  display: grid !important;
  place-items: center !important;
}
.module-tabbar .rail-icon,
.module-tabbar .rail-btn.active .rail-icon,
.module-tabbar .rail-btn:hover .rail-icon {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
  transform: none !important;
  scale: 1 !important;
  opacity: 1 !important;
  filter: none !important;
}
.module-tabbar .rail-icon-red { display: none !important; }
.module-tabbar .rail-icon-white { display: block !important; }
.module-tabbar .rail-btn.active .rail-icon-red { display: block !important; }
.module-tabbar .rail-btn.active .rail-icon-white { display: none !important; }
.section-heading,
.settings-heading-clean {
  margin-top: 0 !important;
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr !important; }
}


/* v0.9.22 TEST: creator profile buttons + centered module titles.
   v0.9.20 remains the locked stable base; this only changes visual organization. */
.profile-switch {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
}
.profile-btn {
  min-height: 28px !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  line-height: 1 !important;
}
.profile-villapilla {
  border: 1px solid #ff2020 !important;
}
.profile-castolo {
  border: 1px solid #2a82ff !important;
}
.profile-btn.active.profile-villapilla {
  background: rgba(255,32,32,0.14) !important;
  box-shadow: 0 0 0 1px rgba(255,32,32,0.22) inset !important;
}
.profile-btn.active.profile-castolo {
  background: rgba(42,130,255,0.14) !important;
  box-shadow: 0 0 0 1px rgba(42,130,255,0.22) inset !important;
}
.section-heading,
.settings-heading-clean,
.logos-heading {
  text-align: center !important;
  justify-items: center !important;
  justify-content: center !important;
  border-bottom: 0 !important;
  padding: 0 0 8px !important;
  margin: 0 0 8px !important;
  min-height: 24px !important;
}
.section-heading span,
.settings-heading-clean span,
.logos-heading span {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}
body.profile-villapilla-mode {
  --selected: #ff2020;
}
body.profile-castolo-mode {
  --selected: #2a82ff;
}
.module-tabbar .rail-icon-blue { display: none !important; }
body.profile-villapilla-mode .module-tabbar .rail-btn.active .rail-icon-red { display: block !important; }
body.profile-villapilla-mode .module-tabbar .rail-btn.active .rail-icon-blue { display: none !important; }
body.profile-castolo-mode .module-tabbar .rail-btn.active .rail-icon-red { display: none !important; }
body.profile-castolo-mode .module-tabbar .rail-btn.active .rail-icon-blue { display: block !important; }
body.profile-castolo-mode .module-tabbar .rail-btn.active .rail-icon-white { display: none !important; }


/* v0.9.23: locked from v0.9.22 visual profile test; clean Logos module rows only.
   Do not touch render/color/seams/IV/collar IV. */
.section-heading small {
  display: none !important;
}

/* Logos module headers: only the module name, left aligned inside the rectangle. */
[data-section-panel="logos"] .main-module {
  border-radius: 10px !important;
  overflow: hidden !important;
}
[data-section-panel="logos"] .brand-module-row {
  min-height: 34px !important;
  padding: 0 !important;
  display: block !important;
  border-bottom: 1px solid rgba(255,255,255,0.075) !important;
}
[data-section-panel="logos"] .brand-toggle {
  width: 100% !important;
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 0 10px !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  text-align: left !important;
}
[data-section-panel="logos"] .brand-toggle .chevron {
  display: none !important;
}

/* Logos module body follows the compact visual language of Settings. */
[data-section-panel="logos"] .module-body {
  padding: 7px 9px 8px !important;
  display: grid !important;
  gap: 5px !important;
}
[data-section-panel="logos"] .main-module:not(.open) .module-body,
[data-section-panel="logos"] .module-body[hidden] {
  display: none !important;
}

[data-section-panel="logos"] .part-row {
  width: 100% !important;
  min-height: 25px !important;
  padding: 2px 0 !important;
  border-bottom: 0 !important;
  display: grid !important;
  grid-template-columns: 22px 22px minmax(42px,54px) 24px minmax(0,1fr) 22px 22px !important;
  gap: 5px !important;
  align-items: center !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
}
[data-section-panel="logos"] .part-row:not(.has-file) {
  grid-template-columns: 22px 22px minmax(42px,1fr) !important;
}
[data-section-panel="logos"] .part-name {
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  text-align: left !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}
[data-section-panel="logos"] .icon-btn.logo-row-icon-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: grid !important;
  place-items: center !important;
}
[data-section-panel="logos"] .icon-btn.logo-row-icon-btn img {
  max-width: 20px !important;
  max-height: 20px !important;
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
  display: block !important;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35)) !important;
}
[data-section-panel="logos"] .logo-delete-btn img {
  max-width: 17px !important;
  max-height: 17px !important;
  width: 17px !important;
  height: 17px !important;
}
[data-section-panel="logos"] .part-thumb {
  width: 22px !important;
  height: 20px !important;
  object-fit: contain !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
[data-section-panel="logos"] .part-file {
  min-width: 0 !important;
  color: #dbe2ff !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}
[data-section-panel="logos"] .part-row:not(.has-file) .part-thumb,
[data-section-panel="logos"] .part-row:not(.has-file) .part-file,
[data-section-panel="logos"] .part-row:not(.has-file) [data-duplicate],
[data-section-panel="logos"] .part-row:not(.has-file) [data-delete] {
  display: none !important;
}
[data-section-panel="logos"] .part-options {
  margin: 4px 0 7px !important;
  padding: 7px !important;
  border-radius: 9px !important;
}

/* Remove old explanatory notes if an older browser keeps the element cached. */
[data-section-panel="logos"] .compact-notes,
[data-section-panel="logos"] .notes {
  display: none !important;
}

/* v0.9.39: Logos row alignment + consistent icons. Visual only.
   Stable render/color/seams/IV/collar IV remain untouched. */
[data-section-panel="logos"] .brand-toggle {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  padding: 0 10px !important;
}

[data-section-panel="logos"] .part-row {
  min-height: 25px !important;
  padding: 2px 0 !important;
  display: grid !important;
  grid-template-columns: 22px 22px max-content 24px minmax(0, 1fr) 22px 18px !important;
  gap: 4px !important;
  align-items: center !important;
}

[data-section-panel="logos"] .part-row:not(.has-file) {
  grid-template-columns: 22px 22px max-content minmax(0, 1fr) !important;
}

[data-section-panel="logos"] .part-name {
  font-size: 10.5px !important;
  font-weight: 400 !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
}

/* Same visual icon size everywhere: Settings + Brand/Team/Sponsor rows. */
.settings-icon-btn,
[data-section-panel="logos"] .icon-btn.logo-row-icon-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  padding: 0 !important;
}
.settings-icon-btn img,
[data-section-panel="logos"] .icon-btn.logo-row-icon-btn img {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  object-fit: contain !important;
}

/* X slightly smaller, aligned to the right edge with duplicate. */
[data-section-panel="logos"] .logo-duplicate-btn,
[data-section-panel="logos"] .logo-delete-btn {
  justify-self: end !important;
}
[data-section-panel="logos"] .logo-delete-btn {
  width: 18px !important;
  min-width: 18px !important;
}
[data-section-panel="logos"] .logo-delete-btn img {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}

[data-section-panel="logos"] .part-thumb {
  width: 24px !important;
  height: 20px !important;
  margin-left: 1px !important;
  margin-right: 1px !important;
}

[data-section-panel="logos"] .part-file {
  font-size: 10.5px !important;
  font-weight: 400 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Texture duplicate uses same normalized icon size too. */
.settings-texture-duplicate-btn img {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  object-fit: contain !important;
}


/* v0.9.39 hard reset: only VillaPilla profile, remove Castolo/BETA visuals. */
.profile-switch.single-profile,
.profile-switch {
  grid-template-columns: minmax(120px, 190px) !important;
  justify-content: center !important;
  justify-items: center !important;
}
.profile-switch.single-profile .profile-btn,
.profile-switch .profile-villapilla {
  width: 100% !important;
  max-width: 190px !important;
}
.profile-castolo,
.profile-beta,
.rail-icon-blue,
.rail-icon-yellow {
  display: none !important;
}
body,
body.profile-villapilla-mode {
  --selected: #ff2020;
}
body.profile-villapilla-mode .module-tabbar .rail-btn.active .rail-icon-red {
  display: block !important;
}
body.profile-villapilla-mode .module-tabbar .rail-btn.active .rail-icon-white {
  display: none !important;
}


/* v0.9.39: logo row palette restored + new larger module icons. */
.module-tabbar .rail-btn,
.module-tabbar .rail-btn.active,
.module-tabbar .rail-btn:hover {
  width: 42px !important;
  height: 42px !important;
  padding: 1px !important;
}
.module-tabbar .rail-icon,
.module-tabbar .rail-btn.active .rail-icon,
.module-tabbar .rail-btn:hover .rail-icon {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain !important;
}
[data-section-panel="logos"] .part-row {
  grid-template-columns: 22px 22px max-content 24px minmax(0, 1fr) auto 22px 18px !important;
  gap: 4px !important;
}
[data-section-panel="logos"] .part-row:not(.has-file) {
  grid-template-columns: 22px 22px max-content minmax(0, 1fr) !important;
}
[data-section-panel="logos"] .part-row:not(.has-file) .part-row-palette {
  display: none !important;
}
[data-section-panel="logos"] .part-row-palette {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 2px !important;
  min-width: 18px !important;
  max-width: 58px !important;
  overflow: hidden !important;
}
[data-section-panel="logos"] .logo-row-color-swatch,
[data-section-panel="logos"] .part-row-palette .palette-color-swatch {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  border-radius: 3px !important;
  border: 1px solid rgba(255,255,255,0.58) !important;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35) !important;
  cursor: pointer !important;
}
[data-section-panel="logos"] .part-file {
  max-width: 72px !important;
}

/* v0.9.40: safe palette polish + locked simple workflow */
.palette-color-swatch.original-changed,
.template-palette-swatch.original-changed,
.logo-row-color-swatch.original-changed {
  outline: none !important;
  outline-offset: 0 !important;
}
.psh-popover.compact {
  border: 1px solid rgba(255, 32, 32, 0.95) !important;
  border-radius: 10px !important;
  padding: 8px !important;
}
.psh-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px auto;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  font-size: 11px;
}
.psh-layer-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}
.psh-head-row .psh-current {
  width: 22px !important;
  height: 22px !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255,255,255,.28) !important;
}
.psh-hex-live {
  font-size: 11px;
  color: #fff;
  min-width: 54px;
}
.psh-current-wrap.psh-compact-controls {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  min-width: 86px !important;
}
.psh-compact-controls .psh-rgb {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 4px !important;
}
.psh-compact-controls .psh-rgb label {
  display: grid !important;
  grid-template-columns: 12px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 10px !important;
}
.psh-compact-controls .psh-rgb input,
.psh-hex-field input {
  height: 22px !important;
  font-size: 10px !important;
  padding: 2px 4px !important;
}
.psh-hex-field {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 24px !important;
}
.psh-hex-field button {
  height: 22px !important;
  font-size: 10px !important;
}
.psh-eyedrop.icon-only {
  width: 100% !important;
  min-height: 26px !important;
  margin: 0 !important;
  padding: 3px 4px !important;
  font-size: 10px !important;
}
.psh-eyedrop.icon-only img {
  width: 15px !important;
  height: 15px !important;
}
.psh-presets label,
.psh-hex-wrap label,
.psh-current-wrap label {
  display: none !important;
}
.psh-apply-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.psh-apply-row button {
  min-width: 58px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.18);
  padding: 5px 9px;
  font-size: 11px;
  cursor: pointer;
}
.psh-apply {
  background: rgba(255,255,255,.92);
  color: #16172a;
  font-weight: 700;
}
.psh-cancel {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.psh-rgb input:focus,
.psh-hex:focus {
  outline: 1px solid rgba(255,255,255,.6);
  outline-offset: 1px;
}


/* v0.9.44: compact logo internal controls only: Size / X / Y / Border.
   Visual-only UI cleanup; render, color #151515, seams, IV and collar IV stay untouched. */
[data-section-panel="logos"] .part-options {
  margin: 4px 0 7px !important;
  padding: 6px !important;
  border-radius: 9px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(0,0,0,0.14) !important;
}
[data-section-panel="logos"] .brand-layer-block {
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 0 4px !important;
  box-shadow: none !important;
}
[data-section-panel="logos"] .brand-layer-block + .brand-layer-block {
  padding-top: 5px !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}
[data-section-panel="logos"] .brand-layer-block.selected {
  background: transparent !important;
  border-color: transparent !important;
}
[data-section-panel="logos"] .layer-block-title,
[data-section-panel="logos"] .palette-popover-only,
[data-section-panel="logos"] .layer-title-palette,
[data-section-panel="logos"] .layer-delete-btn,
[data-section-panel="logos"] .layer-delete-spacer {
  display: none !important;
}
[data-section-panel="logos"] .option-row.three.tight {
  display: grid !important;
  grid-template-columns: 30px minmax(0,1fr) 34px !important;
  gap: 5px !important;
  align-items: center !important;
  margin: 0 0 4px !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  line-height: 1.1 !important;
}
[data-section-panel="logos"] .option-row.three.tight > span,
[data-section-panel="logos"] .border-inline-toggle span {
  font-size: 10.5px !important;
  font-weight: 400 !important;
  color: #ffffff !important;
  font-family: inherit !important;
  line-height: 1.1 !important;
}
[data-section-panel="logos"] .option-row.three.tight input[type="range"] {
  height: 14px !important;
  min-width: 0 !important;
}
[data-section-panel="logos"] .option-row.three.tight input[type="number"],
[data-section-panel="logos"] .border-size-number {
  height: 18px !important;
  min-height: 18px !important;
  padding: 1px 3px !important;
  border-radius: 4px !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  text-align: center !important;
  background: rgba(255,255,255,0.07) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
}
[data-section-panel="logos"] .border-inline-row {
  grid-template-columns: auto minmax(0,1fr) !important;
  gap: 5px !important;
  margin-top: 1px !important;
}
[data-section-panel="logos"] .border-inline-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  min-width: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
}
[data-section-panel="logos"] .border-inline-toggle input[type="checkbox"] {
  width: 11px !important;
  height: 11px !important;
  margin: 0 !important;
  accent-color: var(--selected) !important;
}
[data-section-panel="logos"] .border-inline-controls {
  display: none !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 0 !important;
}
[data-section-panel="logos"] .border-inline-controls.is-visible {
  display: inline-flex !important;
}
[data-section-panel="logos"] .border-color-swatch {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  border-radius: 3px !important;
  border: 1px solid rgba(255,255,255,0.58) !important;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35) !important;
  padding: 0 !important;
  cursor: pointer !important;
}
[data-section-panel="logos"] .border-size-number {
  width: 34px !important;
}
[data-section-panel="logos"] .border-picker-popover {
  grid-column: 1 / -1 !important;
}


/* v0.9.44: independent LOGOS windows.
   Palette swatch opens only the color palette; part names open only Size/X/Y/Border.
   Brand/Team/Sponsor remain visually open by default. */
[data-section-panel="logos"] .part-options.palette-only {
  padding: 6px !important;
}
[data-section-panel="logos"] .logo-picker-only-popover,
[data-section-panel="logos"] .border-picker-only-popover {
  width: 100% !important;
  display: block !important;
}
[data-section-panel="logos"] .logo-picker-only-popover .psh-popover {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

/* v0.9.44: SHIRT module structure + compact Photoshop-like rows. */
.template-collar-panel,
.template-details-panel {
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
}
.template-collar-panel h2,
.template-details-panel h2,
.piece-color-panel h2 { display: none !important; }
.collar-select-line {
  display: grid !important;
  grid-template-columns: 22px minmax(0,1fr) !important;
  gap: 5px !important;
  align-items: center !important;
  min-height: 24px !important;
}
.collar-select-line .logo-row-icon-btn,
.armband-row .logo-row-icon-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.collar-select-line .logo-row-icon-btn img,
.armband-row .logo-row-icon-btn img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
}
.template-line-name {
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  text-align: left !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
}
.template-folder {
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 8px !important;
  margin: 5px 0 !important;
  overflow: visible !important;
}
.template-folder-title {
  padding: 5px 7px !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.template-folder-body {
  padding: 4px !important;
  gap: 3px !important;
}
.template-detail-row {
  display: grid !important;
  grid-template-columns: 18px 18px minmax(0,1fr) 18px 18px 16px !important;
  align-items: center !important;
  gap: 4px !important;
  min-height: 22px !important;
  padding: 2px 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  color: #fff !important;
}
.template-tech-row {
  grid-template-columns: minmax(0,1fr) 76px minmax(38px,64px) 28px !important;
  gap: 4px !important;
}
.template-tech-row .template-opacity { width: 54px !important; }
.template-tech-row select { max-width: 76px !important; font-size: 10.5px !important; }
.template-detail-name {
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  color: #fff !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: none !important;
}
.template-eye-btn,
.template-arrow-btn,
.template-delete-btn {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: grid !important;
  place-items: center !important;
}
.template-eye-btn img,
.template-arrow-btn img,
.template-delete-btn img {
  width: 16px !important;
  height: 16px !important;
  object-fit: contain !important;
  display: block !important;
}
.template-arrow-btn img { width: 15px !important; height: 15px !important; }
.template-delete-btn img { width: 13px !important; height: 13px !important; }
.basic-piece-row {
  grid-template-columns: 18px 18px minmax(0,1fr) !important;
}
.armband-row {
  grid-template-columns: 22px max-content minmax(0,1fr) !important;
  gap: 5px !important;
}
.module-blue-separator {
  height: 1px !important;
  background: rgba(58,145,255,.85) !important;
  margin: 6px 0 !important;
}
.template-palette-wrap .palette-color-swatch,
.template-palette-swatch {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  border-radius: 3px !important;
}
/* Give Border controls breathing room so the color square never covers the word Border. */
[data-section-panel="logos"] .border-inline-row {
  grid-template-columns: 54px minmax(0,1fr) !important;
}
[data-section-panel="logos"] .border-inline-controls {
  margin-left: 5px !important;
}
.internal-card[data-internal-brand-file] img[src*="assets/armband"] {
  object-fit: contain !important;
  padding: 10px !important;
}


/* v0.9.46: SHIRT/COLLAR cleanup */
[data-section-panel="logos"] .border-inline-row {
  grid-template-columns: 70px minmax(0,1fr) !important;
}
[data-section-panel="logos"] .border-inline-controls {
  margin-left: 8px !important;
}
.template-tech-row {
  grid-template-columns: minmax(0,1fr) 72px minmax(42px,58px) 26px !important;
}
.template-tech-row .template-detail-name,
.template-folder-title,
.template-detail-name,
.template-line-name {
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
}
.template-folder-title { font-weight: 700 !important; }


/* v0.9.46: safe template detail palette, same behavior as logo palette */
.template-detail-block,
.basic-piece-block {
  display: block !important;
  position: relative !important;
  overflow: visible !important;
  margin: 0 !important;
}
.template-detail-block > .logo-color-popover-row,
.basic-piece-block > .logo-color-popover-row,
.template-picker-popover {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 4px 0 6px !important;
  z-index: 999999 !important;
  overflow: visible !important;
}
.template-picker-popover .psh-popover {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.template-palette-wrap .logo-color-popover-row,
.template-palette-wrap .template-color-popover {
  display: none !important;
}
.template-detail-block .template-palette-swatch.original-changed {
  outline: none !important;
  border-color: rgba(255,255,255,.55) !important;
}


/* v0.9.48: Shirt module fixes */
.template-detail-row {
  grid-template-columns: 18px 18px minmax(0,1fr) 18px 18px !important;
}
.template-tech-row {
  grid-template-columns: 18px minmax(0,1fr) 72px minmax(42px,58px) 26px !important;
}
.template-folder.is-closed .template-folder-body { display: none !important; }
.template-folder-title { cursor: pointer !important; }
.template-detail-row .template-delete-btn { display: none !important; }

/* v0.9.48: restore compact shirt rows + stable palette/clicks */
.template-folder {
  overflow: hidden !important;
}
.template-folder-title {
  display: block !important;
  width: 100% !important;
  min-height: 20px !important;
  line-height: 16px !important;
  padding: 4px 6px !important;
  cursor: pointer !important;
}
.template-folder-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  padding: 4px !important;
}
.template-folder.is-closed .template-folder-body,
.template-folder-body[hidden] {
  display: none !important;
}
.template-detail-row {
  min-height: 20px !important;
  padding: 1px 2px !important;
  gap: 3px !important;
  font-size: 10px !important;
  line-height: 15px !important;
}
.template-detail-name,
.template-line-name,
.template-folder-title,
.template-detail-row select,
.template-opacity-value {
  font-family: inherit !important;
  font-size: 10px !important;
}
.template-tech-row {
  grid-template-columns: 15px minmax(26px, 1fr) 58px 43px 27px !important;
  gap: 3px !important;
  align-items: center !important;
}
.template-tech-row .template-detail-name {
  min-width: 0 !important;
  max-width: 100% !important;
}
.template-tech-row select {
  width: 58px !important;
  max-width: 58px !important;
  min-width: 58px !important;
  height: 22px !important;
  padding: 1px 4px !important;
  font-size: 9.5px !important;
}
.template-tech-row .template-opacity {
  width: 43px !important;
  min-width: 43px !important;
  max-width: 43px !important;
}
.template-tech-row .template-opacity-value {
  width: 27px !important;
  text-align: right !important;
  font-size: 9.5px !important;
}
.template-eye-btn,
.template-arrow-btn,
.template-delete-btn {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
}
.template-eye-btn img,
.template-arrow-btn img,
.template-delete-btn img {
  width: 13px !important;
  height: 13px !important;
}
.template-arrow-btn img {
  width: 11px !important;
  height: 11px !important;
}
.template-palette-wrap .palette-color-swatch,
.template-palette-swatch {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
}
.template-detail-block > .logo-color-popover-row,
.basic-piece-block > .logo-color-popover-row,
.template-picker-popover {
  clear: both !important;
  width: 100% !important;
  margin: 4px 0 7px !important;
}
.template-picker-popover .psh-popover {
  width: 100% !important;
  box-sizing: border-box !important;
}


/* v0.9.49: UI-only correction after v0.9.48.
   Do not crop template/technical names, keep Armband readable, keep folders clickable,
   and let the same Photoshop-style palette used by Brand/Team/Sponsor render without clipping. */
.template-folder,
.template-folder-body,
.template-details-panel,
.template-collar-panel {
  overflow: visible !important;
}
.template-folder.is-closed .template-folder-body,
.template-folder-body[hidden] {
  display: none !important;
}
.template-detail-row {
  min-height: 22px !important;
  height: auto !important;
  align-items: center !important;
}
.template-detail-name,
.template-line-name {
  min-width: 0 !important;
}
.template-tech-row {
  grid-template-columns: 15px minmax(86px, 1fr) 58px 43px 27px !important;
}
.template-tech-row .template-detail-name,
.template-folder-body .template-detail-name {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.12 !important;
}
.template-folder-title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.15 !important;
}
.armband-row {
  grid-template-columns: 22px minmax(0, 1fr) !important;
  gap: 6px !important;
}
.armband-row .armband-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}
.armband-row .logo-row-icon-btn {
  cursor: pointer !important;
}
.template-picker-popover,
.template-detail-block > .logo-color-popover-row,
.basic-piece-block > .logo-color-popover-row {
  position: relative !important;
  z-index: 999999 !important;
  overflow: visible !important;
}
.template-picker-popover .psh-popover {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* v0.9.51: emergency-safe UI correction on top of v0.9.49.
   Open/load stability first. Do not change render/export, seams, IV, collar IV, logos or assets. */
[data-section-panel="shirt"] .template-collar-panel,
[data-section-panel="shirt"] .template-details-panel,
[data-section-panel="shorts"] .template-details-panel,
[data-section-panel="socks"] .template-details-panel,
[data-section-panel="shirt"] .basic-piece-row,
[data-section-panel="shorts"] .basic-piece-row,
[data-section-panel="socks"] .basic-piece-row,
[data-section-panel="shirt"] .armband-row {
  font-size: 10.5px !important;
}
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row {
  min-height: 25px !important;
  height: auto !important;
  padding: 3px 3px !important;
  gap: 4px !important;
  font-size: 10.5px !important;
  line-height: 1.16 !important;
  align-items: center !important;
}
[data-section-panel="shirt"] .template-detail-name,
[data-section-panel="shirt"] .template-line-name,
[data-section-panel="shirt"] .template-folder-title,
[data-section-panel="shirt"] .template-detail-row select,
[data-section-panel="shirt"] .template-opacity-value,
[data-section-panel="shorts"] .template-detail-name,
[data-section-panel="shorts"] .template-line-name,
[data-section-panel="shorts"] .template-folder-title,
[data-section-panel="shorts"] .template-detail-row select,
[data-section-panel="shorts"] .template-opacity-value,
[data-section-panel="socks"] .template-detail-name,
[data-section-panel="socks"] .template-line-name,
[data-section-panel="socks"] .template-folder-title,
[data-section-panel="socks"] .template-detail-row select,
[data-section-panel="socks"] .template-opacity-value,
#collarTemplateDetails .template-detail-name,
#collarTemplateDetails .template-line-name,
#collarTemplateDetails .template-folder-title {
  font-size: 10.5px !important;
}
[data-section-panel="shirt"] .template-folder-title,
[data-section-panel="shorts"] .template-folder-title,
[data-section-panel="socks"] .template-folder-title,
#collarTemplateDetails .template-folder-title {
  min-height: 25px !important;
  line-height: 1.18 !important;
  padding: 5px 8px !important;
  font-weight: 700 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.template-folder,
.template-folder-body,
.template-details-panel,
.template-collar-panel,
#collarTemplateDetails {
  overflow: visible !important;
}
.template-folder.is-closed .template-folder-body,
.template-folder-body[hidden] {
  display: none !important;
}
.template-detail-row:not(.template-tech-row) {
  grid-template-columns: 18px 18px minmax(0,1fr) 18px 18px !important;
}
.template-tech-row {
  grid-template-columns: 18px 18px minmax(86px,1fr) 58px 48px 28px !important;
  gap: 4px !important;
  align-items: center !important;
}
.template-tech-row .template-opacity {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
}
.template-tech-row .template-opacity-value {
  width: 28px !important;
  min-width: 28px !important;
  text-align: right !important;
}
.template-tech-row select {
  width: 58px !important;
  max-width: 58px !important;
  min-width: 58px !important;
  height: 22px !important;
  font-size: 10.5px !important;
}
.template-tech-row .template-detail-name,
.template-folder-body .template-detail-name,
#collarTemplateDetails .template-detail-name,
#selectedCollarName {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal !important;
  line-height: 1.16 !important;
}
.collar-select-line {
  align-items: flex-start !important;
}
#selectedCollarName {
  display: block !important;
  width: 100% !important;
  min-height: 22px !important;
}
.template-detail-name[data-template-rename] {
  cursor: text !important;
}
.template-inline-rename {
  width: 100% !important;
  min-width: 0 !important;
  height: 22px !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(255,255,255,0.22) !important;
  border-radius: 5px !important;
  background: rgba(0,0,0,0.26) !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  padding: 2px 5px !important;
  outline: none !important;
}
.template-inline-rename:focus {
  border-color: rgba(255,32,32,0.92) !important;
  box-shadow: 0 0 0 1px rgba(255,32,32,0.35) !important;
}
.template-palette-wrap .palette-color-swatch,
.template-palette-swatch {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
}
.template-tech-block > .template-picker-popover,
.template-detail-block > .template-picker-popover,
.template-detail-block > .logo-color-popover-row,
.basic-piece-block > .logo-color-popover-row {
  clear: both !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 4px 0 7px !important;
  position: relative !important;
  z-index: 999999 !important;
  overflow: visible !important;
}
.armband-row {
  grid-template-columns: 22px minmax(0,1fr) !important;
  gap: 6px !important;
}
.armband-row .armband-name {
  font-size: 10.5px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}
#brandGalleryModal[data-gallery-source="armband"] .brand-gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(122px, 122px)) !important;
  grid-auto-rows: 104px !important;
  gap: 14px 18px !important;
}
#brandGalleryModal[data-gallery-source="armband"] .internal-card:not(.template-folder-card) {
  width: 122px !important;
  height: 104px !important;
  grid-template-rows: 78px 22px !important;
}
#brandGalleryModal[data-gallery-source="armband"] .internal-card:not(.template-folder-card) img,
.internal-card[data-internal-brand-file] img[src*="assets/armband"] {
  max-width: 117px !important;
  max-height: 75px !important;
  padding: 0 !important;
  object-fit: contain !important;
}
#brandGalleryModal[data-gallery-source="armband"] .internal-card:not(.template-folder-card) span {
  width: 122px !important;
}

/* v0.9.57: Manual SEAMS LAB for Photoshop Ctrl+I calibration */
.seams-lab-folder {
  margin-top: 6px !important;
}
.seams-lab-title {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  text-transform: uppercase !important;
}
.seams-lab-hint {
  font-size: 8.8px !important;
  font-weight: 400 !important;
  opacity: .62 !important;
  text-transform: none !important;
}
.seam-lab-row {
  display: grid !important;
  grid-template-columns: 18px minmax(78px,1fr) 66px 46px 28px 20px !important;
  align-items: center !important;
  gap: 4px !important;
  min-height: 25px !important;
  padding: 3px 3px !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 10.5px !important;
  cursor: pointer !important;
}
.seam-lab-row.is-selected {
  background: rgba(255,255,255,.10) !important;
  outline: 1px solid rgba(255,255,255,.20) !important;
}
.seam-lab-name {
  min-width: 0 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.12 !important;
}
.seam-lab-blend {
  width: 66px !important;
  min-width: 66px !important;
  max-width: 66px !important;
  font-size: 9.5px !important;
  height: 22px !important;
}
.seam-lab-opacity {
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
}
.seam-lab-opacity-value {
  width: 28px !important;
  min-width: 28px !important;
  text-align: right !important;
  font-size: 9.5px !important;
}
.seam-invert-btn {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border-radius: 5px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  background: rgba(0,0,0,.15) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  padding: 0 !important;
}
.seam-invert-btn.active {
  border-color: rgba(255,71,87,.95) !important;
  color: #ff4757 !important;
  box-shadow: 0 0 0 1px rgba(255,71,87,.25) inset !important;
}

/* v0.9.58: auto Ctrl+I state for SEAMS LAB; FJ is locked/fixed */
.seam-invert-btn.is-fixed,
.seam-invert-btn:disabled {
  opacity: .45 !important;
  cursor: default !important;
  border-color: rgba(255,255,255,.12) !important;
  color: rgba(255,255,255,.70) !important;
  box-shadow: none !important;
}

/* v0.9.64: template detail color chips must not be made transparent by the generic row button rule. */
.template-detail-row .template-palette-swatch,
.template-detail-row .palette-color-swatch.template-palette-swatch {
  background: var(--template-chip-color, #151515) !important;
  background-color: var(--template-chip-color, #151515) !important;
}


/* v0.9.65: UI cleanup on locked v0.9.64.
   Only icon sizing, armband label readability, collar underline removal. */
#selectedCollarName,
#selectedCollarName.clickable {
  text-decoration: none !important;
  text-underline-offset: 0 !important;
  border-bottom: 0 !important;
}
[data-section-panel="shirt"] .template-eye-btn,
[data-section-panel="shorts"] .template-eye-btn,
[data-section-panel="socks"] .template-eye-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
}
[data-section-panel="shirt"] .template-eye-btn img,
[data-section-panel="shorts"] .template-eye-btn img,
[data-section-panel="socks"] .template-eye-btn img {
  width: auto !important;
  height: auto !important;
  max-width: 21px !important;
  max-height: 17px !important;
}
[data-section-panel="shirt"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="shorts"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="socks"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row) {
  grid-template-columns: 22px 18px minmax(0,1fr) 18px 18px !important;
}
[data-section-panel="shirt"] .basic-piece-row,
[data-section-panel="shorts"] .basic-piece-row,
[data-section-panel="socks"] .basic-piece-row {
  grid-template-columns: 22px 18px minmax(0,1fr) !important;
}
[data-section-panel="shirt"] .template-tech-row,
[data-section-panel="shorts"] .template-tech-row,
[data-section-panel="socks"] .template-tech-row {
  grid-template-columns: 22px 18px minmax(82px,1fr) 58px 48px 28px !important;
}
[data-section-panel="shirt"] .seam-lab-row,
[data-section-panel="shorts"] .seam-lab-row,
[data-section-panel="socks"] .seam-lab-row {
  grid-template-columns: 22px minmax(74px,1fr) 66px 46px 28px 20px !important;
}
[data-section-panel="shirt"] .armband-row {
  grid-template-columns: 22px minmax(0,1fr) !important;
  width: 100% !important;
  min-height: 28px !important;
  align-items: center !important;
  padding: 3px 3px !important;
  overflow: visible !important;
}
[data-section-panel="shirt"] .armband-row .armband-name {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal !important;
  line-height: 1.16 !important;
  max-width: 100% !important;
}

/* v0.9.70: armband line must stay in one readable row, and keep locked UI behavior. */
[data-section-panel="shirt"] .armband-row,
.armband-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 24px !important;
  padding: 3px 3px !important;
  overflow: visible !important;
}
[data-section-panel="shirt"] .armband-row .logo-row-icon-btn,
.armband-row .logo-row-icon-btn {
  flex: 0 0 22px !important;
}
[data-section-panel="shirt"] .armband-row .armband-name,
.armband-row .armband-name {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal !important;
  line-height: 1.15 !important;
}

/* v0.9.70: every internal PNG/gallery modal uses the exact same box size as Brand.
   Do not let small galleries like Armband collapse vertically when they have few folders/items. */
#brandGalleryModal[data-gallery-source="brand"] .brand-gallery-window,
#brandGalleryModal[data-gallery-source="team"] .brand-gallery-window,
#brandGalleryModal[data-gallery-source="sponsor"] .brand-gallery-window,
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-window,
#brandGalleryModal[data-gallery-source="collar"] .brand-gallery-window,
#brandGalleryModal[data-gallery-source="armband"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="brand"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="team"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="sponsor"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="collar"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="armband"] .brand-gallery-window {
  width: min(1200px, calc(100vw - 80px)) !important;
  height: min(710px, calc(100vh - 120px)) !important;
  min-height: min(710px, calc(100vh - 120px)) !important;
  max-width: min(1200px, calc(100vw - 80px)) !important;
  max-height: min(710px, calc(100vh - 120px)) !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  overflow: hidden !important;
  background: #313658 !important;
  border-radius: 8px !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
#brandGalleryModal[data-gallery-source="collar"] .brand-gallery-grid,
#brandGalleryModal[data-gallery-source="armband"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="collar"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="armband"] .brand-gallery-grid {
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-content: start !important;
}


/* v0.9.70: Armband gallery navigation/spacing locked to requested layout. */
.brand-gallery-header {
  grid-template-columns: auto 26px minmax(280px, 1fr) auto auto !important;
}
.gallery-back-btn {
  width: 24px !important;
  height: 24px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 5px !important;
  font-size: 16px !important;
  line-height: 1 !important;
  color: #ffffff !important;
  opacity: 0.95 !important;
}
.gallery-back-btn[hidden] {
  display: none !important;
}
#brandGalleryModal[data-gallery-source="armband"] .brand-gallery-header {
  grid-template-columns: auto 26px minmax(280px, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="armband"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="armband"] .brand-gallery-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-auto-rows: 118px !important;
  gap: 14px 10px !important;
  padding: 18px 12px 22px !important;
  justify-content: stretch !important;
  align-content: start !important;
}
#brandGalleryModal[data-gallery-source="armband"] .brand-gallery-grid .internal-card,
.modal-backdrop[data-gallery-source="armband"] .brand-gallery-grid .internal-card,
#brandGalleryModal[data-gallery-source="armband"] .internal-card:not(.template-folder-card),
.modal-backdrop[data-gallery-source="armband"] .internal-card:not(.template-folder-card) {
  width: 100% !important;
  height: 118px !important;
  grid-template-rows: 88px 17px !important;
  gap: 1px !important;
  padding: 0 !important;
}
#brandGalleryModal[data-gallery-source="armband"] .brand-gallery-grid .internal-card img,
.modal-backdrop[data-gallery-source="armband"] .brand-gallery-grid .internal-card img,
#brandGalleryModal[data-gallery-source="armband"] .internal-card:not(.template-folder-card) img,
.modal-backdrop[data-gallery-source="armband"] .internal-card:not(.template-folder-card) img,
.internal-card[data-internal-brand-file] img[src*="assets/armband"] {
  max-width: 100% !important;
  width: 100% !important;
  max-height: 86px !important;
  object-fit: contain !important;
  padding: 0 !important;
}
#brandGalleryModal[data-gallery-source="armband"] .brand-gallery-grid .internal-card span,
.modal-backdrop[data-gallery-source="armband"] .brand-gallery-grid .internal-card span,
#brandGalleryModal[data-gallery-source="armband"] .internal-card:not(.template-folder-card) span,
.modal-backdrop[data-gallery-source="armband"] .internal-card:not(.template-folder-card) span {
  width: 100% !important;
  margin-top: 0 !important;
  line-height: 1.05 !important;
}


/* v0.9.70 final: header back arrow appears only inside an Armband folder. */
.brand-gallery-header {
  grid-template-columns: auto minmax(280px, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="armband"][data-gallery-back="1"] .brand-gallery-header {
  grid-template-columns: auto 26px minmax(280px, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="armband"] #brandGallerySearch::placeholder {
  color: rgba(255,255,255,0.48) !important;
}


/* v0.9.71: Armband root header must keep the Brand-sized search field.
   Only when the real back arrow is visible do we reserve the 26px arrow column. */
#brandGalleryModal[data-gallery-source="armband"][data-gallery-back="0"] .brand-gallery-header,
#brandGalleryModal[data-gallery-source="armband"]:not([data-gallery-back="1"]) .brand-gallery-header {
  grid-template-columns: auto minmax(280px, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="armband"][data-gallery-back="0"] #galleryBackBtn,
#brandGalleryModal[data-gallery-source="armband"]:not([data-gallery-back="1"]) #galleryBackBtn {
  display: none !important;
}
#brandGalleryModal[data-gallery-source="armband"] #brandGallerySearch {
  min-width: 280px !important;
  width: 100% !important;
}
#brandGalleryModal[data-gallery-source="armband"] .armband-folder-card,
#brandGalleryModal[data-gallery-source="armband"] .armband-png-card {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* v0.9.74: TEAM country folders use expanded PNG flag detection from assets/flags */
.brand-gallery-grid .country-card .country-flag-img {
  width: 90px;
  height: 54px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}


/* v0.9.77: TEAM gallery header matches Armband navigation but keeps the search full-width. */
#brandGalleryModal[data-gallery-source="team"] .brand-gallery-header,
.modal-backdrop[data-gallery-source="team"] .brand-gallery-header {
  grid-template-columns: auto minmax(0, 1fr) auto auto !important;
  align-items: center !important;
}
#brandGalleryModal[data-gallery-source="team"][data-gallery-back="1"] .brand-gallery-header,
.modal-backdrop[data-gallery-source="team"][data-gallery-back="1"] .brand-gallery-header {
  grid-template-columns: auto 26px minmax(0, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="team"] #brandGallerySearch {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
}
#brandGalleryModal[data-gallery-source="team"] #openBrandFolderBtn,
#brandGalleryModal[data-gallery-source="team"] #closeGalleryBtn {
  white-space: nowrap !important;
}
#brandGalleryModal[data-gallery-source="team"] .team-png-card {
  cursor: pointer !important;
}


/* v0.9.84: compact technical detail rows without changing app startup. */
.template-palette-placeholder { width:18px !important; min-width:18px !important; height:18px !important; display:block !important; }
.template-tech-row { white-space: nowrap !important; overflow: hidden !important; }
.template-tech-row .template-detail-name { min-width:0 !important; overflow:hidden !important; text-overflow:ellipsis !important; white-space:nowrap !important; }
.template-tech-row select { min-width:58px !important; max-width:62px !important; }
.template-tech-row .template-opacity { min-width:46px !important; max-width:50px !important; }
.template-tech-row .template-opacity-value { min-width:28px !important; text-align:right !important; }


/* v0.9.85: template rows must stay one line, with full icons and readable full names where possible. */
.template-palette-placeholder {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  display: block !important;
}
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
.seam-lab-row {
  white-space: nowrap !important;
}
[data-section-panel="shirt"] .template-detail-name,
[data-section-panel="shorts"] .template-detail-name,
[data-section-panel="socks"] .template-detail-name,
#collarTemplateDetails .template-detail-name,
.seam-lab-name {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1 !important;
}
[data-section-panel="shirt"] .template-tech-row,
[data-section-panel="shorts"] .template-tech-row,
[data-section-panel="socks"] .template-tech-row,
#collarTemplateDetails .template-tech-row {
  grid-template-columns: 22px 18px minmax(86px,1fr) 56px 44px 25px !important;
  gap: 3px !important;
  overflow: visible !important;
  font-size: 9.8px !important;
}
[data-section-panel="shirt"] .template-tech-row select,
[data-section-panel="shorts"] .template-tech-row select,
[data-section-panel="socks"] .template-tech-row select,
#collarTemplateDetails .template-tech-row select {
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  height: 20px !important;
  font-size: 9.4px !important;
  padding: 0 2px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity,
[data-section-panel="shorts"] .template-tech-row .template-opacity,
[data-section-panel="socks"] .template-tech-row .template-opacity,
#collarTemplateDetails .template-tech-row .template-opacity {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity-value,
[data-section-panel="shorts"] .template-tech-row .template-opacity-value,
[data-section-panel="socks"] .template-tech-row .template-opacity-value,
#collarTemplateDetails .template-tech-row .template-opacity-value {
  width: 25px !important;
  min-width: 25px !important;
  font-size: 9.2px !important;
  text-align: right !important;
}
[data-section-panel="shirt"] .seam-lab-row,
[data-section-panel="shorts"] .seam-lab-row,
[data-section-panel="socks"] .seam-lab-row,
#collarTemplateDetails .seam-lab-row {
  grid-template-columns: 22px minmax(86px,1fr) 58px 42px 25px 19px !important;
  gap: 3px !important;
  overflow: visible !important;
}
[data-section-panel="shirt"] .seam-lab-blend,
[data-section-panel="shorts"] .seam-lab-blend,
[data-section-panel="socks"] .seam-lab-blend,
#collarTemplateDetails .seam-lab-blend {
  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  font-size: 9.2px !important;
}
[data-section-panel="shirt"] .seam-lab-opacity,
[data-section-panel="shorts"] .seam-lab-opacity,
[data-section-panel="socks"] .seam-lab-opacity,
#collarTemplateDetails .seam-lab-opacity {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
}
[data-section-panel="shirt"] .seam-lab-opacity-value,
[data-section-panel="shorts"] .seam-lab-opacity-value,
[data-section-panel="socks"] .seam-lab-opacity-value,
#collarTemplateDetails .seam-lab-opacity-value {
  width: 25px !important;
  min-width: 25px !important;
  font-size: 9.2px !important;
}


/* v0.9.87: Photoshop-row fit. Keep every layer row in one line inside the block, with full controls visible. */
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row {
  min-height: 23px !important;
  height: 23px !important;
  padding: 2px 2px !important;
  gap: 2px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  overflow: visible !important;
  font-size: 9.2px !important;
}
[data-section-panel="shirt"] .template-tech-row,
[data-section-panel="shorts"] .template-tech-row,
[data-section-panel="socks"] .template-tech-row,
#collarTemplateDetails .template-tech-row {
  grid-template-columns: 20px 16px minmax(0,1fr) 52px 40px 22px !important;
  gap: 2px !important;
  align-items: center !important;
}
[data-section-panel="shirt"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="shorts"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="socks"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
#collarTemplateDetails .template-detail-row:not(.template-tech-row):not(.seam-lab-row) {
  grid-template-columns: 20px 16px minmax(0,1fr) !important;
}
[data-section-panel="shirt"] .template-detail-name,
[data-section-panel="shorts"] .template-detail-name,
[data-section-panel="socks"] .template-detail-name,
#collarTemplateDetails .template-detail-name,
.seam-lab-name {
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  font-size: 9.2px !important;
  line-height: 1 !important;
}
[data-section-panel="shirt"] .template-tech-row select,
[data-section-panel="shorts"] .template-tech-row select,
[data-section-panel="socks"] .template-tech-row select,
#collarTemplateDetails .template-tech-row select {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 19px !important;
  font-size: 8.8px !important;
  padding: 0 1px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity,
[data-section-panel="shorts"] .template-tech-row .template-opacity,
[data-section-panel="socks"] .template-tech-row .template-opacity,
#collarTemplateDetails .template-tech-row .template-opacity {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity-value,
[data-section-panel="shorts"] .template-tech-row .template-opacity-value,
[data-section-panel="socks"] .template-tech-row .template-opacity-value,
#collarTemplateDetails .template-tech-row .template-opacity-value {
  width: 22px !important;
  min-width: 22px !important;
  font-size: 8.7px !important;
  text-align: right !important;
}
[data-section-panel="shirt"] .seam-lab-row,
[data-section-panel="shorts"] .seam-lab-row,
[data-section-panel="socks"] .seam-lab-row,
#collarTemplateDetails .seam-lab-row {
  grid-template-columns: 20px minmax(0,1fr) 52px 38px 22px 18px !important;
  gap: 2px !important;
  min-height: 23px !important;
  height: 23px !important;
  padding: 2px 2px !important;
  white-space: nowrap !important;
}
.seam-lab-blend { width:52px !important; min-width:52px !important; max-width:52px !important; font-size:8.7px !important; }
.seam-lab-opacity { width:38px !important; min-width:38px !important; max-width:38px !important; }
.seam-lab-opacity-value { width:22px !important; min-width:22px !important; font-size:8.7px !important; }
.template-folder-body { padding:4px !important; gap:3px !important; }


/* v0.9.88: final row repair — match LOGOS text, fixed arrow icons, swatch spacing, one-line opacity editing. */
[data-section-panel="shirt"] .template-details-panel,
[data-section-panel="shorts"] .template-details-panel,
[data-section-panel="socks"] .template-details-panel,
#collarTemplateDetails {
  font-size: 10.5px !important;
}
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
[data-section-panel="shirt"] .template-folder-title,
[data-section-panel="shorts"] .template-folder-title,
[data-section-panel="socks"] .template-folder-title,
#collarTemplateDetails .template-folder-title {
  font-size: 10.5px !important;
  line-height: 1.05 !important;
}
[data-section-panel="shirt"] .template-detail-name,
[data-section-panel="shorts"] .template-detail-name,
[data-section-panel="socks"] .template-detail-name,
#collarTemplateDetails .template-detail-name,
.seam-lab-name {
  font-size: 10.5px !important;
  line-height: 1.05 !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
  min-width: 0 !important;
}
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row {
  min-height: 26px !important;
  height: 26px !important;
  padding: 2px 3px !important;
  gap: 3px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  align-items: center !important;
}
[data-section-panel="shirt"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="shorts"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="socks"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
#collarTemplateDetails .template-detail-row:not(.template-tech-row):not(.seam-lab-row) {
  grid-template-columns: 22px 21px minmax(0,1fr) 17px 17px !important;
  column-gap: 5px !important;
}
[data-section-panel="shirt"] .template-tech-row,
[data-section-panel="shorts"] .template-tech-row,
[data-section-panel="socks"] .template-tech-row,
#collarTemplateDetails .template-tech-row {
  grid-template-columns: 22px 21px minmax(34px,1fr) 50px 36px 25px !important;
  column-gap: 5px !important;
}
.template-eye-btn,
.template-arrow-btn,
.template-delete-btn {
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}
[data-section-panel="shirt"] .template-eye-btn,
[data-section-panel="shorts"] .template-eye-btn,
[data-section-panel="socks"] .template-eye-btn,
#collarTemplateDetails .template-eye-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
}
[data-section-panel="shirt"] .template-eye-btn img,
[data-section-panel="shorts"] .template-eye-btn img,
[data-section-panel="socks"] .template-eye-btn img,
#collarTemplateDetails .template-eye-btn img {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  object-fit: contain !important;
}
[data-section-panel="shirt"] .template-arrow-btn,
[data-section-panel="shorts"] .template-arrow-btn,
[data-section-panel="socks"] .template-arrow-btn,
#collarTemplateDetails .template-arrow-btn {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
}
[data-section-panel="shirt"] .template-arrow-btn img,
[data-section-panel="shorts"] .template-arrow-btn img,
[data-section-panel="socks"] .template-arrow-btn img,
#collarTemplateDetails .template-arrow-btn img {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  object-fit: contain !important;
  display: block !important;
}
.template-palette-wrap,
.template-palette-placeholder {
  margin-left: 5px !important;
  width: 16px !important;
  min-width: 16px !important;
  height: 16px !important;
}
.template-palette-wrap .template-palette-swatch,
.template-detail-row .template-palette-swatch,
.template-detail-row .palette-color-swatch.template-palette-swatch {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
}
[data-section-panel="shirt"] .template-tech-row select,
[data-section-panel="shorts"] .template-tech-row select,
[data-section-panel="socks"] .template-tech-row select,
#collarTemplateDetails .template-tech-row select {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  height: 20px !important;
  font-size: 9.6px !important;
  padding: 0 1px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity,
[data-section-panel="shorts"] .template-tech-row .template-opacity,
[data-section-panel="socks"] .template-tech-row .template-opacity,
#collarTemplateDetails .template-tech-row .template-opacity {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity-value,
[data-section-panel="shorts"] .template-tech-row .template-opacity-value,
[data-section-panel="socks"] .template-tech-row .template-opacity-value,
#collarTemplateDetails .template-tech-row .template-opacity-value {
  width: 25px !important;
  min-width: 25px !important;
  font-size: 9.6px !important;
  text-align: right !important;
  cursor: text !important;
}
[data-section-panel="shirt"] .seam-lab-row,
[data-section-panel="shorts"] .seam-lab-row,
[data-section-panel="socks"] .seam-lab-row,
#collarTemplateDetails .seam-lab-row {
  grid-template-columns: 22px minmax(34px,1fr) 50px 36px 25px 18px !important;
  column-gap: 5px !important;
  min-height: 26px !important;
  height: 26px !important;
  padding: 2px 3px !important;
  overflow: hidden !important;
}
.seam-lab-blend {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  font-size: 9.6px !important;
}
.seam-lab-opacity {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
}
.seam-lab-opacity-value {
  width: 25px !important;
  min-width: 25px !important;
  font-size: 9.6px !important;
  cursor: text !important;
}
.template-opacity-inline-number {
  width: 34px !important;
  height: 18px !important;
  font-size: 10px !important;
  padding: 0 2px !important;
  text-align: right !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 4px !important;
  color: #fff !important;
  background: rgba(0,0,0,.28) !important;
}


/* v0.9.89: final row fit / arrows / LOGOS-sized typography. Keep all template rows inside the sidebar. */
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
.basic-piece-row,
.armband-row,
.seam-lab-row {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 25px !important;
  height: 25px !important;
  padding: 2px 2px !important;
  gap: 3px !important;
  align-items: center !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}
[data-section-panel="shirt"] .template-detail-row:not(.template-tech-row),
[data-section-panel="shorts"] .template-detail-row:not(.template-tech-row),
[data-section-panel="socks"] .template-detail-row:not(.template-tech-row),
#collarTemplateDetails .template-detail-row:not(.template-tech-row) {
  display: grid !important;
  grid-template-columns: 20px 23px minmax(0,1fr) 16px 16px !important;
}
[data-section-panel="shirt"] .template-tech-row,
[data-section-panel="shorts"] .template-tech-row,
[data-section-panel="socks"] .template-tech-row,
#collarTemplateDetails .template-tech-row {
  display: grid !important;
  grid-template-columns: 20px 23px minmax(0,1fr) 0 52px 36px 29px 16px 16px !important;
  gap: 2px !important;
}
.basic-piece-row {
  display: grid !important;
  grid-template-columns: 20px 23px minmax(0,1fr) 0 !important;
}
.armband-row {
  display: grid !important;
  grid-template-columns: 24px minmax(0,1fr) !important;
}
[data-section-panel="shirt"] .template-detail-name,
[data-section-panel="shorts"] .template-detail-name,
[data-section-panel="socks"] .template-detail-name,
#collarTemplateDetails .template-detail-name,
.basic-piece-row .template-detail-name,
.armband-row .template-detail-name,
.seam-lab-name,
.template-folder-title {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}
.template-eye-btn,
.template-arrow-btn {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  overflow: hidden !important;
}
.template-eye-btn { width: 20px !important; height: 20px !important; min-width:20px !important; max-width:20px !important; }
.template-eye-btn img { width: 18px !important; height: 18px !important; max-width:18px !important; max-height:18px !important; object-fit:contain !important; }
.template-arrow-btn img { display: none !important; }
.template-palette-wrap,
.template-palette-placeholder {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  display: inline-grid !important;
  place-items: center !important;
  margin-left: 5px !important;
  box-sizing: border-box !important;
}
.template-palette-wrap .template-palette-swatch,
.template-palette-swatch,
.palette-color-swatch.template-palette-swatch {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  margin: 0 !important;
}
.template-row-spacer { display:block !important; width:0 !important; min-width:0 !important; overflow:hidden !important; }
.template-tech-row select {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 19px !important;
  font-size: 9px !important;
  padding: 0 1px !important;
}
.template-tech-row .template-opacity {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 18px !important;
}
.template-tech-row .template-opacity-value,
.seam-lab-opacity-value {
  width: 29px !important;
  min-width: 29px !important;
  max-width: 29px !important;
  font-size: 9.4px !important;
  line-height: 1 !important;
  text-align: right !important;
  cursor: text !important;
}
.template-folder-title {
  height: 25px !important;
  line-height: 25px !important;
  padding: 0 7px !important;
}
.template-folder-body { overflow: hidden !important; }
.seam-lab-row {
  display: grid !important;
  grid-template-columns: 20px minmax(0,1fr) 52px 38px 29px 18px !important;
  gap: 2px !important;
}
.seam-lab-blend { width: 52px !important; min-width:52px !important; max-width:52px !important; font-size:9px !important; }
.seam-lab-opacity { width: 38px !important; min-width:38px !important; max-width:38px !important; }

/* v0.9.91: repair template layer row layout without changing render logic.
   Keep original arrow buttons as text icons; do not replace them with broken images. */
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
.basic-piece-row,
.armband-row {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-height: 24px !important;
  height: 24px !important;
  padding: 2px 3px !important;
  gap: 2px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  align-items: center !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}
[data-section-panel="shirt"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="shorts"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="socks"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
#collarTemplateDetails .template-detail-row:not(.template-tech-row):not(.seam-lab-row) {
  display: grid !important;
  grid-template-columns: 18px 23px minmax(0,1fr) 14px 14px !important;
  column-gap: 3px !important;
}
[data-section-panel="shirt"] .template-tech-row,
[data-section-panel="shorts"] .template-tech-row,
[data-section-panel="socks"] .template-tech-row,
#collarTemplateDetails .template-tech-row {
  display: grid !important;
  grid-template-columns: 18px 23px minmax(0,1fr) 0 46px 34px 26px 14px 14px !important;
  column-gap: 2px !important;
}
.basic-piece-row {
  display: grid !important;
  grid-template-columns: 18px 23px minmax(0,1fr) !important;
  column-gap: 3px !important;
}
.template-detail-name,
.basic-piece-row .template-detail-name,
.armband-row .template-detail-name,
.seam-lab-name,
.template-folder-title {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}
.template-eye-btn {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}
.template-eye-btn img {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  object-fit: contain !important;
  display: block !important;
}
.template-arrow-btn {
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  color: #fff !important;
  font-size: 12px !important;
  font-family: Arial, sans-serif !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}
.template-arrow-btn img { display: none !important; }
.template-palette-wrap,
.template-palette-placeholder {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  margin-left: 5px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.template-palette-wrap .template-palette-swatch,
.template-palette-swatch,
.palette-color-swatch.template-palette-swatch {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  margin: 0 !important;
}
.template-row-spacer {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  overflow: hidden !important;
  display: block !important;
}
.template-tech-row select {
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  height: 19px !important;
  padding: 0 1px !important;
  font-size: 8.8px !important;
}
.template-tech-row .template-opacity {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 18px !important;
}
.template-tech-row .template-opacity-value,
.seam-lab-opacity-value {
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  font-size: 9.4px !important;
  text-align: right !important;
  cursor: text !important;
}
.seam-lab-row {
  display: grid !important;
  grid-template-columns: 18px minmax(0,1fr) 46px 36px 26px 18px !important;
  column-gap: 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 24px !important;
  height: 24px !important;
  padding: 2px 3px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  align-items: center !important;
}
.seam-lab-blend { width:46px !important; min-width:46px !important; max-width:46px !important; font-size:8.8px !important; }
.seam-lab-opacity { width:36px !important; min-width:36px !important; max-width:36px !important; }
.template-folder-body { overflow: hidden !important; padding: 4px !important; }


/* v0.9.91 - locked uploaded arrow icons for template layer move buttons */
.template-arrow-btn {
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  max-height: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-grid !important;
  place-items: center !important;
  overflow: visible !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
}
.template-arrow-btn img {
  display: block !important;
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
  object-fit: contain !important;
  pointer-events: none !important;
  filter: none !important;
}

/* v0.9.92 - UI line fit + smaller locked arrow icons */
[data-section-panel="shirt"] .template-details-panel,
[data-section-panel="shorts"] .template-details-panel,
[data-section-panel="socks"] .template-details-panel,
#collarTemplateDetails {
  font-size: 10.5px !important;
}
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
.basic-piece-row,
.armband-row {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-height: 24px !important;
  height: 24px !important;
  padding: 2px 4px !important;
  gap: 0 !important;
  overflow: visible !important;
  white-space: nowrap !important;
  align-items: center !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}
[data-section-panel="shirt"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="shorts"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="socks"] .template-detail-row:not(.template-tech-row):not(.seam-lab-row),
#collarTemplateDetails .template-detail-row:not(.template-tech-row):not(.seam-lab-row) {
  grid-template-columns: 18px 24px minmax(0, 1fr) 13px 13px !important;
  column-gap: 3px !important;
}
[data-section-panel="shirt"] .template-tech-row,
[data-section-panel="shorts"] .template-tech-row,
[data-section-panel="socks"] .template-tech-row,
#collarTemplateDetails .template-tech-row {
  grid-template-columns: 18px 24px minmax(34px, 1fr) 0 45px 32px 26px 13px 13px !important;
  column-gap: 2px !important;
}
.basic-piece-row {
  grid-template-columns: 18px 24px minmax(0, 1fr) 0 !important;
  column-gap: 3px !important;
}
.armband-row {
  grid-template-columns: 18px minmax(0, 1fr) !important;
  column-gap: 4px !important;
}
.template-eye-btn {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
}
.template-palette-wrap,
.template-palette-placeholder {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  margin-left: 5px !important;
  margin-right: 1px !important;
}
.template-palette-wrap .template-palette-swatch,
.template-palette-swatch,
.palette-color-swatch.template-palette-swatch {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
}
.template-detail-name,
.basic-piece-row .template-detail-name,
.armband-row .template-detail-name,
#collarTemplateDetails .template-detail-name,
.template-folder-body .template-detail-name {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}
.template-tech-row select {
  width: 45px !important;
  min-width: 45px !important;
  max-width: 45px !important;
  height: 18px !important;
  font-size: 8.7px !important;
  padding: 0 1px !important;
}
.template-tech-row .template-opacity {
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 18px !important;
}
.template-tech-row .template-opacity-value,
.seam-lab-opacity-value {
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  font-size: 9.3px !important;
  line-height: 1 !important;
  text-align: right !important;
  cursor: text !important;
}
.template-arrow-btn {
  width: 13px !important;
  min-width: 13px !important;
  max-width: 13px !important;
  height: 13px !important;
  min-height: 13px !important;
  max-height: 13px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-grid !important;
  place-items: center !important;
  overflow: visible !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
}
.template-arrow-btn img {
  display: block !important;
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  object-fit: contain !important;
  pointer-events: none !important;
  filter: none !important;
}


/* v0.9.95: no empty color holes + Nike Tights controls stay compact in one line. */
.template-detail-row.no-swatch .template-palette-placeholder,
.template-detail-row.no-swatch .template-palette-wrap {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
}
[data-section-panel="shirt"] .template-detail-row.no-swatch:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="shorts"] .template-detail-row.no-swatch:not(.template-tech-row):not(.seam-lab-row),
[data-section-panel="socks"] .template-detail-row.no-swatch:not(.template-tech-row):not(.seam-lab-row),
#collarTemplateDetails .template-detail-row.no-swatch:not(.template-tech-row):not(.seam-lab-row) {
  grid-template-columns: 20px minmax(0,1fr) 16px 16px !important;
  column-gap: 3px !important;
}
[data-section-panel="shirt"] .template-tech-row.no-swatch,
[data-section-panel="shorts"] .template-tech-row.no-swatch,
[data-section-panel="socks"] .template-tech-row.no-swatch,
#collarTemplateDetails .template-tech-row.no-swatch {
  grid-template-columns: 20px minmax(0,1fr) 0 52px 36px 29px 16px 16px !important;
  column-gap: 3px !important;
}
.template-detail-row.no-swatch .template-detail-name {
  margin-left: 0 !important;
  padding-left: 0 !important;
}
.template-detail-row:not(.no-swatch) .template-palette-wrap {
  margin-left: 5px !important;
}
.template-arrow-btn img {
  display: block !important;
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  object-fit: contain !important;
}


/* v1.0.1: definitive one-line row layout.
   Arrows always live at the far right, no matter if a row has swatch, blend or opacity.
   Rows without a color swatch have no empty swatch gap: name starts right after the eye. */
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
.basic-piece-row,
.armband-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  min-height: 24px !important;
  height: 24px !important;
  padding: 2px 3px !important;
  gap: 3px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}
[data-section-panel="shirt"] .template-detail-row .template-eye-btn,
[data-section-panel="shorts"] .template-detail-row .template-eye-btn,
[data-section-panel="socks"] .template-detail-row .template-eye-btn,
#collarTemplateDetails .template-detail-row .template-eye-btn,
.basic-piece-row .template-eye-btn {
  flex: 0 0 18px !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
}
[data-section-panel="shirt"] .template-detail-row .template-eye-btn img,
[data-section-panel="shorts"] .template-detail-row .template-eye-btn img,
[data-section-panel="socks"] .template-detail-row .template-eye-btn img,
#collarTemplateDetails .template-detail-row .template-eye-btn img,
.basic-piece-row .template-eye-btn img {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}
[data-section-panel="shirt"] .template-detail-row .template-palette-wrap,
[data-section-panel="shorts"] .template-detail-row .template-palette-wrap,
[data-section-panel="socks"] .template-detail-row .template-palette-wrap,
#collarTemplateDetails .template-detail-row .template-palette-wrap,
.basic-piece-row .template-palette-wrap {
  flex: 0 0 18px !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  margin-left: 5px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
[data-section-panel="shirt"] .template-detail-row .template-palette-placeholder,
[data-section-panel="shorts"] .template-detail-row .template-palette-placeholder,
[data-section-panel="socks"] .template-detail-row .template-palette-placeholder,
#collarTemplateDetails .template-detail-row .template-palette-placeholder {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin: 0 !important;
}
[data-section-panel="shirt"] .template-detail-row .template-detail-name,
[data-section-panel="shorts"] .template-detail-row .template-detail-name,
[data-section-panel="socks"] .template-detail-row .template-detail-name,
#collarTemplateDetails .template-detail-row .template-detail-name,
.basic-piece-row .template-detail-name,
.armband-row .template-detail-name {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}
.template-row-spacer {
  display: none !important;
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
}
[data-section-panel="shirt"] .template-tech-row select,
[data-section-panel="shorts"] .template-tech-row select,
[data-section-panel="socks"] .template-tech-row select,
#collarTemplateDetails .template-tech-row select {
  flex: 0 0 54px !important;
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  height: 19px !important;
  font-size: 9px !important;
  padding: 0 1px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity,
[data-section-panel="shorts"] .template-tech-row .template-opacity,
[data-section-panel="socks"] .template-tech-row .template-opacity,
#collarTemplateDetails .template-tech-row .template-opacity {
  flex: 0 0 36px !important;
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 18px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity-value,
[data-section-panel="shorts"] .template-tech-row .template-opacity-value,
[data-section-panel="socks"] .template-tech-row .template-opacity-value,
#collarTemplateDetails .template-tech-row .template-opacity-value {
  flex: 0 0 29px !important;
  width: 29px !important;
  min-width: 29px !important;
  max-width: 29px !important;
  text-align: right !important;
  font-size: 9.4px !important;
  cursor: text !important;
}
[data-section-panel="shirt"] .template-detail-row .template-arrow-btn,
[data-section-panel="shorts"] .template-detail-row .template-arrow-btn,
[data-section-panel="socks"] .template-detail-row .template-arrow-btn,
#collarTemplateDetails .template-detail-row .template-arrow-btn {
  flex: 0 0 14px !important;
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 18px !important;
  margin-left: 1px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}
[data-section-panel="shirt"] .template-detail-row .template-arrow-btn img,
[data-section-panel="shorts"] .template-detail-row .template-arrow-btn img,
[data-section-panel="socks"] .template-detail-row .template-arrow-btn img,
#collarTemplateDetails .template-detail-row .template-arrow-btn img {
  display: block !important;
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  object-fit: contain !important;
}


/* v1.0.2: lock row actions to far-right column and keep collar tights controls visible. */
.template-detail-block,
.template-folder-body .template-detail-block {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
[data-section-panel="shirt"] .template-detail-row .template-detail-name,
[data-section-panel="shorts"] .template-detail-row .template-detail-name,
[data-section-panel="socks"] .template-detail-row .template-detail-name,
#collarTemplateDetails .template-detail-row .template-detail-name {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
[data-section-panel="shirt"] .template-detail-row [data-template-up],
[data-section-panel="shorts"] .template-detail-row [data-template-up],
[data-section-panel="socks"] .template-detail-row [data-template-up],
#collarTemplateDetails .template-detail-row [data-template-up] {
  margin-left: auto !important;
}
[data-section-panel="shirt"] .template-tech-row [data-template-up],
[data-section-panel="shorts"] .template-tech-row [data-template-up],
[data-section-panel="socks"] .template-tech-row [data-template-up],
#collarTemplateDetails .template-tech-row [data-template-up] {
  margin-left: auto !important;
}
[data-section-panel="shirt"] .template-tech-row select,
[data-section-panel="shorts"] .template-tech-row select,
[data-section-panel="socks"] .template-tech-row select,
#collarTemplateDetails .template-tech-row select {
  flex: 0 0 54px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity,
[data-section-panel="shorts"] .template-tech-row .template-opacity,
[data-section-panel="socks"] .template-tech-row .template-opacity,
#collarTemplateDetails .template-tech-row .template-opacity {
  flex: 0 0 36px !important;
}
[data-section-panel="shirt"] .template-tech-row .template-opacity-value,
[data-section-panel="shorts"] .template-tech-row .template-opacity-value,
[data-section-panel="socks"] .template-tech-row .template-opacity-value,
#collarTemplateDetails .template-tech-row .template-opacity-value {
  flex: 0 0 29px !important;
}


/* v1.0.5: locked Armband row repair.
   The line must always display icon + full selected PNG name in one row.
   Do not let generic template row grids/flex action columns shrink it to “Armt”. */
[data-section-panel="shirt"] .kitlab-armband-line,
.kitlab-armband-line,
[data-section-panel="shirt"] .template-detail-row.kitlab-armband-line,
.template-detail-row.kitlab-armband-line {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 24px !important;
  min-height: 24px !important;
  box-sizing: border-box !important;
  padding: 2px 3px !important;
  gap: 5px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  grid-template-columns: none !important;
}
[data-section-panel="shirt"] .kitlab-armband-line .logo-row-icon-btn,
.kitlab-armband-line .logo-row-icon-btn {
  flex: 0 0 18px !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
[data-section-panel="shirt"] .kitlab-armband-line .logo-row-icon-btn img,
.kitlab-armband-line .logo-row-icon-btn img {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  object-fit: contain !important;
}
[data-section-panel="shirt"] .kitlab-armband-line #selectedArmbandName,
[data-section-panel="shirt"] .kitlab-armband-line .armband-name,
.kitlab-armband-line #selectedArmbandName,
.kitlab-armband-line .armband-name {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  word-break: normal !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
  color: #fff !important;
}


/* v1.0.13 — TEMPLATE gallery like Armband: header back arrow, no fake Template Folders card, horizontal bigger thumbnails. */
#brandGalleryModal[data-gallery-source="template"][data-gallery-back="1"] .brand-gallery-header,
.modal-backdrop[data-gallery-source="template"][data-gallery-back="1"] .brand-gallery-header {
  grid-template-columns: auto 26px minmax(280px, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="template"] #galleryBackBtn,
.modal-backdrop[data-gallery-source="template"] #galleryBackBtn {
  width: 24px !important;
  height: 24px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 5px !important;
  font-size: 16px !important;
  line-height: 1 !important;
  color: #ffffff !important;
  opacity: 0.95 !important;
}
#brandGalleryModal[data-gallery-source="template"] #galleryBackBtn[hidden],
.modal-backdrop[data-gallery-source="template"] #galleryBackBtn[hidden] {
  display: none !important;
}
#brandGalleryModal[data-gallery-source="template"][data-gallery-back="0"] .brand-gallery-header,
#brandGalleryModal[data-gallery-source="template"]:not([data-gallery-back="1"]) .brand-gallery-header,
.modal-backdrop[data-gallery-source="template"][data-gallery-back="0"] .brand-gallery-header,
.modal-backdrop[data-gallery-source="template"]:not([data-gallery-back="1"]) .brand-gallery-header {
  grid-template-columns: auto minmax(280px, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="template"] #brandGallerySearch,
.modal-backdrop[data-gallery-source="template"] #brandGallerySearch {
  min-width: 280px !important;
  width: 100% !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 22px !important;
  padding: 18px 22px 24px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card {
  flex: 0 0 188px !important;
  width: 188px !important;
  height: 172px !important;
  min-width: 188px !important;
  min-height: 172px !important;
  display: grid !important;
  grid-template-rows: 126px 28px !important;
  place-items: center !important;
  gap: 4px !important;
  padding: 6px !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card img {
  max-width: 168px !important;
  max-height: 120px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  padding: 0 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card {
  flex: 0 0 940px !important;
  width: 940px !important;
  min-width: 940px !important;
  height: 620px !important;
  min-height: 620px !important;
  padding: 16px 20px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img {
  max-width: 900px !important;
  max-height: 540px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  padding: 0 !important;
  margin: 0 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span {
  width: 100% !important;
  max-width: 900px !important;
  text-align: center !important;
  font-size: 14px !important;
  line-height: 1.1 !important;
  color: rgba(255,255,255,0.78) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
}


/* v1.0.15: Pattern is the only template folder with folder-level up/down arrows. */
.template-folder-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.template-folder-toggle {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #fff !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
  font: inherit !important;
  font-weight: 700 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: clip !important;
  cursor: pointer !important;
}
.template-folder-spacer {
  flex: 1 1 auto !important;
  min-width: 8px !important;
}
.template-folder-arrow {
  flex: 0 0 14px !important;
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 18px !important;
}
.template-folder-title-row .template-folder-arrow img {
  display: block !important;
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  object-fit: contain !important;
}


/* v1.0.17: compact Template gallery thumbnails.
   Keep Armband-style header, remove horizontal scrolling, tighten spacing,
   and shrink the huge v1.0.13 thumbnails to about 30% of their previous size. */
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 8px 8px !important;
  padding: 14px 14px 18px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  align-content: flex-start !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card {
  flex: 0 0 282px !important;
  width: 282px !important;
  min-width: 282px !important;
  max-width: 282px !important;
  height: 226px !important;
  min-height: 226px !important;
  max-height: 226px !important;
  padding: 6px 6px 10px !important;
  gap: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img {
  flex: 0 0 auto !important;
  max-width: 270px !important;
  max-height: 164px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:hover img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:hover img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:active img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:active img {
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 270px !important;
  text-align: center !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
  color: rgba(255,255,255,0.82) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 13px 0 0 !important;
  padding: 0 !important;
  position: relative !important;
  z-index: 2 !important;
}


/* v1.0.18: Template thumbnails closer together and x2 from compact size.
   No horizontal scroll: the grid wraps tightly into new rows. */
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-window {
  width: calc(100vw - 36px) !important;
  max-width: calc(100vw - 36px) !important;
  overflow-x: hidden !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  column-gap: 0 !important;
  row-gap: 2px !important;
  padding: 6px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  align-content: flex-start !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card {
  flex: 0 0 564px !important;
  width: 564px !important;
  min-width: 564px !important;
  max-width: 564px !important;
  height: 378px !important;
  min-height: 378px !important;
  max-height: 378px !important;
  padding: 2px 2px 8px !important;
  margin: 0 !important;
  gap: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img {
  flex: 0 0 auto !important;
  max-width: 540px !important;
  max-height: 328px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:hover img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:hover img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:active img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:active img {
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 540px !important;
  text-align: center !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
  color: rgba(255,255,255,0.82) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 16px 0 0 !important;
  padding: 0 !important;
  position: relative !important;
  z-index: 2 !important;
}


/* v1.0.19: Template gallery uses the same modal box as Armband/Brand.
   Cards stay tight, wrap without horizontal scroll, and template images are centered.
   Pattern is a normal bold folder header; no folder-level arrows. */
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-window {
  width: min(1200px, calc(100vw - 80px)) !important;
  height: min(710px, calc(100vh - 120px)) !important;
  min-height: min(710px, calc(100vh - 120px)) !important;
  max-width: min(1200px, calc(100vw - 80px)) !important;
  max-height: min(710px, calc(100vh - 120px)) !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  overflow: hidden !important;
  background: #313658 !important;
  border-radius: 8px !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 236px) !important;
  grid-auto-rows: 174px !important;
  justify-content: start !important;
  align-content: start !important;
  gap: 4px !important;
  padding: 12px 12px 18px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #313658 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card {
  width: 236px !important;
  min-width: 236px !important;
  max-width: 236px !important;
  height: 174px !important;
  min-height: 174px !important;
  max-height: 174px !important;
  padding: 2px 2px 8px !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-rows: 136px 24px !important;
  place-items: center !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 4px !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img {
  display: block !important;
  align-self: center !important;
  justify-self: center !important;
  max-width: 230px !important;
  max-height: 132px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  padding: 0 !important;
  margin: 0 auto !important;
  transform: none !important;
  z-index: 1 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:hover img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:hover img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:active img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:active img {
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span {
  align-self: start !important;
  justify-self: center !important;
  width: 100% !important;
  max-width: 230px !important;
  text-align: center !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  color: rgba(255,255,255,0.82) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  position: static !important;
  z-index: 2 !important;
}
.template-folder-title {
  font-weight: 700 !important;
}
.template-folder-title-row,
.template-folder-toggle,
.template-folder-spacer,
.template-folder-arrow {
  display: none !important;
}


/* v1.0.20: Template search text + centered x2 vertical template thumbnails, almost no blank gaps.
   Same modal window size as Armband/Brand; no horizontal scroll. */
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-window {
  width: min(1200px, calc(100vw - 80px)) !important;
  height: min(710px, calc(100vh - 120px)) !important;
  min-height: min(710px, calc(100vh - 120px)) !important;
  max-width: min(1200px, calc(100vw - 80px)) !important;
  max-height: min(710px, calc(100vh - 120px)) !important;
  overflow: hidden !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 112px) !important;
  grid-auto-rows: 296px !important;
  justify-content: center !important;
  align-content: start !important;
  column-gap: 0 !important;
  row-gap: 2px !important;
  padding: 8px 8px 16px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #313658 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  height: 296px !important;
  min-height: 296px !important;
  max-height: 296px !important;
  padding: 0 1px 6px !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-rows: 266px 24px !important;
  align-items: center !important;
  justify-items: center !important;
  place-items: center !important;
  gap: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card img {
  display: block !important;
  align-self: center !important;
  justify-self: center !important;
  max-width: 108px !important;
  max-height: 264px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 0 !important;
  margin: 0 auto !important;
  transform: none !important;
  transition: none !important;
  z-index: 1 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:hover img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card:hover img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:hover img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card:hover img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:active img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card:active img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:active img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card:active img {
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card span {
  align-self: start !important;
  justify-self: center !important;
  width: 110px !important;
  max-width: 110px !important;
  text-align: center !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  color: rgba(255,255,255,0.82) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  position: static !important;
  z-index: 2 !important;
}

/* v1.0.21 TEST: larger inner sidebar content only.
   Keep the top module icons and blue separators untouched. Visual test on top of locked v1.0.20. */
.app-shell {
  grid-template-columns: 404px minmax(0, 1fr) !important;
}
.sidebar {
  padding: 12px !important;
  font-size: 12px !important;
}
.module-tabbar .rail-btn,
.module-tabbar .rail-btn.active,
.module-tabbar .rail-btn:hover {
  width: 42px !important;
  height: 42px !important;
  padding: 1px !important;
}
.module-tabbar .rail-icon,
.module-tabbar .rail-btn.active .rail-icon,
.module-tabbar .rail-btn:hover .rail-icon {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
}
.section-heading span,
.settings-heading-clean span,
.logos-heading span {
  font-size: 14px !important;
  font-weight: 700 !important;
}
.main-module,
.panel {
  border-color: rgba(255,255,255,0.13) !important;
}

/* Settings: bigger readable lines, but keep blue separators elsewhere intact. */
.settings-line {
  min-height: 31px !important;
  gap: 8px !important;
  font-size: 12px !important;
  border-bottom: 1px solid rgba(255,255,255,0.085) !important;
  padding: 3px 0 !important;
}
.settings-main-panel .settings-line:last-child {
  border-bottom: 0 !important;
}
.template-settings-line,
.texture-main-line {
  grid-template-columns: 25px minmax(0,1fr) !important;
}
.guide-toggle-line {
  grid-template-columns: 25px minmax(48px,72px) minmax(0,1fr) 40px !important;
}
.settings-icon-btn {
  width: 25px !important;
  height: 25px !important;
  min-width: 25px !important;
}
.settings-icon-btn img {
  max-width: 23px !important;
  max-height: 23px !important;
}
.visibility-icon-btn img {
  max-width: 23px !important;
  max-height: 19px !important;
}
.settings-label,
.settings-value,
.settings-texture-name,
.settings-opacity-value {
  font-size: 12px !important;
}
.settings-actions-clean button {
  min-height: 32px !important;
  font-size: 12px !important;
}

/* Logos rows: larger internal content only. */
[data-section-panel="logos"] .brand-toggle {
  min-height: 38px !important;
  font-size: 12.3px !important;
  border-bottom: 1px solid rgba(255,255,255,0.095) !important;
}
[data-section-panel="logos"] .module-body {
  gap: 0 !important;
  padding: 8px 10px 9px !important;
}
[data-section-panel="logos"] .part-row,
[data-section-panel="logos"] .part-row:not(.has-file) {
  min-height: 31px !important;
  padding: 4px 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.085) !important;
  font-size: 12px !important;
  grid-template-columns: 25px 25px max-content 28px minmax(0, 1fr) auto 24px 20px !important;
  gap: 5px !important;
}
[data-section-panel="logos"] .part-row:not(.has-file) {
  grid-template-columns: 25px 25px max-content minmax(0, 1fr) !important;
}
[data-section-panel="logos"] .part-name,
[data-section-panel="logos"] .part-file {
  font-size: 12px !important;
}
[data-section-panel="logos"] .icon-btn.logo-row-icon-btn {
  width: 25px !important;
  height: 25px !important;
  min-width: 25px !important;
}
[data-section-panel="logos"] .icon-btn.logo-row-icon-btn img {
  width: 23px !important;
  height: 23px !important;
  max-width: 23px !important;
  max-height: 23px !important;
}
[data-section-panel="logos"] .part-thumb {
  width: 28px !important;
  height: 24px !important;
}
[data-section-panel="logos"] .logo-row-color-swatch,
[data-section-panel="logos"] .part-row-palette .palette-color-swatch {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
}
[data-section-panel="logos"] .part-options {
  font-size: 12px !important;
}
[data-section-panel="logos"] .option-row.three.tight,
[data-section-panel="logos"] .option-row.three.tight > span,
[data-section-panel="logos"] .border-inline-toggle span {
  font-size: 12px !important;
}

/* Shirt / Shorts / Socks layer rows: bigger, separated like the reference image. */
[data-section-panel="shirt"] .template-details-panel,
[data-section-panel="shorts"] .template-details-panel,
[data-section-panel="socks"] .template-details-panel,
#collarTemplateDetails,
.template-collar-panel {
  font-size: 12px !important;
}
.template-folder {
  border-color: rgba(255,255,255,0.12) !important;
  border-radius: 7px !important;
  margin: 7px 0 !important;
}
.template-folder-title,
.seams-lab-title {
  height: 31px !important;
  min-height: 31px !important;
  line-height: 31px !important;
  padding: 0 9px !important;
  font-size: 12.2px !important;
  font-weight: 700 !important;
  border-bottom: 1px solid rgba(255,255,255,0.09) !important;
}
.template-folder-body {
  padding: 4px 5px !important;
}
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
.basic-piece-row,
.armband-row,
.seam-lab-row {
  min-height: 31px !important;
  height: 31px !important;
  padding: 4px 5px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  border-bottom: 1px solid rgba(255,255,255,0.085) !important;
  box-sizing: border-box !important;
}
.template-detail-block:last-child .template-detail-row,
.template-folder-body .template-detail-block:last-child .template-detail-row,
.template-folder-body .seam-lab-row:last-child {
  border-bottom: 0 !important;
}
[data-section-panel="shirt"] .template-detail-row .template-detail-name,
[data-section-panel="shorts"] .template-detail-row .template-detail-name,
[data-section-panel="socks"] .template-detail-row .template-detail-name,
#collarTemplateDetails .template-detail-row .template-detail-name,
.basic-piece-row .template-detail-name,
.armband-row .template-detail-name,
.seam-lab-name,
.template-detail-name,
.template-line-name {
  font-size: 12px !important;
  line-height: 1.05 !important;
}
.template-eye-btn,
[data-section-panel="shirt"] .template-eye-btn,
[data-section-panel="shorts"] .template-eye-btn,
[data-section-panel="socks"] .template-eye-btn,
#collarTemplateDetails .template-eye-btn {
  flex: 0 0 22px !important;
  width: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
}
.template-eye-btn img,
[data-section-panel="shirt"] .template-eye-btn img,
[data-section-panel="shorts"] .template-eye-btn img,
[data-section-panel="socks"] .template-eye-btn img,
#collarTemplateDetails .template-eye-btn img {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}
.template-palette-wrap,
.template-palette-placeholder {
  flex: 0 0 22px !important;
  width: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  height: 22px !important;
  margin-left: 6px !important;
  margin-right: 3px !important;
}
.template-palette-wrap .template-palette-swatch,
.template-palette-swatch,
.palette-color-swatch.template-palette-swatch {
  width: 19px !important;
  height: 19px !important;
  min-width: 19px !important;
  max-width: 19px !important;
  border-radius: 3px !important;
}
.template-arrow-btn,
[data-section-panel="shirt"] .template-detail-row .template-arrow-btn,
[data-section-panel="shorts"] .template-detail-row .template-arrow-btn,
[data-section-panel="socks"] .template-detail-row .template-arrow-btn,
#collarTemplateDetails .template-detail-row .template-arrow-btn {
  flex: 0 0 16px !important;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 20px !important;
  margin-left: 2px !important;
}
.template-arrow-btn img,
[data-section-panel="shirt"] .template-detail-row .template-arrow-btn img,
[data-section-panel="shorts"] .template-detail-row .template-arrow-btn img,
[data-section-panel="socks"] .template-detail-row .template-arrow-btn img,
#collarTemplateDetails .template-detail-row .template-arrow-btn img {
  width: 13px !important;
  height: 13px !important;
  max-width: 13px !important;
  max-height: 13px !important;
}
.template-tech-row select,
.seam-lab-blend {
  flex: 0 0 66px !important;
  width: 66px !important;
  min-width: 66px !important;
  max-width: 66px !important;
  height: 23px !important;
  font-size: 10.5px !important;
}
.template-tech-row .template-opacity,
.seam-lab-opacity {
  flex: 0 0 48px !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  height: 20px !important;
}
.template-tech-row .template-opacity-value,
.seam-lab-opacity-value {
  flex: 0 0 34px !important;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  font-size: 10.5px !important;
}
.seam-invert-btn {
  flex: 0 0 22px !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  font-size: 11px !important;
}
[data-section-panel="shirt"] .kitlab-armband-line,
.kitlab-armband-line,
[data-section-panel="shirt"] .template-detail-row.kitlab-armband-line,
.template-detail-row.kitlab-armband-line {
  height: 31px !important;
  min-height: 31px !important;
  padding: 4px 5px !important;
  border-bottom: 1px solid rgba(255,255,255,0.085) !important;
}
[data-section-panel="shirt"] .kitlab-armband-line .logo-row-icon-btn,
.kitlab-armband-line .logo-row-icon-btn {
  flex: 0 0 22px !important;
  width: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  height: 22px !important;
}
[data-section-panel="shirt"] .kitlab-armband-line .logo-row-icon-btn img,
.kitlab-armband-line .logo-row-icon-btn img {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}
[data-section-panel="shirt"] .kitlab-armband-line #selectedArmbandName,
.kitlab-armband-line #selectedArmbandName,
.kitlab-armband-line .armband-name {
  font-size: 12px !important;
}

/* Add Layer visual test block. No functionality yet. */
.kitlab-add-layer-test {
  margin-top: 8px !important;
  padding-top: 6px !important;
  border-top: 1px solid rgba(255,255,255,0.10) !important;
}
.kitlab-add-layer-title {
  color: rgba(255,255,255,0.82) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
  margin: 0 0 8px 2px !important;
}
.kitlab-add-layer-buttons {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 7px !important;
}
.kitlab-add-layer-btn {
  min-height: 34px !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  background: rgba(119,127,184,0.42) !important;
  color: rgba(255,255,255,0.88) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: default !important;
  opacity: 1 !important;
}

/* v1.0.22 TEST: show blend-mode text clearly after sidebar scale test.
   Keep the blue layout lines untouched. */
[data-section-panel="shirt"] .template-tech-row select,
[data-section-panel="shorts"] .template-tech-row select,
[data-section-panel="socks"] .template-tech-row select,
#collarTemplateDetails .template-tech-row select,
.template-tech-row select,
.seam-lab-blend {
  flex: 0 0 86px !important;
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 5px !important;
  font-size: 11px !important;
  line-height: 24px !important;
  color: rgba(255,255,255,0.94) !important;
  background-color: rgba(28,32,64,0.96) !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  border-radius: 5px !important;
  text-align: left !important;
  text-indent: 0 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  opacity: 1 !important;
  appearance: auto !important;
  -webkit-appearance: menulist !important;
}
[data-section-panel="shirt"] .template-tech-row select option,
[data-section-panel="shorts"] .template-tech-row select option,
[data-section-panel="socks"] .template-tech-row select option,
#collarTemplateDetails .template-tech-row select option,
.template-tech-row select option,
.seam-lab-blend option {
  color: #11142a !important;
  background: #ffffff !important;
}


/* v1.0.23 TEST: no duplicate pale separators on layer rows that already use the blue template separators.
   Keep v1.0.21 scale, keep blue lines untouched. */
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
.basic-piece-row,
.armband-row,
.seam-lab-row,
[data-section-panel="shirt"] .kitlab-armband-line,
.kitlab-armband-line,
.template-detail-row.kitlab-armband-line {
  border-bottom-color: transparent !important;
  border-bottom-width: 0 !important;
}
.template-folder-title,
.seams-lab-title,
.kitlab-add-layer-test {
  /* These are the section/block separators; leave them subtle, not per-layer duplicates. */
}

/* v1.0.23 TEST: base-piece color chips use the live chosen piece color even though
   template swatches have a stronger !important background rule elsewhere. */
button[data-open-piece-picker].template-palette-swatch,
.template-palette-wrap button[data-open-piece-picker],
.palette-color-swatch.template-palette-swatch[data-open-piece-picker] {
  background: var(--template-chip-color, #151515) !important;
  background-color: var(--template-chip-color, #151515) !important;
}


/* v1.0.24 TEST: keep the pale row separators only between normal layer rows.
   When a blue separator already splits two blocks, remove the pale separator on the row directly above it so two lines do not appear together. */
[data-section-panel="shirt"] .template-detail-row,
[data-section-panel="shorts"] .template-detail-row,
[data-section-panel="socks"] .template-detail-row,
#collarTemplateDetails .template-detail-row,
.basic-piece-row,
.armband-row,
.seam-lab-row,
[data-section-panel="shirt"] .kitlab-armband-line,
.kitlab-armband-line,
.template-detail-row.kitlab-armband-line {
  border-bottom: 1px solid rgba(255,255,255,0.085) !important;
}
.template-detail-row.before-blue-separator,
.basic-piece-row.before-blue-separator,
.armband-row.before-blue-separator,
.seam-lab-row.before-blue-separator,
.kitlab-armband-line.before-blue-separator,
.template-detail-block.before-blue-separator > .template-detail-row,
.template-folder.before-blue-separator .template-folder-body > .template-detail-block:last-child > .template-detail-row,
.template-folder.before-blue-separator .template-folder-body > .seam-lab-row:last-child {
  border-bottom-color: transparent !important;
  border-bottom-width: 0 !important;
}
/* Native CSS fallback for Chrome: if a block sits immediately before a blue separator, its last visible row must not draw the pale line. */
.template-detail-block:has(+ .module-blue-separator) > .template-detail-row,
.template-folder:has(+ .module-blue-separator) .template-folder-body > .template-detail-block:last-child > .template-detail-row,
.template-folder:has(+ .module-blue-separator) .template-folder-body > .seam-lab-row:last-child {
  border-bottom-color: transparent !important;
  border-bottom-width: 0 !important;
}
/* Keep the blue separator itself unchanged. */
.module-blue-separator {
  background: rgba(58,145,255,.85) !important;
}

/* v1.0.24 TEST: force base-piece swatches to display their live inline color above any generic transparent button rule. */
.template-detail-row .template-palette-wrap > button[data-open-piece-picker].template-palette-swatch,
.basic-piece-row .template-palette-wrap > button[data-open-piece-picker].template-palette-swatch,
button.palette-color-swatch.template-palette-swatch[data-open-piece-picker] {
  background: var(--template-chip-color, #151515) !important;
  background-color: var(--template-chip-color, #151515) !important;
  opacity: 1 !important;
  border: 1px solid rgba(255,255,255,0.55) !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35) !important;
}


/* v1.0.25 TEST: do not draw a pale row separator when the same edge is already closed by the module/folder/card border.
   This removes the double-line effect at the bottom of Brand/Team/Sponsor blocks and template folders. */
[data-section-panel="logos"] .module-body > .part-row:has(+ .part-options:last-child),
[data-section-panel="logos"] .module-body > .part-row:last-child,
[data-section-panel="logos"] .main-module .module-body > .part-row:has(+ .part-options:last-child),
.template-folder-body > .template-detail-block:last-child > .template-detail-row,
.template-folder-body > .template-detail-row:last-child,
.template-folder-body > .seam-lab-row:last-child,
.template-folder-body > .template-detail-row:last-of-type,
#collarTemplateDetails > .template-detail-block:last-child > .template-detail-row,
[data-section-panel="shirt"] .template-details-panel > .template-detail-block:last-child > .template-detail-row,
[data-section-panel="shorts"] .template-details-panel > .template-detail-block:last-child > .template-detail-row,
[data-section-panel="socks"] .template-details-panel > .template-detail-block:last-child > .template-detail-row {
  border-bottom-color: transparent !important;
  border-bottom-width: 0 !important;
}

/* If a row is followed only by an empty/closed options container and then the parent border, do not add an extra horizontal line. */
[data-section-panel="logos"] .module-body > .part-options:last-child,
[data-section-panel="logos"] .module-body > .part-options:empty:last-child {
  border-bottom: 0 !important;
}


/* v1.0.26 TEST: Template gallery folder thumbnails use matching Brand PNGs in white.
   Brand folders get a little breathing room; template thumbnails are +30%, centered as a group. */
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  justify-content: center !important;
  justify-items: center !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-folder-card):not(:has(.template-card)),
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-folder-card):not(:has(.template-card)) {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 122px) !important;
  grid-auto-rows: 132px !important;
  justify-content: center !important;
  align-content: start !important;
  column-gap: 10px !important;
  row-gap: 10px !important;
  padding: 20px 24px 24px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-folder-card):not(:has(.template-card)) .internal-card.template-folder-card,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-folder-card):not(:has(.template-card)) .internal-card.template-folder-card {
  width: 122px !important;
  min-width: 122px !important;
  max-width: 122px !important;
  height: 132px !important;
  min-height: 132px !important;
  max-height: 132px !important;
  display: grid !important;
  grid-template-rows: 98px 24px !important;
  place-items: center !important;
  padding: 5px 4px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-folder-card):not(:has(.template-card)) .internal-card.template-folder-card img,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-folder-card):not(:has(.template-card)) .internal-card.template-folder-card img {
  display: block !important;
  max-width: 92px !important;
  max-height: 74px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 0 !important;
  margin: 0 auto !important;
  filter: brightness(0) invert(1) drop-shadow(0 2px 2px rgba(0,0,0,.35)) !important;
  opacity: .96 !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-folder-card):not(:has(.template-card)) .internal-card.template-folder-card span,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-folder-card):not(:has(.template-card)) .internal-card.template-folder-card span {
  width: 118px !important;
  max-width: 118px !important;
  text-align: center !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  color: rgba(255,255,255,.86) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
  padding: 0 !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-card),
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 146px) !important;
  grid-auto-rows: 385px !important;
  justify-content: center !important;
  align-content: start !important;
  column-gap: 0 !important;
  row-gap: 2px !important;
  padding: 8px 8px 16px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card {
  width: 146px !important;
  min-width: 146px !important;
  max-width: 146px !important;
  height: 385px !important;
  min-height: 385px !important;
  max-height: 385px !important;
  padding: 0 1px 7px !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-rows: 346px 31px !important;
  place-items: center !important;
  gap: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card img {
  display: block !important;
  align-self: center !important;
  justify-self: center !important;
  max-width: 140px !important;
  max-height: 343px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 0 !important;
  margin: 0 auto !important;
  transform: none !important;
  transition: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card:hover img,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card:hover img,
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card:active img,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card:active img {
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid:has(.template-card) .internal-card.template-card span {
  align-self: start !important;
  justify-self: center !important;
  width: 144px !important;
  max-width: 144px !important;
  text-align: center !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  color: rgba(255,255,255,.84) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  position: static !important;
}


/* v1.0.29: clean full-screen template loading overlay */
.template-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  font-family: Inter, Arial, Helvetica, sans-serif;
}
.template-loading-overlay[hidden] {
  display: none !important;
}
.template-loading-box {
  width: min(430px, 64vw);
  transform: translateY(-2vh);
}
.template-loading-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
  font-weight: 900;
  letter-spacing: -0.6px;
  line-height: 1;
}
.template-loading-title {
  font-size: 30px;
  text-transform: uppercase;
}
.template-loading-percent {
  min-width: 72px;
  text-align: right;
  font-size: 28px;
}
.template-loading-bar {
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.58);
}
.template-loading-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width 16ms linear;
}
.template-loading-name {
  margin-top: 10px;
  min-height: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

/* v1.0.32: start screen keeps the original preview background color; only the image is inserted */
.welcome-screen {
  position: absolute;
  inset: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #313658;
  overflow: hidden;
}
.welcome-screen[hidden] {
  display: none !important;
}
.welcome-screen img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(88%, 1500px);
  max-height: min(88%, 860px);
  object-fit: contain;
  image-rendering: auto;
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.62);
}
.canvas-stage.is-welcome-hidden {
  visibility: hidden;
}


/* v1.0.36: Pattern gallery uses Team modal sizing/navigation, with compact PNG thumbs like template cards. */
#brandGalleryModal[data-gallery-source="pattern"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="pattern"] .brand-gallery-window {
  width: min(1180px, calc(100vw - 44px)) !important;
  max-width: min(1180px, calc(100vw - 44px)) !important;
  height: min(720px, calc(100vh - 60px)) !important;
  max-height: min(720px, calc(100vh - 60px)) !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .brand-gallery-header,
.modal-backdrop[data-gallery-source="pattern"] .brand-gallery-header {
  grid-template-columns: auto minmax(0, 1fr) auto auto !important;
  align-items: center !important;
}
#brandGalleryModal[data-gallery-source="pattern"][data-gallery-back="1"] .brand-gallery-header,
.modal-backdrop[data-gallery-source="pattern"][data-gallery-back="1"] .brand-gallery-header {
  grid-template-columns: auto 26px minmax(0, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="pattern"] #brandGallerySearch {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="pattern"] .brand-gallery-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-content: flex-start !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 14px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .pattern-folder-card,
.modal-backdrop[data-gallery-source="pattern"] .pattern-folder-card {
  width: 118px !important;
  min-width: 118px !important;
  height: 138px !important;
  min-height: 138px !important;
  display: grid !important;
  grid-template-rows: 92px 32px !important;
  place-items: center !important;
  padding: 7px !important;
  gap: 4px !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .pattern-folder-card img,
.modal-backdrop[data-gallery-source="pattern"] .pattern-folder-card img {
  max-width: 86px !important;
  max-height: 86px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  filter: none !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .pattern-png-card,
.modal-backdrop[data-gallery-source="pattern"] .pattern-png-card {
  width: 260px !important;
  min-width: 260px !important;
  height: 208px !important;
  min-height: 208px !important;
  padding: 4px 4px 8px !important;
  gap: 4px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .pattern-png-card img,
.modal-backdrop[data-gallery-source="pattern"] .pattern-png-card img {
  max-width: 250px !important;
  max-height: 164px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .pattern-png-card:hover img,
.modal-backdrop[data-gallery-source="pattern"] .pattern-png-card:hover img {
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .pattern-png-card span,
#brandGalleryModal[data-gallery-source="pattern"] .pattern-folder-card span,
.modal-backdrop[data-gallery-source="pattern"] .pattern-png-card span,
.modal-backdrop[data-gallery-source="pattern"] .pattern-folder-card span {
  width: 100% !important;
  text-align: center !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  color: rgba(255,255,255,.84) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* v1.0.37: Pattern button + Pattern gallery fixes only. */
.kitlab-add-layer-btn[data-open-pattern-gallery="1"] {
  cursor: pointer !important;
}
.kitlab-add-layer-btn[data-open-pattern-gallery="1"]:hover {
  background: #ff2020 !important;
  border-color: #ff2020 !important;
  color: #ffffff !important;
}

#brandGalleryModal[data-gallery-source="pattern"] .pattern-folder-card,
.modal-backdrop[data-gallery-source="pattern"] .pattern-folder-card {
  width: 94px !important;
  min-width: 94px !important;
  height: 86px !important;
  min-height: 86px !important;
  display: grid !important;
  grid-template-rows: 60px 20px !important;
  place-items: center !important;
  padding: 0 !important;
  gap: 2px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .pattern-folder-card img,
.modal-backdrop[data-gallery-source="pattern"] .pattern-folder-card img {
  max-width: 90px !important;
  max-height: 58px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  filter: none !important;
}
#brandGalleryModal[data-gallery-source="pattern"] .pattern-folder-card span,
.modal-backdrop[data-gallery-source="pattern"] .pattern-folder-card span {
  width: 94px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
}

/* v1.0.41: User Pattern rows behave like normal detail rows: eye / color / name / up / down / X. */
.template-user-pattern-row {
  grid-template-columns: 22px 21px minmax(0,1fr) 25px 25px 25px !important;
  column-gap: 5px !important;
}
.template-user-pattern-row .template-delete-btn {
  display: grid !important;
  color: #ffffff !important;
  font-size: 16px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
}
.template-user-pattern-row .template-detail-name {
  min-width: 0 !important;
}
.template-user-pattern-block .template-picker-popover {
  z-index: 80 !important;
}


/* v1.0.46: Pattern layer row: eye / color / name / up / down / X + zone dropdown. */
.template-user-pattern-row {
  grid-template-columns: 22px 21px minmax(0,1fr) 25px 25px 25px !important;
  column-gap: 5px !important;
}
.template-user-pattern-row .template-delete-btn,
.template-user-pattern-row .template-pattern-delete-btn {
  display: grid !important;
  color: #ff304b !important;
  font-size: 19px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 6px rgba(255, 48, 75, 0.25) !important;
}
.template-user-pattern-row .template-delete-btn:hover,
.template-user-pattern-row .template-pattern-delete-btn:hover {
  color: #ffffff !important;
  background: #e21d3b !important;
  border-color: #e21d3b !important;
}
.template-user-pattern-row .pattern-layer-name {
  cursor: pointer !important;
}
.pattern-zone-dropdown {
  margin: 3px 0 5px 48px;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: rgba(0,0,0,.16);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pattern-zone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  color: #ffffff;
  font-size: 10.5px;
  line-height: 1.05;
}
.pattern-zone-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pattern-zone-switch {
  width: 28px !important;
  min-width: 28px !important;
  height: 15px !important;
  padding: 0 !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.16) !important;
  position: relative !important;
  cursor: pointer !important;
}
.pattern-zone-switch span {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  left: 2px;
  top: 1px;
  background: #ffffff;
  transition: left .12s ease;
}
.pattern-zone-switch.is-on {
  background: #db2437 !important;
  border-color: #ff5265 !important;
}
.pattern-zone-switch.is-on span {
  left: 13px;
}


/* v1.0.51: force the user Pattern delete X to be visible as its own red button.
   Do not depend on the generic template-delete-btn rules, because normal details hide X by default. */
.template-user-pattern-row {
  display: grid !important;
  grid-template-columns: 22px 22px minmax(0,1fr) 22px 22px 22px !important;
  align-items: center !important;
  column-gap: 5px !important;
}
.template-user-pattern-row .pattern-delete-x-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #ff304b !important;
  font-size: 17px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  text-shadow: 0 0 6px rgba(255, 48, 75, 0.35) !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.template-user-pattern-row .pattern-delete-x-btn:hover {
  color: #ffffff !important;
  background: #e21d3b !important;
  border-radius: 4px !important;
}
.template-user-pattern-row .pattern-layer-name {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}


/* v1.0.53: Pattern rows can be restored from saved settings without the old isUserPattern flag.
   Force any dedicated Pattern row layout to reserve the last red X column. */
.template-tech-folder[data-template-tech-folder="Pattern"] .template-user-pattern-row,
.template-tech-folder[data-template-tech-folder="pattern"] .template-user-pattern-row {
  display: grid !important;
  grid-template-columns: 22px 22px minmax(0,1fr) 22px 22px 24px !important;
  align-items: center !important;
  column-gap: 5px !important;
}
.template-tech-folder[data-template-tech-folder="Pattern"] .pattern-delete-x-btn,
.template-tech-folder[data-template-tech-folder="pattern"] .pattern-delete-x-btn {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: #ff304b !important;
  font-weight: 900 !important;
}


/* v1.0.53: final hard lock for Pattern delete X.
   Some saved Pattern rows can still be painted by the normal template row route;
   reserve a real sixth column and force the red X inside the visible width. */
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Pattern"] .template-detail-row.template-user-pattern-row,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="pattern"] .template-detail-row.template-user-pattern-row {
  display: grid !important;
  grid-template-columns: 18px 24px minmax(0, 1fr) 17px 17px 18px !important;
  column-gap: 3px !important;
  overflow: visible !important;
  align-items: center !important;
  padding-right: 3px !important;
}
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Pattern"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="pattern"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #ff304b !important;
  font-size: 16px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-shadow: 0 0 5px rgba(255, 48, 75, .45) !important;
}
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Pattern"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn:hover,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="pattern"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn:hover {
  color: #ffffff !important;
  background: #e21d3b !important;
  border-radius: 4px !important;
}


/* v1.0.54: replace top VillaPilla red profile button with plain KitLab6 logo image. */
.kitlab-header-logo-wrap {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.kitlab-header-logo {
  width: 190px !important;
  height: auto !important;
  max-height: 28px !important;
  object-fit: contain !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}


/* v1.0.55: gold KitLab6 accent from logo #F0B515.
   Keep disabled eye icons and X/delete buttons red. */
:root {
  --kitlab-gold: #F0B515;
}
body,
body.profile-villapilla-mode {
  --selected: var(--kitlab-gold) !important;
}
.rail-btn.active {
  color: var(--kitlab-gold) !important;
}
body.profile-villapilla-mode .module-tabbar .rail-btn.active .rail-icon-red {
  display: none !important;
}
body.profile-villapilla-mode .module-tabbar .rail-btn.active .rail-icon-white {
  display: block !important;
  filter: brightness(0) saturate(100%) invert(72%) sepia(85%) saturate(778%) hue-rotate(357deg) brightness(99%) contrast(91%) !important;
}
.module-blue-separator {
  background: var(--kitlab-gold) !important;
}
.template-inline-rename:focus {
  border-color: rgba(240,181,21,0.92) !important;
  box-shadow: 0 0 0 1px rgba(240,181,21,0.35) !important;
}
.kitlab-add-layer-btn[data-open-pattern-gallery="1"]:hover,
.kitlab-add-layer-btn[data-open-base-design-gallery="1"]:hover {
  background: var(--kitlab-gold) !important;
  border-color: var(--kitlab-gold) !important;
  color: #101010 !important;
}
/* Explicitly preserve red danger/delete controls. */
.template-user-pattern-row .pattern-delete-x-btn,
.template-user-pattern-row .template-delete-btn,
.template-user-pattern-row .template-pattern-delete-btn,
.template-delete-btn,
.pattern-delete-x-btn {
  color: #ff304b !important;
}
.template-user-pattern-row .pattern-delete-x-btn:hover,
.template-user-pattern-row .template-delete-btn:hover,
.template-user-pattern-row .template-pattern-delete-btn:hover,
.template-delete-btn:hover,
.pattern-delete-x-btn:hover {
  color: #ffffff !important;
  background: #e21d3b !important;
  border-color: #e21d3b !important;
}

/* v1.0.56: SEAMS folders open collapsed by default; folder rows can scroll horizontally when controls overflow. */
.template-folder-body,
#collarTemplateDetails .template-folder-body,
[data-section-panel="shirt"] .template-folder-body,
[data-section-panel="shorts"] .template-folder-body,
[data-section-panel="socks"] .template-folder-body {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(240,181,21,.85) rgba(255,255,255,.08) !important;
  padding-bottom: 7px !important;
}
.template-folder-body::-webkit-scrollbar,
#collarTemplateDetails .template-folder-body::-webkit-scrollbar,
[data-section-panel="shirt"] .template-folder-body::-webkit-scrollbar,
[data-section-panel="shorts"] .template-folder-body::-webkit-scrollbar,
[data-section-panel="socks"] .template-folder-body::-webkit-scrollbar {
  height: 6px !important;
}
.template-folder-body::-webkit-scrollbar-track,
#collarTemplateDetails .template-folder-body::-webkit-scrollbar-track,
[data-section-panel="shirt"] .template-folder-body::-webkit-scrollbar-track,
[data-section-panel="shorts"] .template-folder-body::-webkit-scrollbar-track,
[data-section-panel="socks"] .template-folder-body::-webkit-scrollbar-track {
  background: rgba(255,255,255,.08) !important;
  border-radius: 999px !important;
}
.template-folder-body::-webkit-scrollbar-thumb,
#collarTemplateDetails .template-folder-body::-webkit-scrollbar-thumb,
[data-section-panel="shirt"] .template-folder-body::-webkit-scrollbar-thumb,
[data-section-panel="shorts"] .template-folder-body::-webkit-scrollbar-thumb,
[data-section-panel="socks"] .template-folder-body::-webkit-scrollbar-thumb {
  background: rgba(240,181,21,.85) !important;
  border-radius: 999px !important;
}
.template-folder-body > .template-detail-block,
.template-folder-body > .template-detail-row,
.template-folder-body > .seam-lab-row {
  min-width: max-content !important;
}
.seams-lab-folder .template-folder-body > .seam-lab-row,
.collar-seams-lab-folder .template-folder-body > .seam-lab-row {
  min-width: 365px !important;
}


/* v1.0.57: correction from v1.0.56.
   No horizontal scrollbars in layer blocks: every row must fit inside the block.
   If a block has too many rows, use a vertical scrollbar inside that block. */
.template-folder-body,
#collarTemplateDetails .template-folder-body,
[data-section-panel="shirt"] .template-folder-body,
[data-section-panel="shorts"] .template-folder-body,
[data-section-panel="socks"] .template-folder-body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-height: min(52vh, 360px) !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(240,181,21,.85) rgba(255,255,255,.08) !important;
  padding-bottom: 4px !important;
  box-sizing: border-box !important;
}
.template-folder-body::-webkit-scrollbar,
#collarTemplateDetails .template-folder-body::-webkit-scrollbar,
[data-section-panel="shirt"] .template-folder-body::-webkit-scrollbar,
[data-section-panel="shorts"] .template-folder-body::-webkit-scrollbar,
[data-section-panel="socks"] .template-folder-body::-webkit-scrollbar {
  width: 6px !important;
  height: 0 !important;
}
.template-folder-body::-webkit-scrollbar-track,
#collarTemplateDetails .template-folder-body::-webkit-scrollbar-track,
[data-section-panel="shirt"] .template-folder-body::-webkit-scrollbar-track,
[data-section-panel="shorts"] .template-folder-body::-webkit-scrollbar-track,
[data-section-panel="socks"] .template-folder-body::-webkit-scrollbar-track {
  background: rgba(255,255,255,.08) !important;
  border-radius: 999px !important;
}
.template-folder-body::-webkit-scrollbar-thumb,
#collarTemplateDetails .template-folder-body::-webkit-scrollbar-thumb,
[data-section-panel="shirt"] .template-folder-body::-webkit-scrollbar-thumb,
[data-section-panel="shorts"] .template-folder-body::-webkit-scrollbar-thumb,
[data-section-panel="socks"] .template-folder-body::-webkit-scrollbar-thumb {
  background: rgba(240,181,21,.85) !important;
  border-radius: 999px !important;
}
.template-folder-body > .template-detail-block,
.template-folder-body > .template-detail-row,
.template-folder-body > .seam-lab-row,
.seams-lab-folder .template-folder-body > .seam-lab-row,
.collar-seams-lab-folder .template-folder-body > .seam-lab-row {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.template-detail-row,
.template-tech-row,
.seam-lab-row,
.logo-row,
.logo-layer-row {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.template-detail-row select,
.template-tech-row select,
.seam-lab-row select,
.template-detail-row input[type="range"],
.seam-lab-row input[type="range"] {
  min-width: 0 !important;
  max-width: 100% !important;
}


/* v1.0.58: correction from v1.0.57.
   No scrollbars inside every small layer folder. Rows must fit the sidebar width.
   The vertical scrollbar belongs to the whole active module panel: Settings, Logos,
   Shirt, Shorts and Socks. Module icons/header stay visible while the module body scrolls. */
.sidebar {
  height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}
.kitlab-header-logo-wrap,
.module-tabbar {
  flex: 0 0 auto !important;
}
.side-section {
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding-right: 4px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(240,181,21,.85) rgba(255,255,255,.08) !important;
  overscroll-behavior: contain !important;
}
.side-section.active {
  flex: 1 1 auto !important;
  display: block !important;
}
.side-section::-webkit-scrollbar {
  width: 6px !important;
  height: 0 !important;
}
.side-section::-webkit-scrollbar-track {
  background: rgba(255,255,255,.08) !important;
  border-radius: 999px !important;
}
.side-section::-webkit-scrollbar-thumb {
  background: rgba(240,181,21,.85) !important;
  border-radius: 999px !important;
}
.side-section::-webkit-scrollbar-thumb:hover {
  background: rgba(240,181,21,1) !important;
}

/* Remove the v1.0.56/v1.0.57 folder-level scroll behavior. */
.template-folder-body,
#collarTemplateDetails .template-folder-body,
[data-section-panel="shirt"] .template-folder-body,
[data-section-panel="shorts"] .template-folder-body,
[data-section-panel="socks"] .template-folder-body {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  max-height: none !important;
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 4px !important;
  scrollbar-width: auto !important;
}
.template-folder-body::-webkit-scrollbar,
#collarTemplateDetails .template-folder-body::-webkit-scrollbar,
[data-section-panel="shirt"] .template-folder-body::-webkit-scrollbar,
[data-section-panel="shorts"] .template-folder-body::-webkit-scrollbar,
[data-section-panel="socks"] .template-folder-body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* Keep rows inside the sidebar width; no horizontal scrolling. */
.main-module,
.panel,
.template-folder,
.template-folder-body,
.template-detail-row,
.template-tech-row,
.seam-lab-row,
.logo-row,
.logo-layer-row,
.part-row,
.settings-line {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.template-detail-name,
.template-line-name,
.seam-lab-name,
.part-file,
.settings-value,
.settings-texture-name {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}


/* v1.0.68: Template thumbnails centered in the modal and 20% bigger.
   Keep the same spacing/tight layout style, only adjust final template gallery view. */
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 134px) !important;
  grid-auto-rows: 355px !important;
  justify-content: center !important;
  justify-items: center !important;
  align-content: start !important;
  column-gap: 0 !important;
  row-gap: 2px !important;
  padding: 8px 8px 16px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card {
  width: 134px !important;
  min-width: 134px !important;
  max-width: 134px !important;
  height: 355px !important;
  min-height: 355px !important;
  max-height: 355px !important;
  padding: 0 1px 7px !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-rows: 319px 28px !important;
  align-items: center !important;
  justify-items: center !important;
  place-items: center !important;
  gap: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card img {
  display: block !important;
  align-self: center !important;
  justify-self: center !important;
  max-width: 130px !important;
  max-height: 317px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 0 !important;
  margin: 0 auto !important;
  transform: none !important;
  transition: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card span {
  align-self: start !important;
  justify-self: center !important;
  width: 132px !important;
  max-width: 132px !important;
  text-align: center !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
}


/* v1.0.70: Template gallery final: cards centered as a group, 20% larger, no left-start layout. */
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-content: flex-start !important;
  align-items: flex-start !important;
  gap: 2px 0 !important;
  padding: 10px 18px 18px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card {
  flex: 0 0 134px !important;
  width: 134px !important;
  min-width: 134px !important;
  max-width: 134px !important;
  height: 356px !important;
  min-height: 356px !important;
  max-height: 356px !important;
  display: grid !important;
  grid-template-rows: 320px 28px !important;
  place-items: center !important;
  padding: 0 1px 7px !important;
  margin: 0 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card img {
  max-width: 130px !important;
  max-height: 316px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  justify-self: center !important;
  align-self: center !important;
  margin: 0 auto !important;
  padding: 0 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card span {
  width: 132px !important;
  max-width: 132px !important;
  text-align: center !important;
  justify-self: center !important;
  align-self: start !important;
}


/* v1.0.71: Template gallery hard-center fix.
   Cards are centered as a group inside the modal, never starting from the left edge. */
#internalBrandGrid.template-gallery-active {
  display: block !important;
  padding: 10px 18px 18px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  text-align: initial !important;
}
#internalBrandGrid.template-gallery-active .template-gallery-center-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-content: flex-start !important;
  align-items: flex-start !important;
  gap: 2px 0 !important;
}
#internalBrandGrid.template-gallery-active .template-gallery-center-wrap > .internal-card.template-card,
#internalBrandGrid.template-gallery-active .template-gallery-center-wrap > .internal-card.template-folder-card {
  flex: 0 0 134px !important;
  width: 134px !important;
  min-width: 134px !important;
  max-width: 134px !important;
  height: 356px !important;
  min-height: 356px !important;
  max-height: 356px !important;
  display: grid !important;
  grid-template-rows: 320px 28px !important;
  place-items: center !important;
  padding: 0 1px 7px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#internalBrandGrid.template-gallery-active .template-gallery-center-wrap > .internal-card.template-card img,
#internalBrandGrid.template-gallery-active .template-gallery-center-wrap > .internal-card.template-folder-card img {
  max-width: 130px !important;
  max-height: 316px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  justify-self: center !important;
  align-self: center !important;
  margin: 0 auto !important;
  padding: 0 !important;
}
#internalBrandGrid.template-gallery-active .template-gallery-center-wrap > .internal-card.template-card span,
#internalBrandGrid.template-gallery-active .template-gallery-center-wrap > .internal-card.template-folder-card span {
  width: 132px !important;
  max-width: 132px !important;
  text-align: center !important;
  justify-self: center !important;
  align-self: start !important;
}


/* v1.0.72: Template gallery horizontal centered flow.
   Same behavior philosophy as Pattern gallery: horizontal rows, centered as a group.
   Template PNG cards are 20% bigger; brand/folder cards stay compact. */
#internalBrandGrid.template-gallery-active,
#brandGalleryModal[data-gallery-source="template"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="template"] .brand-gallery-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-content: flex-start !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 14px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  text-align: initial !important;
}
#internalBrandGrid.template-gallery-active .template-gallery-center-wrap {
  display: contents !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card,
#internalBrandGrid.template-gallery-active .internal-card.template-folder-card {
  flex: 0 0 94px !important;
  width: 94px !important;
  min-width: 94px !important;
  max-width: 94px !important;
  height: 86px !important;
  min-height: 86px !important;
  max-height: 86px !important;
  display: grid !important;
  grid-template-rows: 60px 20px !important;
  place-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 2px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  overflow: hidden !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card img,
#internalBrandGrid.template-gallery-active .internal-card.template-folder-card img {
  max-width: 90px !important;
  max-height: 58px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 auto !important;
  padding: 0 !important;
  transform: none !important;
  transition: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card span,
#internalBrandGrid.template-gallery-active .internal-card.template-folder-card span {
  width: 94px !important;
  max-width: 94px !important;
  text-align: center !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  color: rgba(255,255,255,.84) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
  padding: 0 !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card,
#internalBrandGrid.template-gallery-active .internal-card.template-card {
  flex: 0 0 162px !important;
  width: 162px !important;
  min-width: 162px !important;
  max-width: 162px !important;
  height: 430px !important;
  min-height: 430px !important;
  max-height: 430px !important;
  display: grid !important;
  grid-template-rows: 390px 28px !important;
  place-items: center !important;
  padding: 0 1px 7px !important;
  margin: 0 !important;
  gap: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  overflow: hidden !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card img,
#internalBrandGrid.template-gallery-active .internal-card.template-card img {
  max-width: 156px !important;
  max-height: 380px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  justify-self: center !important;
  align-self: center !important;
  margin: 0 auto !important;
  padding: 0 !important;
  transform: none !important;
  transition: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card:hover img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card:hover img,
#internalBrandGrid.template-gallery-active .internal-card.template-card:hover img,
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-folder-card:hover img,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-folder-card:hover img,
#internalBrandGrid.template-gallery-active .internal-card.template-folder-card:hover img {
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="template"] .internal-card.template-card span,
.modal-backdrop[data-gallery-source="template"] .internal-card.template-card span,
#internalBrandGrid.template-gallery-active .internal-card.template-card span {
  width: 160px !important;
  max-width: 160px !important;
  text-align: center !important;
  justify-self: center !important;
  align-self: start !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  color: rgba(255,255,255,.84) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
}


/* v1.1.11: clean UI cursors.
   Do not show the text/I-beam cursor on labels, rows, layer names or percent labels.
   Text cursor is allowed only when a real input/rename field is open. */
.app-shell,
.sidebar,
.workspace,
.panel,
.side-section,
.main-module,
.module-body,
.section-heading,
.settings-main-panel,
.settings-line,
.template-settings-line,
.settings-label,
.settings-value,
.settings-texture-name,
.settings-opacity-value,
.template-folder-title,
.template-folder-body,
.template-detail-row,
.template-tech-row,
.template-detail-name,
.template-line-name,
.template-opacity-value,
.seam-lab-row,
.seam-lab-name,
.seam-lab-opacity-value,
.basic-piece-row,
.basic-piece-name,
.logo-row,
.logo-layer-row,
.logo-layer-name,
.part-row,
.part-file,
.brand-toggle,
.brand-row,
.brand-name,
#selectedCollarName,
.project-panel,
.project-panel *:not(input):not(textarea):not([contenteditable="true"]) {
  cursor: default !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* Values/names that are editable only after double-click must not look like inputs while closed. */
.template-detail-name[data-template-rename],
.template-opacity-value,
.seam-lab-opacity-value,
.settings-opacity-value,
[data-seam-opacity-value],
[data-template-opacity-value] {
  cursor: default !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* Real editable fields keep the text cursor. */
input[type="text"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="password"],
input:not([type]),
textarea,
[contenteditable="true"],
.template-inline-rename,
.template-opacity-inline-number,
.seam-opacity-inline-number,
.logo-inline-number,
.inline-number-input {
  cursor: text !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* Sliders, selects, buttons and gallery cards should feel clickable, not writable. */
button,
select,
input[type="range"],
input[type="checkbox"],
input[type="color"],
.rail-btn,
.settings-icon-btn,
.visibility-icon-btn,
.template-color,
.template-palette-swatch,
.palette-color-swatch,
.internal-card,
.brand-gallery-header button,
.kitlab-add-layer-btn,
.project-panel-actions button,
.project-kit-row,
[data-open-internal-gallery],
[data-open-piece-picker],
[data-duplicate],
[data-delete],
[data-template-up],
[data-template-down],
[data-template-delete],
[data-seam-invert] {
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* Keep disabled controls honest. */
button:disabled,
select:disabled,
input:disabled,
[aria-disabled="true"] {
  cursor: not-allowed !important;
}

/* v1.1.11: Settings action buttons use the same hover language as the right project buttons. */
.settings-actions-clean button {
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border-radius: 9px !important;
  transition: border-color .12s ease, background .12s ease, color .12s ease !important;
}
.settings-actions-clean button:hover {
  border-color: rgba(240, 181, 21, 0.78) !important;
  background: rgba(240, 181, 21, 0.12) !important;
  color: rgba(255, 255, 255, 0.98) !important;
}
.settings-actions-clean button:active {
  border-color: rgba(240, 181, 21, 0.95) !important;
  background: rgba(240, 181, 21, 0.18) !important;
}


/* v1.1.19: Base Design gallery must match Pattern gallery size/cards exactly. */
#brandGalleryModal[data-gallery-source="base_design"] .brand-gallery-window,
.modal-backdrop[data-gallery-source="base_design"] .brand-gallery-window {
  width: min(1180px, calc(100vw - 44px)) !important;
  max-width: min(1180px, calc(100vw - 44px)) !important;
  height: min(720px, calc(100vh - 60px)) !important;
  max-height: min(720px, calc(100vh - 60px)) !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .brand-gallery-header,
.modal-backdrop[data-gallery-source="base_design"] .brand-gallery-header {
  grid-template-columns: auto minmax(0, 1fr) auto auto !important;
  align-items: center !important;
}
#brandGalleryModal[data-gallery-source="base_design"][data-gallery-back="1"] .brand-gallery-header,
.modal-backdrop[data-gallery-source="base_design"][data-gallery-back="1"] .brand-gallery-header {
  grid-template-columns: auto 26px minmax(0, 1fr) auto auto !important;
}
#brandGalleryModal[data-gallery-source="base_design"] #brandGallerySearch {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .brand-gallery-grid,
.modal-backdrop[data-gallery-source="base_design"] .brand-gallery-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-content: flex-start !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 14px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .pattern-folder-card,
.modal-backdrop[data-gallery-source="base_design"] .pattern-folder-card {
  width: 94px !important;
  min-width: 94px !important;
  height: 86px !important;
  min-height: 86px !important;
  display: grid !important;
  grid-template-rows: 60px 20px !important;
  place-items: center !important;
  padding: 0 !important;
  gap: 2px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .pattern-folder-card img,
.modal-backdrop[data-gallery-source="base_design"] .pattern-folder-card img {
  max-width: 90px !important;
  max-height: 58px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  filter: none !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .pattern-folder-card span,
.modal-backdrop[data-gallery-source="base_design"] .pattern-folder-card span {
  width: 94px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .pattern-png-card,
.modal-backdrop[data-gallery-source="base_design"] .pattern-png-card {
  width: 260px !important;
  min-width: 260px !important;
  height: 208px !important;
  min-height: 208px !important;
  padding: 4px 4px 8px !important;
  gap: 4px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .pattern-png-card img,
.modal-backdrop[data-gallery-source="base_design"] .pattern-png-card img {
  max-width: 250px !important;
  max-height: 164px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .pattern-png-card:hover img,
.modal-backdrop[data-gallery-source="base_design"] .pattern-png-card:hover img {
  transform: none !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .pattern-png-card span,
#brandGalleryModal[data-gallery-source="base_design"] .pattern-folder-card span,
.modal-backdrop[data-gallery-source="base_design"] .pattern-png-card span,
.modal-backdrop[data-gallery-source="base_design"] .pattern-folder-card span {
  width: 100% !important;
  text-align: center !important;
  color: rgba(255,255,255,.84) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#brandGalleryModal[data-gallery-source="base_design"] .pattern-png-card span,
.modal-backdrop[data-gallery-source="base_design"] .pattern-png-card span {
  font-size: 12px !important;
  line-height: 1.15 !important;
}


/* v1.1.20: Base Design button-added layers must behave exactly like button-added Pattern layers.
   Keep the red delete X visible after Up/Down inside both Pattern and Base Design folders. */
.template-tech-folder[data-template-tech-folder="Base Design"] .template-user-pattern-row,
.template-tech-folder[data-template-tech-folder="base design"] .template-user-pattern-row,
.template-tech-folder[data-template-tech-folder="Base desing"] .template-user-pattern-row,
.template-tech-folder[data-template-tech-folder="base desing"] .template-user-pattern-row,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Base Design"] .template-detail-row.template-user-pattern-row,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="base design"] .template-detail-row.template-user-pattern-row,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Base desing"] .template-detail-row.template-user-pattern-row,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="base desing"] .template-detail-row.template-user-pattern-row {
  display: grid !important;
  grid-template-columns: 18px 24px minmax(0, 1fr) 17px 17px 18px !important;
  column-gap: 3px !important;
  overflow: visible !important;
  align-items: center !important;
  padding-right: 3px !important;
}
.template-tech-folder[data-template-tech-folder="Base Design"] .pattern-delete-x-btn,
.template-tech-folder[data-template-tech-folder="base design"] .pattern-delete-x-btn,
.template-tech-folder[data-template-tech-folder="Base desing"] .pattern-delete-x-btn,
.template-tech-folder[data-template-tech-folder="base desing"] .pattern-delete-x-btn,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Base Design"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="base design"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Base desing"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="base desing"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #ff304b !important;
  font-size: 16px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-shadow: 0 0 5px rgba(255, 48, 75, .45) !important;
}
.template-tech-folder[data-template-tech-folder="Base Design"] .pattern-delete-x-btn:hover,
.template-tech-folder[data-template-tech-folder="base design"] .pattern-delete-x-btn:hover,
.template-tech-folder[data-template-tech-folder="Base desing"] .pattern-delete-x-btn:hover,
.template-tech-folder[data-template-tech-folder="base desing"] .pattern-delete-x-btn:hover,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Base Design"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn:hover,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="base design"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn:hover,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="Base desing"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn:hover,
[data-section-panel="shirt"] .template-tech-folder[data-template-tech-folder="base desing"] .template-detail-row.template-user-pattern-row .pattern-delete-x-btn:hover {
  color: #ffffff !important;
  background: #e21d3b !important;
  border-radius: 4px !important;
}

/* v1.1.21: added short Adidas.png to Adidas 2026 and Adidas GK 2026 templates. */


/* v1.3.216 public beta: requested hidden UI only. */
.texture-main-line,
#textureUpload,
#textureLayerList,
#saveTemplateSettingsBtn,
#exportTemplateSettingsBtn {
  display: none !important;
}
