/* The pattern tool (inc/pattern-tool.inc.php): the samples, the pattern, and
   the colours it uses. The layout is pt-ui.css's, the phone editor
   pt-app.css's, the sliders and buttons take pt-theme.css's look. */

/* ── Empty state: the samples ─────────────────────────────────────────── */
.pattern-editor .sample-thumbnails-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  /* Without a width it shrinks to half the box (left: 50%). */
  width: 90%;
}
/* By id: in the phone editor the photo box is out of the card. */
#pn-empty.hidden { display: none; }
.pattern-editor .sample-thumbnails { display: flex; justify-content: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.pattern-editor .sample-thumbnail {
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
  width: 110px;
  height: 110px;
  padding: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pattern-editor .sample-thumbnail:hover,
.pattern-editor .sample-thumbnail:focus-visible { border-color: var(--pt-accent, #0f70e6); box-shadow: 0 4px 12px rgba(15, 112, 230, 0.25); }
.pattern-editor .sample-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767px) { .pattern-editor .sample-thumbnail { width: 84px; height: 84px; } }

/* ── The pattern ──────────────────────────────────────────────────────── */
#pn-viewport { position: relative; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
#pn-canvas { display: block; max-width: 100%; max-height: 100%; border-radius: 4px; background: #fff; }
#pn-canvas[hidden] { display: none; }
/* Pixel art scaled on screen stays square-edged. */
#pn-canvas.pn-pixel { image-rendering: pixelated; }
#pn-compare.active { color: #fff; background: var(--cb-ink, #16181d); border-color: var(--cb-ink, #16181d); }

.pn-link {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 0.8rem;
  color: var(--pt-accent, #0f70e6);
  cursor: pointer;
}
.pn-link:disabled { color: #9aa1aa; cursor: default; }
.pn-opts[hidden], .pn-slider[hidden], .pn-choice[hidden], #pn-opts .form-check[hidden] { display: none; }
/* Choices of three or six: words wrap rather than overflow. */
#pn-mode.pt-cseg, #pn-palette.pt-cseg { flex-wrap: wrap; }
#pn-mode.pt-cseg button, #pn-palette.pt-cseg button { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
#pn-palette.pt-cseg button { flex: 1 1 30%; }

/* ── What it comes to, and the colours ────────────────────────────────── */
.pn-key { padding-top: 10px; border-top: 1px solid var(--cb-line, #e4e1dc); }
.pn-facts { font-size: 13px; line-height: 1.45; color: var(--cb-muted, #626973); margin-bottom: 8px; }
.pn-facts .pn-fact-main { color: var(--cb-ink, #16181d); font-weight: 700; }
.pn-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px 8px; }
.pn-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--cb-text, #3d434b); font-variant-numeric: tabular-nums; }
.pn-chip i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(22, 24, 29, 0.18);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.pn-chip bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Phone editor ─────────────────────────────────────────────────────── */
/* The three kinds in the bottom bar. */
.pt-app-panels #pn-mode-row { margin: 0 !important; padding: 6px 4px; }
/* Options in the bottom bar: the palette, the tick boxes and the colours. */
.pt-app-panels #pn-opts { padding: 4px 4px 2px; max-height: 40vh; overflow-y: auto; }
.pt-app-panels #pn-opts .form-label { color: var(--pt-app-fg); font-size: 13px; margin-bottom: 4px; }
.pt-app-panels #pn-opts .form-check-label { color: var(--pt-app-fg); }
.pt-app-panels .pn-facts { color: var(--pt-app-fg); opacity: 0.85; }
.pt-app-panels .pn-facts .pn-fact-main { color: var(--pt-app-fg); }
.pt-app-panels .pn-chip { color: var(--pt-app-fg); }
