/* The sketch tool (inc/sketch-tool.inc.php): the samples, the style tiles
   and the drawing. 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 ─────────────────────────────────────────── */
.sketch-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. */
#sk-empty.hidden { display: none; }
.sketch-editor .sample-thumbnails { display: flex; justify-content: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.sketch-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;
}
.sketch-editor .sample-thumbnail:hover,
.sketch-editor .sample-thumbnail:focus-visible { border-color: var(--pt-accent, #0f70e6); box-shadow: 0 4px 12px rgba(15, 112, 230, 0.25); }
.sketch-editor .sample-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767px) { .sketch-editor .sample-thumbnail { width: 84px; height: 84px; } }

/* ── The drawing ──────────────────────────────────────────────────────── */
#sk-viewport { position: relative; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
#sk-canvas { display: block; max-width: 100%; max-height: 100%; border-radius: 6px; background: #fff; }
#sk-canvas[hidden] { display: none; }
/* Transparent background: the lines over a checkerboard. */
#sk-canvas.sk-alpha { background: repeating-conic-gradient(#e6e6e6 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; }
#sk-compare.active { color: #fff; background: var(--cb-ink, #16181d); border-color: var(--cb-ink, #16181d); }

/* ── Style tiles: the photo in each style ─────────────────────────────── */
.sk-styles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sk-style {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cb-text, #3d434b);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}
.sk-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--cb-line, #e4e1dc);
  transition: box-shadow 0.15s;
}
.sk-thumb canvas { display: block; width: 100%; height: 100%; }
.sk-name { max-width: 100%; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.sk-style:hover .sk-thumb { box-shadow: inset 0 0 0 1px var(--cb-line, #e4e1dc), 0 0 0 2px #cfcac3; }
.sk-style[aria-pressed="true"] { color: var(--cb-ink, #16181d); font-weight: 700; }
/* The chosen one: CB's double ring. */
.sk-style[aria-pressed="true"] .sk-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cb-ink, #16181d); }
.sk-style:focus-visible { outline: none; }
.sk-style:focus-visible .sk-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(15, 112, 230, 0.6); }
fieldset:disabled .sk-style { cursor: default; opacity: 0.75; }

.sk-link {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 0.8rem;
  color: var(--pt-accent, #0f70e6);
  cursor: pointer;
}
.sk-link:disabled { color: #9aa1aa; cursor: default; }
.sk-hint { font-size: 0.7rem; line-height: 1.45; color: #6c757d; margin: 2px 0 10px; }
#sk-print { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* ── Phone editor: the tiles lifted into the bottom bar ───────────────── */
/* One row that scrolls sideways (pt-app.css's strip). */
.pt-app-panels .sk-styles { display: flex; gap: 10px; padding: 6px 4px; }
.pt-app-panels .sk-style { flex: 0 0 auto; width: 68px; color: var(--pt-app-fg); }
.pt-app-panels .sk-style[aria-pressed="true"] { color: var(--pt-app-fg); }
.pt-app-panels .sk-thumb { box-shadow: inset 0 0 0 1px var(--pt-app-line-strong); }
