.pt { display: grid; grid-template-columns: 1fr 340px; height: calc(100% - 64px); }
/* always a light checkerboard, so dark thread stays visible in dark mode too */
.pt-stage { --check-a: #f4f4f2; --check-b: #e4e4e0;
  position: relative; overflow: hidden; display: grid; place-items: center; padding: 24px;
  background-color: var(--check-a);
  background-image: linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%),
                    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px; }
.pt-stage.solid { background-image: none; }
.pt-drop { width: min(560px, 100%); }
#preview { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
/* the patch preview fits the stage both ways (the grid cell is the stage's own size, not the image's) */
.pt-fit { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.pt-fit > #preview, .pt-fit > .pt-drop { grid-area: 1 / 1; }
.pt-fit > #preview { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.pt-status { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--panel) 80%, transparent); padding: 3px 8px; border-radius: 6px; }
.pt-status:empty { display: none; }

.pt-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-styles button { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 10px; }
.pt-styles button span { font-size: 11.5px; color: var(--muted); }
.pt-styles button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.pt-colors { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pt-colors li { display: grid; grid-template-columns: 30px 1fr 128px; gap: 8px; align-items: center; }
.pt-colors input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.pt-colors .name { font: 12px ui-monospace, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-colors .name small { display: block; font-family: -apple-system, sans-serif; color: var(--muted); font-size: 11px; }
.pt-colors li.hidden .name { color: var(--muted); }
.pt-colors select { width: 100%; }
/* thread number under an embroidered colour */
.pt-colors .pt-thread { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; margin: -2px 0 2px 38px; font-size: 12px; color: var(--muted); min-width: 0; }
.pt-colors .pt-thread input { width: 84px; flex: none; font: 12px ui-monospace, Menlo, monospace; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.pt-colors .pt-thread input.bad { border-color: var(--danger); }
.pt-colors .pt-thread .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pt-colors .pt-thread .tn b { color: var(--ink); font-weight: 600; }
.pt-colors .pt-thread button { flex: none; font-size: 11.5px; padding: 2px 7px; }

#leatherette { flex: 1; min-width: 0; }
.pt-sheet-chip { width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--line) center / cover; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.pt-leathers { display: flex; gap: 5px; flex-wrap: wrap; }
.pt-leathers button { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--line); }
.pt-leathers button.on { border-color: var(--accent); }
#bgColor, #borderColor, #leatherColor { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.slider { grid-template-columns: 92px 1fr 44px; }

/* confirm before another logo replaces the current one */

@media (max-width: 860px) {
  .pt { grid-template-columns: 1fr; grid-template-rows: 60vh auto; height: auto; }
  .pt-panel { border-left: 0; border-top: 1px solid var(--line); }
  .top .file-info { display: none; }
}
