/* Artifactory refresh (CF, 2026-11): first-run clarity, 44px targets,
   lazy thumb hooks, proper focus. Keeps the existing monochrome chrome. */

.pod-tools .icon-btn,
.pod-tools .cta,
.pod-tools .mode-sw .mode-opt,
.pod-tools .mode-opt,
.info-btn,
.panel .x,
button.afx-orbit,
.stage .afx-orbit,
[aria-label="Stop orbiting"],
[aria-label="Orbit"] {
  min-width: 44px !important;
  min-height: 44px !important;
}
.pod-tools .icon-btn:has(svg),
.pod-tools .icon-btn.gl,
.pod-tools .icon-btn.menu {
  width: 44px;
  padding: 0;
}

/* Desktop "How it works": labeled control, not a 24px glyph. */
.info-btn {
  width: auto !important;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  gap: 6px;
  border-radius: var(--ds-r, 6px);
  background: var(--ds-raised, rgba(255,255,255,.06));
  color: var(--ds-ink-2, rgba(255,255,255,.66));
  font: 400 12px/1 var(--ds-font, Geist, sans-serif);
  text-transform: none;
  letter-spacing: 0;
}
.info-btn::before {
  content: "How it works";
  white-space: nowrap;
}
.info-btn .ico,
.info-btn svg { width: 14px; height: 14px; }
.info-btn::after { display: none; }

.title-in:focus,
.title-in:focus-visible {
  outline: 2px solid var(--ds-select, rgba(255,255,255,.92)) !important;
  outline-offset: 2px !important;
}

/* One heading: visually hidden on desktop, placed at the top on phones. */
h1.afx-name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.afx-firstrun { display: none; }

[style*="--afx-thumb"] {
  background-size: cover;
  background-position: 50%;
}

/* Never let help copy land in the 3-column panel title bar. */
.panel-bar .afx-how { display: none !important; }

@media (max-width: 560px) {
  h1.afx-name {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 16px;
    right: 16px;
    z-index: 4;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    overflow: visible;
    white-space: normal;
    font: 400 15px/1.2 var(--ds-font, Geist, sans-serif);
    color: var(--ds-ink, rgba(255,255,255,.92));
    letter-spacing: -0.02em;
    text-transform: none;
    pointer-events: none;
  }
  .afx-firstrun {
    display: block;
    position: fixed;
    top: calc(30px + env(safe-area-inset-top, 0px));
    left: 16px;
    right: 16px;
    z-index: 4;
    pointer-events: none;
    text-align: left;
  }
  .afx-firstrun .afx-hint {
    margin: 0;
    font: 400 13px/1.3 var(--ds-font, Geist, sans-serif);
    color: var(--ds-ink-2, rgba(255,255,255,.66));
    text-transform: none;
    letter-spacing: 0;
  }

  .pod-tools [title="Open object panel"],
  .pod-tools [title="Toggle scene panel"] {
    font-size: 10px !important;
    flex-direction: column;
    gap: 2px;
    min-width: 48px !important;
    width: auto !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 4px 6px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ds-ink, rgba(255,255,255,.92));
  }
  .pod-tools [title="Open object panel"]::before,
  .pod-tools [title="Toggle scene panel"]::before {
    width: 16px;
    height: 16px;
  }

  .pod-tools .icon-btn,
  .pod-tools .cta,
  .pod-tools .mode-sw .mode-opt {
    min-width: 44px;
    min-height: 44px;
  }

  .panel-code, .panel-form, .panels, .panel-params, .panels > .panel {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .afx-how {
    margin: 0 12px 12px;
    padding: 0;
    font: 400 12px/1.4 var(--ds-font, Geist, sans-serif);
    color: var(--ds-ink-2, rgba(255,255,255,.66));
    text-transform: none;
    letter-spacing: 0;
    max-width: 42ch;
  }
  .afx-how ol { margin: 8px 0 0; padding-left: 1.2em; }
  .afx-how li { margin: 0 0 6px; }
  .afx-how li:last-child { margin: 0; }
}

@media (min-width: 561px) {
  .afx-how { display: none; }
}

.gen-row input, .gen-go, .pod .mini, button[aria-label="Save this artifact"] {
  min-height: 44px;
}
.gen-go { min-width: 44px; width: 44px; }

.afx-how summary {
  cursor: pointer;
  list-style: none;
  font: 400 12px/1.3 var(--ds-font, Geist, sans-serif);
  color: var(--ds-ink, rgba(255,255,255,.92));
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.afx-how summary::-webkit-details-marker { display: none; }
.afx-how summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  opacity: .7;
}
.afx-how[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.afx-how[open] summary { color: var(--ds-ink-2, rgba(255,255,255,.66)); }

@media (max-width: 560px) {
  .pod-tools .mode-sw .mode-opt,
  .pod-tools .mode-opt {
    min-width: 44px !important;
    width: 44px !important;
    min-height: 44px !important;
  }
  .panel [title="Grid view"],
  .panel [title="List view"],
  .panel [aria-label="Grid view"],
  .panel [aria-label="List view"] {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .afx-how { margin: 0 12px 4px; }
  .afx-how p:first-of-type { margin-top: 0; }
}
