/* The Favicon Generator (inc/fav-tool.inc.php): the samples, the icon on a
   see-through check, the swatches and shape buttons, the tab and home-screen
   looks and the <head> tags. The layout is pt-ui.css's, the phone editor
   pt-app.css's. */

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

/* ── The icon ─────────────────────────────────────────────────────────── */
#fav-viewport { display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
#fav-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  /* See-through shows as a light check. */
  background: repeating-conic-gradient(#e9ecef 0 25%, #fff 0 50%) 0 0 / 24px 24px;
}
#fav-canvas:active { cursor: grabbing; }
#fav-canvas:focus { outline: none; }
#fav-canvas:focus-visible { outline: 3px solid rgba(15, 112, 230, 0.5); outline-offset: 4px; }
#fav-canvas[hidden] { display: none; }
@media (min-width: 768px) {
  #fav-canvas { height: 100%; width: auto; }
}
.pt-app-stage #fav-canvas { background: repeating-conic-gradient(#3a3f4b 0 25%, #2a2e37 0 50%) 0 0 / 24px 24px; }

/* ── Controls ─────────────────────────────────────────────────────────── */
.fav-title { display: block; }
.fav-note { font-size: 0.7rem; line-height: 1.45; color: #6c757d; margin: 6px 0 0; }
.pt-app-sheet .fav-note { color: inherit; opacity: 0.75; }
#fav-drop[hidden], #fav-text-row[hidden] { display: none !important; }

/* Image | Text */
.fav-mode { display: flex; border: 1px solid #dee2e6; border-radius: 10px; padding: 3px; gap: 3px; background: #f6f8fb; }
.fav-mode-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #343f52;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.fav-mode-btn[aria-pressed="true"] { background: #fff; color: var(--pt-accent, #0f70e6); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.fav-mode-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(15, 112, 230, 0.35); }

.fav-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.fav-swatch {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.fav-swatch:hover { transform: scale(1.06); }
.fav-swatch:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(15, 112, 230, 0.6); }
.fav-swatch[aria-pressed="true"],
.fav-swatch-pick.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pt-accent, #0f70e6); }
/* See-through: a check. */
.fav-swatch-none { background: repeating-conic-gradient(#cfd4da 0 25%, #fff 0 50%) 0 0 / 12px 12px !important; }
/* A colour of your own: the colour wheel, the picker over it. */
.fav-swatch-pick { display: block; background: conic-gradient(#ff4757, #ffd32a, #00c389, #00c6ff, #4782dc, #764ba2, #ff4757); margin: 0; }
.fav-swatch-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

.fav-seg { display: flex; gap: 8px; }
.fav-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 40px;
  padding: 0;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  background: #fff;
  color: #343f52;
  cursor: pointer;
}
.fav-seg-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-seg-btn:hover { border-color: var(--pt-accent, #0f70e6); }
.fav-seg-btn[aria-pressed="true"] { border-color: var(--pt-accent, #0f70e6); background: #eef3fc; color: var(--pt-accent, #0f70e6); }
.fav-seg-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(15, 112, 230, 0.35); }

/* ── How it looks: two tabs and a home screen ─────────────────────────── */
.fav-looks { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 14px 18px; margin-top: 14px; }
.fav-looks[hidden] { display: none; }
.fav-look { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.fav-look-label { font-size: 0.7rem; color: #6c757d; }
.fav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 180px;
  max-width: 100%;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px 10px 0 0;
  font-size: 0.75rem;
  overflow: hidden;
}
.fav-tab-light { background: #fff; color: #1f2329; box-shadow: 0 0 0 1px #dee2e6, 0 -2px 0 #e9ecef inset; }
.fav-tab-dark { background: #35363a; color: #e8eaed; }
.fav-tab-icon { flex: none; width: 16px; height: 16px; }
.fav-tab-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-home {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #5b7fd8, #9b6fd0);
}
/* iOS rounds the Apple icon's corners itself. */
#fav-home-icon { width: 60px; height: 60px; border-radius: 13px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }

/* ── The <head> tags ──────────────────────────────────────────────────── */
.fav-code { margin-top: 16px; text-align: start; }
.fav-code[hidden] { display: none; }
.fav-code .fav-tag { color: inherit; font-size: .92em; padding: 0; background: none; }
#fav-snippet {
  margin: 0;
  padding: 10px 12px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #f6f8fb;
  color: #343f52;
  font-size: 0.7rem;
  line-height: 1.6;
  white-space: pre;
  text-align: left;
}

/* ── In the phone editor's bottom bar ─────────────────────────────────── */
/* The swatches are one sideways row (pt-app-strip), a little bigger for a
   finger; the shapes sit in the middle; Letters is its field, the font and
   the colors. By id: pt-app.css shows panels as blocks. */
.pt-app-panels #fav-bgs .fav-swatch { width: 40px; height: 40px; border-color: var(--pt-app-line-strong); }
.pt-app-panels #fav-bgs.pt-app-panel-on { padding: 6px 6px 8px; gap: 10px; }
.pt-app-panels #fav-shape.pt-app-panel-on { display: flex !important; justify-content: center; gap: 12px; padding: 4px 0 6px; }
.pt-app-panels .fav-seg-btn {}
.pt-app-panels .fav-seg-btn[aria-pressed="true"] {}
.pt-app-panels .fav-swatch[aria-pressed="true"],
.pt-app-panels .fav-swatch-pick.on { box-shadow: 0 0 0 2px var(--pt-app-bg), 0 0 0 4px #5b8def; }
.pt-app-panels #fav-text-row.pt-app-panel-on {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 8px;
  padding: 6px 8px 8px;
  margin: 0 !important;
}
.pt-app-panels #fav-text-row .form-label { display: none; }
.pt-app-panels #fav-text-row .form-control,
.pt-app-panels #fav-text-row .form-select { margin: 0 !important; font-size: 16px; }
.pt-app-panels #fav-inks { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding: 4px 4px 2px; }
.pt-app-panels #fav-inks .fav-swatch { width: 34px; height: 34px; border-color: var(--pt-app-line-strong); }
