.mobile-app {
  container-type: inline-size;
}

.mobile-app-heading {
  align-items: center;
}

.mobile-app-setup {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  padding: 0;
}

.mobile-app-setting {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 22px;
}

.mobile-app-setting + .mobile-app-setting {
  border-inline-start: 1px solid var(--border);
}

.mobile-app-setting-icon,
.mobile-app-icon-tile {
  display: grid;
  flex: none;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
}

.mobile-app-setting-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.mobile-app-icon-tile {
  width: 65px;
  height: 65px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
}

.mobile-app-icon-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mobile-app-setting-content {
  flex: 1;
  min-width: 0;
}

.mobile-app-label {
  display: block;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
}

.mobile-app-domain {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.mobile-app-domain:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mobile-app-domain input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 43px;
  padding: 8px 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.mobile-app-domain > span {
  display: flex;
  flex: none;
  align-items: center;
  padding-inline: 12px;
  border-inline-start: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.mobile-app-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mobile-app-hint strong {
  color: var(--text);
  font-weight: 600;
}

.mobile-app-domain-preview {
  display: block;
  margin-top: 7px;
  color: var(--accent);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mobile-app-upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.mobile-app-upload {
  position: relative;
  cursor: pointer;
}

.mobile-app-upload:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.mobile-app-upload input,
.mobile-app-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mobile-app [hidden] {
  display: none;
}

.mobile-app-status {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-app-status:empty {
  margin: 0;
}

.mobile-app-gallery {
  margin-top: 30px;
}

.mobile-app-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.mobile-app-gallery-head h2 {
  margin: 0;
}

.mobile-app-ai {
  flex: none;
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
  white-space: normal;
  text-align: left;
}

.mobile-app-ai svg {
  flex: none;
}

.mobile-app-templates {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mobile-app-template {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.mobile-app-template:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.mobile-app-template:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.mobile-app-template:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.mobile-app-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-width: 0;
  padding: 14px 8px;
  border-radius: 14px 14px 0 0;
  background: radial-gradient(ellipse at 50% 100%, var(--accent-soft), var(--surface2) 72%);
}

.mobile-app-phone {
  --mobile-app-scale: .34;
  display: block;
  width: calc(390px * var(--mobile-app-scale));
  height: calc(650px * var(--mobile-app-scale));
  overflow: hidden;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border), 0 5px 16px #15213b24;
}

.mobile-app-phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-app-template-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.mobile-app-template-name input {
  flex: none;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.mobile-app-empty {
  padding: 20px;
  color: var(--muted);
}

@container (max-width: 1080px) {
  .mobile-app-templates {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@container (max-width: 730px) {
  .mobile-app-setup {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-app-setting + .mobile-app-setting {
    border-inline-start: 0;
    border-top: 1px solid var(--border);
  }

  .mobile-app-templates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container (max-width: 520px) {
  .mobile-app-heading,
  .mobile-app-gallery-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-app-setting {
    gap: 10px;
    padding: 16px;
  }

  .mobile-app-templates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-app-phone {
    --mobile-app-scale: .30;
  }
}

@container (max-width: 315px) {
  .mobile-app-setting-icon {
    display: none;
  }

  .mobile-app-phone {
    --mobile-app-scale: .26;
  }
}
