/* InstallSheet — in-PWA modal to set a mini-app's home-screen name +
   icon before entering the install surface. Overlay/card language
   mirrors ManageModelsModal / WalkthroughOverlay (hand-rolled fixed
   overlay; the shell has no shared Dialog primitive). */

.is__overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: is-fade 0.16s ease;
}

@keyframes is-fade { from { opacity: 0; } to { opacity: 1; } }

.is__card {
  width: 100%;
  max-width: 420px;
  background: var(--surface, #14181f);
  color: var(--text, #d4d4d8);
  border: 1px solid var(--border, #252b36);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: is-pop 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes is-pop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.is__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}

.is__row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.is__icon-wrap {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  /* No opaque tile — the raw /api/apps/{id}/icon route returns the original
     transparent PNG so glossy 3D catalog icons render without a dark halo.
     A 1px border keeps the tap-target visible for the custom-icon affordance. */
  border: 1px solid var(--border, #252b36);
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.is__icon-wrap:focus-visible {
  outline: 2px solid var(--accent, #a78bfa);
  outline-offset: 2px;
}

.is__icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.is__icon-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: var(--accent, #a78bfa);
  color: #0c0f14;
  border-radius: 50%;
  border: 2px solid var(--surface, #14181f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.is__fields {
  flex: 1;
  min-width: 0;
}

.is__field-label {
  display: block;
  font-size: 12px;
  color: var(--muted, #9ca3af);
  margin-bottom: 6px;
}

.is__name-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #252b36);
  background: var(--bg, #0c0f14);
  color: var(--text, #d4d4d8);
  font: inherit;
  font-size: 15px;
}

.is__name-input:focus {
  outline: none;
  border-color: var(--accent, #a78bfa);
}

.is__preview {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted, #9ca3af);
}

.is__preview strong {
  color: var(--text, #d4d4d8);
  font-weight: 600;
}

.is__hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #9ca3af);
}

.is__error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid var(--danger, #f87171);
  color: var(--danger, #f87171);
  font-size: 13px;
}

.is__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.is__btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.is__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.is__btn--primary {
  background: var(--accent, #a78bfa);
  color: #0c0f14;
}

.is__btn--secondary {
  background: transparent;
  color: var(--muted, #9ca3af);
  border: 1px solid var(--border, #252b36);
}

/* iOS Safari Share-step copy: larger, higher-contrast than the form
   hint since it's now the card's main content, and a bounce-arrow that
   points down at the Safari Share button in the browser chrome. */
.is__hint--steps {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text, #d4d4d8);
}

.is__hint--steps strong {
  color: var(--accent, #a78bfa);
  font-weight: 600;
}

.is__arrow {
  display: block;
  margin-top: 10px;
  font-size: 22px;
  text-align: center;
  color: var(--accent, #a78bfa);
  animation: is-arrow-bounce 1.6s ease-in-out infinite;
}

@keyframes is-arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
