/* Favicon Generator: styles for this tool only. Shared styles live in /tools/shared/tools.css. */

html,
body {
  overflow-x: clip;
}
/* Same shape as the PDF tools: the photo fills the left, the options dock to the right */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  width: 100%;
}
.workspace.is-file-over {
  outline: 2px dashed var(--color-accent);
  outline-offset: -8px;
}
.dropzone-empty {
  overflow-y: auto;
}
.gen {
  display: contents;
}
.gen[hidden],
.dropzone-empty[hidden] {
  display: none;
}
.col {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-width: 0;
  min-height: 0;
  padding: var(--space-4);
  overflow-y: auto;
}
.col > .panel {
  width: 100%;
  max-width: 520px;
}
@media (max-width: 860px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .workspace {
    flex-direction: column;
  }
  .col {
    justify-content: flex-start;
    overflow: visible;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.panel-title {
  font-size: var(--text-md);
}
.row.between {
  justify-content: space-between;
  align-items: center;
}

/* ---------- crop stage ---------- */

.stage-wrap {
  border-radius: var(--radius-lg);
  background-color: var(--color-field);
  background-image:
    linear-gradient(45deg, rgba(128, 128, 128, 0.18) 25%, transparent 25%, transparent 75%, rgba(128, 128, 128, 0.18) 75%),
    linear-gradient(45deg, rgba(128, 128, 128, 0.18) 25%, transparent 25%, transparent 75%, rgba(128, 128, 128, 0.18) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  overflow: hidden;
}
#stage {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  cursor: grab;
  touch-action: none;
}
#stage.dragging {
  cursor: grabbing;
}

/* ---------- controls ---------- */

.ctl {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.ctl > span {
  padding: var(--space-1) 0 var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.bg-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.bg-row .segmented {
  flex: 1;
}
#bgcolor {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
#bgcolor::-webkit-color-swatch-wrapper {
  padding: 0;
}
#bgcolor::-webkit-color-swatch {
  border: 0;
}
#bgcolor::-moz-color-swatch {
  border: 0;
}
#bgcolor:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
#bgcolor:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ---------- size previews ---------- */

.previews {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--color-field);
}
.previews figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.previews figcaption {
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.previews canvas {
  display: block;
}
#p180 {
  width: 64px;
  height: 64px;
}

/* ---------- downloads ---------- */

.files {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.files li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0;
}
.file-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  cursor: pointer;
}
.file-dl:hover {
  color: var(--color-muted);
}
.files .name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  white-space: nowrap;
}
.files .meta {
  white-space: nowrap;
}
.files .meta {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.code {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--color-field);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
}

/* ---------- right side panel: docked, scrolls, with the downloads pinned at the bottom ---------- */

.side {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 25%;
  min-width: 30rem;
  margin: var(--space-4) var(--space-4) var(--space-4) 0;
  border-radius: var(--radius-2xl);
  background: var(--color-surface);
  overflow: hidden;
}
.side-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-6);
  min-height: 0;
  padding: var(--space-6);
  overflow-y: auto;
}
.group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.group + .group {
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.side-body {
  gap: var(--space-4);
}
.group[aria-label="HTML"] {
  gap: var(--space-1);
}
.group[aria-label="HTML"] > p {
  margin-bottom: var(--space-2);
}
.group[aria-label="Style"] {
  gap: var(--space-4);
}
.side-foot {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6) var(--space-6);
}
.side-foot .btn {
  width: 100%;
}
@media (max-width: 860px) {
  .side {
    width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 0;
    overflow: visible;
  }
  .side-foot {
    position: sticky;
    bottom: 0;
    z-index: 20;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, 0.25);
  }
}
