.tool-link {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.tool-link:hover,
.tool-link.active {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

.favicon-hero {
  padding-bottom: 42px;
}

.favicon-hero h1 {
  max-width: 930px;
  margin-inline: auto;
}

.favicon-app {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, .78fr);
  gap: 24px;
  align-items: start;
}

.favicon-builder,
.favicon-output {
  display: grid;
  gap: 24px;
}

.favicon-output {
  position: sticky;
  top: 86px;
}

.favicon-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 2px 0 0;
  font-size: 21px;
  line-height: 1.2;
}

.panel-step {
  margin: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.drop-zone {
  margin: 20px;
  min-height: 250px;
  border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--line));
  border-radius: 16px;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--primary) 9%, transparent), transparent 58%),
    var(--bg);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px;
  text-align: center;
  outline: none;
  transition: border-color .18s, background .18s, transform .18s;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragging {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--bg));
  transform: translateY(-1px);
}

.drop-zone strong {
  font-size: 20px;
}

.drop-zone span,
.drop-zone small {
  color: var(--muted);
}

.drop-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(101, 87, 232, .25);
}

.source-summary {
  margin: 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.source-summary strong,
.source-summary span {
  display: block;
}

.source-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.source-thumbnail {
  width: 66px;
  height: 66px;
  padding: 7px;
  border-radius: 12px;
  background:
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-2) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.source-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.field-error {
  margin: -8px 20px 20px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff0f2;
  color: var(--danger);
  font-size: 13px;
}

.favicon-form-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.favicon-form-grid input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.field-help {
  color: var(--muted);
  font-size: 12px;
}

.background-choice {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.background-choice legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.background-choice label {
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  cursor: pointer;
}

.background-choice label:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.background-choice input {
  margin-top: 4px;
  accent-color: var(--primary);
}

.background-choice span,
.background-choice b,
.background-choice small {
  display: block;
}

.background-choice small {
  margin-top: 2px;
  color: var(--muted);
}

.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-toggle input {
  accent-color: var(--primary);
}

.preview-stage {
  min-height: 390px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--primary) 10%, transparent), transparent 58%),
    var(--bg);
}

.preview-checker {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-2) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
  background-size: 26px 26px;
  background-position: 0 0, 0 13px, 13px -13px, -13px 0;
}

.icon-preview {
  width: min(290px, 72%);
  aspect-ratio: 1;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(23, 24, 39, .19);
  transition: border-radius .2s;
}

.icon-preview.square {
  border-radius: 0;
}

.icon-preview.rounded {
  border-radius: 24%;
}

.icon-preview.circle {
  border-radius: 50%;
}

.icon-preview.maskable {
  border-radius: 30%;
}

.icon-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.maskable-guide {
  position: absolute;
  inset: 10%;
  border: 2px dashed rgba(255, 255, 255, .92);
  border-radius: 50%;
  box-shadow:
    0 0 0 999px rgba(18, 20, 33, .22),
    0 0 0 1px rgba(18, 20, 33, .28);
  pointer-events: none;
}

.context-previews {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(130px, .7fr);
  gap: 12px;
  border-top: 1px solid var(--line);
}

.browser-context,
.device-context {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.browser-context {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 7px 20px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.browser-context canvas {
  width: 20px;
  height: 20px;
}

.browser-context span:nth-of-type(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-context b {
  color: var(--muted);
}

.browser-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.device-context {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.device-context canvas {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.device-context span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.file-list {
  margin: 0;
  padding: 10px 18px 4px;
  list-style: none;
}

.file-list li {
  min-width: 0;
  padding: 11px 2px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.file-list li:last-child {
  border-bottom: 0;
}

.file-list b,
.file-list small {
  display: block;
}

.file-list b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.file-list small,
.file-state {
  color: var(--muted);
  font-size: 11px;
}

.file-badge {
  padding: 5px 4px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.file-state {
  color: var(--success);
  font-weight: 800;
}

.download-button {
  width: calc(100% - 36px);
  margin: 14px 18px 10px;
  padding: 13px 16px;
}

.download-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.privacy-note {
  margin: 0 18px 18px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.snippet-panel pre {
  max-height: 220px;
}

.favicon-guide,
.faq-section,
.tool-cta {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.favicon-guide,
.faq-section {
  margin-bottom: 90px;
}

.guide-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.guide-heading h2,
.tool-cta h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.guide-heading>p:last-child,
.tool-cta p {
  color: var(--muted);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.guide-grid article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.guide-grid article>span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.guide-grid h3 {
  margin: 10px 0 8px;
  font-size: 20px;
}

.guide-grid p {
  margin: 0;
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.faq-list summary {
  padding: 17px 19px;
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin: 0;
  padding: 0 19px 19px;
  color: var(--muted);
}

.tool-cta {
  margin-bottom: 90px;
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.tool-cta p {
  margin: 10px 0 0;
}

.tool-cta .primary-button {
  flex: 0 0 auto;
  text-decoration: none;
}

@media (max-width: 1050px) {
  .favicon-app {
    grid-template-columns: 1fr;
  }
  
  .favicon-output {
    position: static;
  }
}

@media (max-width: 720px) {
  .header-actions .tool-link {
    display: none;
  }
  
  .favicon-app,
  .favicon-guide,
  .faq-section,
  .tool-cta {
    width: min(100% - 24px, 1120px);
  }
  
  .favicon-form-grid,
  .background-choice,
  .guide-grid {
    grid-template-columns: 1fr;
  }
  
  .preview-stage {
    min-height: 330px;
  }
  
  .context-previews {
    grid-template-columns: 1fr;
  }
  
  .tool-cta {
    align-items: flex-start;
    flex-direction: column;
  }
  
  .tool-cta .primary-button {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 500px) {
  .source-summary {
    grid-template-columns: 56px minmax(0, 1fr);
  }
  
  .source-summary .ghost-button {
    grid-column: 1 / -1;
  }
  
  .file-list li {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  
  .file-state {
    display: none;
  }
  
  .preview-stage {
    min-height: 290px;
  }
  
  .panel-heading {
    padding: 16px;
  }
  
  .favicon-form-grid {
    padding: 16px;
  }
}