/* ==========================================================================
   Favicon Generator
   ========================================================================== */

.fav-src { display: flex; flex-direction: column; gap: 1rem; }
.fav-src[hidden], .fav [hidden] { display: none !important; }
.fav-text-input { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.04em; }
.opt { color: var(--muted); font-weight: 400; }

.fav-style {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.fav-style .action-label { margin: 0; }
.fav-bg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.fav-swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.fav-color {
  display: inline-flex;
  align-items: center;
  align-self: end;
  gap: 0.6rem;
  width: fit-content;
  padding: 0.35rem 0.8rem 0.35rem 0.35rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.fav-color input {
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.fav-color input::-webkit-color-swatch-wrapper { padding: 0; }
.fav-color input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.fav-color input::-moz-color-swatch { border: 0; border-radius: 50%; }
.fav-color span { display: flex; flex-direction: column; line-height: 1.2; }
.fav-color b { color: var(--text); font-size: 0.8rem; font-weight: 600; }
.fav-color code { color: var(--muted); font-family: var(--font-mono); font-size: 0.76rem; }
.fav-path { align-self: end; padding-bottom: 0.6rem; }

.fav-range { width: 100%; accent-color: var(--violet); }
.fav .field-label output {
  display: inline-block;
  min-width: 2.4em;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--lilac);
  font-size: 0.8rem;
  text-align: center;
}

.fav-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.fav-file img {
  width: 44px; height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: repeating-conic-gradient(rgba(var(--ink), 0.08) 0 25%, transparent 0 50%) 0 0 / 10px 10px;
}
.fav-file-name { flex: 1; min-width: 0; overflow: hidden; color: var(--text-2); font-size: 0.86rem; text-overflow: ellipsis; white-space: nowrap; }

/* Browser tab mock-ups */
.fav-tabs { display: flex; flex-direction: column; gap: 0.6rem; }
.fav-tabbar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 10px 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.fav-tabbar.is-light { background: #dee1e6; color: #3c4043; }
.fav-tabbar.is-dark { background: #202124; color: #e8eaed; }
.fav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 210px;
  min-width: 0;
  height: 34px;
  padding: 0 10px 0 12px;
  border-radius: 9px 9px 0 0;
  font: 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.fav-tab span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-tab i { font-style: normal; font-size: 14px; opacity: 0.7; }
.is-light .fav-tab.is-active { background: #fff; }
.is-dark .fav-tab.is-active { background: #35363a; }
.fav-tab:not(.is-active) { opacity: 0.7; }
.fav-tab-icon { flex: none; width: 16px; height: 16px; }
.fav-tab-ghost { flex: none !important; width: 16px; height: 16px; border-radius: 50%; background: currentColor; opacity: 0.25; }

/* Size grid */
.fav-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
@media (max-width: 520px) { .fav-sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fav-size {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
}
.fav-size-box {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  background: repeating-conic-gradient(rgba(var(--ink), 0.07) 0 25%, transparent 0 50%) 0 0 / 12px 12px;
}
.fav-size canvas { image-rendering: auto; }
.fav-size figcaption { display: flex; flex-direction: column; gap: 0.1rem; }
.fav-size b { color: var(--text); font-size: 0.8rem; }
.fav-size span { color: var(--muted); font-size: 0.72rem; line-height: 1.3; }

/* Phone home screen */
.fav-phone { display: flex; flex-direction: column; gap: 0.5rem; }
.fav-phone-screen {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 1.1rem 1rem;
  border-radius: 22px;
  background: linear-gradient(160deg, #1e3a8a, #6d28d9 55%, #db2777);
}
.fav-app { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; color: #fff; font: 500 11px/1.2 system-ui, -apple-system, sans-serif; text-align: center; }
.fav-app canvas, .fav-app.is-ghost span:first-child { width: 56px; height: 56px; border-radius: 13px; }
.fav-app.is-ghost span:first-child { background: rgba(255, 255, 255, 0.22); }
.fav-app span:last-child { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.fav-phone .field-hint { margin: 0; }

.fav-code-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.fav-code .code-out { max-height: 240px; font-size: 0.78rem; white-space: pre; }
